diff options
4 files changed, 5 insertions, 40 deletions
diff --git a/bundles/org.eclipse.equinox.launcher/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.launcher/META-INF/MANIFEST.MF index 2902a2ad1..a90b09e48 100644 --- a/bundles/org.eclipse.equinox.launcher/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.launcher/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.equinox.launcher;singleton:=true -Bundle-Version: 1.5.600.qualifier +Bundle-Version: 1.5.700.qualifier Main-Class: org.eclipse.equinox.launcher.Main Bundle-ClassPath: . Bundle-Vendor: %providerName diff --git a/bundles/org.eclipse.equinox.launcher/pom.xml b/bundles/org.eclipse.equinox.launcher/pom.xml index c0c97ffe9..549a87f53 100644 --- a/bundles/org.eclipse.equinox.launcher/pom.xml +++ b/bundles/org.eclipse.equinox.launcher/pom.xml @@ -19,6 +19,6 @@ </parent> <groupId>org.eclipse.equinox</groupId> <artifactId>org.eclipse.equinox.launcher</artifactId> - <version>1.5.600-SNAPSHOT</version> + <version>1.5.700-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project> diff --git a/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java b/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java index bd9d17d00..456943ac4 100644 --- a/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java +++ b/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java @@ -1287,25 +1287,7 @@ public class Main { } private static boolean canWrite(File installDir) { - if (installDir.canWrite() == false) - return false; - - if (!installDir.isDirectory()) - return false; - - File fileTest = null; - try { - // we use the .dll suffix to properly test on Vista virtual directories - // on Vista you are not allowed to write executable files on virtual directories like "Program Files" - fileTest = File.createTempFile("writableArea", ".dll", installDir); //$NON-NLS-1$ //$NON-NLS-2$ - } catch (IOException e) { - //If an exception occured while trying to create the file, it means that it is not writtable - return false; - } finally { - if (fileTest != null) - fileTest.delete(); - } - return true; + return installDir.isDirectory() && Files.isWritable(installDir.toPath()); } /** diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/StorageUtil.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/StorageUtil.java index de8f3f794..634c069c7 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/StorageUtil.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/StorageUtil.java @@ -23,6 +23,7 @@ import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; +import java.nio.file.Files; import java.util.Dictionary; import java.util.Hashtable; import java.util.concurrent.TimeUnit; @@ -169,25 +170,7 @@ public class StorageUtil { } public static boolean canWrite(File installDir) { - if (installDir.canWrite() == false) - return false; - - if (!installDir.isDirectory()) - return false; - - File fileTest = null; - try { - // we use the .dll suffix to properly test on Vista virtual directories - // on Vista you are not allowed to write executable files on virtual directories like "Program Files" - fileTest = File.createTempFile("writableArea", ".dll", installDir); //$NON-NLS-1$ //$NON-NLS-2$ - } catch (IOException e) { - //If an exception occured while trying to create the file, it means that it is not writtable - return false; - } finally { - if (fileTest != null) - fileTest.delete(); - } - return true; + return installDir.isDirectory() && Files.isWritable(installDir.toPath()); } public static URL encodeFileURL(File file) throws MalformedURLException { |