From d26dce4415796e65c327c2d9158e389d31b9aae7 Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Fri, 18 Oct 2013 10:07:40 +0900 Subject: [PATCH] #48: Use standard chmod methods (setReadable, setWritable, etc.) instaead of calling chmod command --- src/main/java/org/xerial/snappy/SnappyLoader.java | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/xerial/snappy/SnappyLoader.java b/src/main/java/org/xerial/snappy/SnappyLoader.java index b946460..854bb1c 100755 --- a/src/main/java/org/xerial/snappy/SnappyLoader.java +++ b/src/main/java/org/xerial/snappy/SnappyLoader.java @@ -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