@@ -492,11 +492,12 @@ public class FileUtil {
if (null != sdst) {
if (sdst.isDirectory()) {
if (null == srcName) {
- throw new IOException("Target " + dst + " is a directory");
+ throw new PathIsDirectoryException(dst.toString());
}
return checkDest(null, dstFS, new Path(dst, srcName), overwrite);
} else if (!overwrite) {
- throw new IOException("Target " + dst + " already exists");
+ throw new PathExistsException(dst.toString(),
+ "Target " + dst + " already exists");
return dst;
@@ -552,7 +552,7 @@ public class RawLocalFileSystem extends FileSystem {
if (p2f.exists() && !p2f.isDirectory()) {
- throw new FileNotFoundException("Destination exists" +
+ throw new FileAlreadyExistsException("Destination exists" +
" and is not a directory: " + p2f.getCanonicalPath());
return (parent == null || parent2f.exists() || mkdirs(parent)) &&
@@ -34,7 +34,7 @@ public class RawlocalFSContract extends LocalFSContract {
super(conf);
- public static final String RAW_CONTRACT_XML = "contract/localfs.xml";
+ public static final String RAW_CONTRACT_XML = "contract/rawlocal.xml";
@Override
protected String getContractXml() {
@@ -17,10 +17,24 @@
-->
<configuration>
+
+ <!--
+ case sensitivity and permission options are determined at run time from OS type
+ -->
+ <property>
+ <name>fs.contract.is-case-sensitive</name>
+ <value>true</value>
+ </property>
+ <name>fs.contract.supports-unix-permissions</name>
<!--
- Here are most of the local FS contract options.
- some of them may be overridden at run time based on the OS,
- others potentially generated.
+ The remaining options are static
<property>
@@ -33,11 +47,6 @@
<value>1000</value>
</property>
- <property>
- <name>fs.contract.is-case-sensitive</name>
- <value>true</value>
- </property>
-
<name>fs.contract.supports-append</name>
<value>true</value>
@@ -73,6 +82,11 @@
+ <name>fs.contract.rename-remove-dest-if-empty-dir</name>
<name>fs.contract.supports-seek</name>
@@ -108,4 +122,4 @@
-</configuration>
+</configuration>