HDFS-14890. Fixed namenode and journalnode startup on Windows.
Contributed by Siddharth Wagle
This commit is contained in:
parent
3f166512af
commit
aa24add8f0
@ -447,9 +447,14 @@ public void clearDirectory() throws IOException {
|
||||
throw new IOException("Cannot create directory " + curDir);
|
||||
}
|
||||
if (permission != null) {
|
||||
try {
|
||||
Set<PosixFilePermission> permissions =
|
||||
PosixFilePermissions.fromString(permission.toString());
|
||||
Files.setPosixFilePermissions(curDir.toPath(), permissions);
|
||||
} catch (UnsupportedOperationException uoe) {
|
||||
// Default to FileUtil for non posix file systems
|
||||
FileUtil.setPermission(curDir, permission);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user