#48: Use standard chmod methods (setReadable, setWritable, etc.) instaead of calling chmod command

This commit is contained in:
Taro L. Saito 2013-10-18 10:07:40 +09:00
parent bbb30d35b8
commit d26dce4415
1 changed files with 3 additions and 12 deletions

View File

@ -228,18 +228,9 @@ public class SnappyLoader
}
// Set executable (x) flag to enable Java to load the native library
if (!System.getProperty("os.name").contains("Windows")) {
try {
Runtime.getRuntime().exec(new String[] { "chmod", "755", extractedLibFile.getAbsolutePath() })
.waitFor();
// Use following methods added since Java6 (If discarding Java5 is acceptable)
//extractedLibFile.setReadable(true);
//extractedLibFile.setWritable(true, true);
//extractedLibFile.setExecutable(true);
}
catch (Throwable e) {}
}
extractedLibFile.setReadable(true);
extractedLibFile.setWritable(true, true);
extractedLibFile.setExecutable(true);
// Check whether the contents are properly copied from the resource folder