File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -447,9 +447,14 @@ public void clearDirectory() throws IOException {
447447 throw new IOException ("Cannot create directory " + curDir );
448448 }
449449 if (permission != null ) {
450- Set <PosixFilePermission > permissions =
451- PosixFilePermissions .fromString (permission .toString ());
452- Files .setPosixFilePermissions (curDir .toPath (), permissions );
450+ try {
451+ Set <PosixFilePermission > permissions =
452+ PosixFilePermissions .fromString (permission .toString ());
453+ Files .setPosixFilePermissions (curDir .toPath (), permissions );
454+ } catch (UnsupportedOperationException uoe ) {
455+ // Default to FileUtil for non posix file systems
456+ FileUtil .setPermission (curDir , permission );
457+ }
453458 }
454459 }
455460
You can’t perform that action at this time.
0 commit comments