public static JarFile getRtJar(Iterator<JarFile> x) { while (x.hasNext()) { JarFile JF = x.next(); if (JF.getName().endsWith(File.separator + "rt.jar")) { return JF; } if (JF.getName().endsWith(File.separator + "core.jar")) { return JF; } // hack for Mac if (PlatformUtil.onMacOSX() && JF.getName().endsWith(File.separator + "classes.jar")) { return JF; } } return null; }
/** * Determine the classpath noted in wala.properties for J2SE standard libraries * * If wala.properties cannot be loaded, returns jar files in boot classpath. * @throws IllegalStateException if jar files cannot be discovered * @see PlatformUtil#getBootClassPathJars() */ public static String[] getJ2SEJarFiles() { Properties p = null; try { p = WalaProperties.loadProperties(); } catch (WalaException e) { return PlatformUtil.getBootClassPathJars(); } String dir = p.getProperty(WalaProperties.J2SE_DIR); if (dir == null || !(new File(dir)).isDirectory()) { System.err.println("WARNING: java_runtime_dir " + dir + " in wala.properties is invalid. Using boot class path instead."); return PlatformUtil.getBootClassPathJars(); } return getJarsInDirectory(dir); }
@Test public void testURLWithInvalidURIChars() throws MalformedURLException { // setup: URL url = new URL("file:///[Eclipse]/File.jar"); String expected = PlatformUtil.onWindows() ? "/C:/[Eclipse]/File.jar" : "/[Eclipse]/File.jar"; // exercise: String actual = (new FileProvider()).filePathFromURL(url); // verify: assertEquals(expected, actual); }
@Test public void testURLWithSpace() throws MalformedURLException { URL url = new URL("file:///With%20Space/File.jar"); String expected = PlatformUtil.onWindows() ? "/C:/With Space/File.jar" : "/With Space/File.jar"; // exercise: String actual = (new FileProvider()).filePathFromURL(url); // verify: assertEquals(expected, actual); }
public static JarFile getRtJar(Iterator<JarFile> x) { while (x.hasNext()) { JarFile JF = x.next(); if (JF.getName().endsWith(File.separator + "rt.jar")) { return JF; } if (JF.getName().endsWith(File.separator + "core.jar")) { return JF; } // hack for Mac if (PlatformUtil.onMacOSX() && JF.getName().endsWith(File.separator + "classes.jar")) { return JF; } } return null; }
/** * Determine the classpath noted in wala.properties for J2SE standard libraries * * If wala.properties cannot be loaded, returns jar files in boot classpath. * @throws IllegalStateException if jar files cannot be discovered * @see PlatformUtil#getBootClassPathJars() */ public static String[] getJ2SEJarFiles() { Properties p = null; try { p = WalaProperties.loadProperties(); } catch (WalaException e) { return PlatformUtil.getBootClassPathJars(); } String dir = p.getProperty(WalaProperties.J2SE_DIR); if (dir == null || !(new File(dir)).isDirectory()) { System.err.println("WARNING: java_runtime_dir " + dir + " in wala.properties is invalid. Using boot class path instead."); return PlatformUtil.getBootClassPathJars(); } return getJarsInDirectory(dir); }
public static JarFile getRtJar(Iterator<JarFile> x) { while (x.hasNext()) { JarFile JF = x.next(); if (JF.getName().endsWith(File.separator + "rt.jar")) { return JF; } if (JF.getName().endsWith(File.separator + "core.jar")) { return JF; } // hack for Mac if (PlatformUtil.onMacOSX() && JF.getName().endsWith(File.separator + "classes.jar")) { return JF; } } return null; }
String signalParam = PlatformUtil.onMacOSX() ? "-Xrs" : null;
String signalParam = PlatformUtil.onMacOSX() ? "-Xrs" : null;
String signalParam = PlatformUtil.onMacOSX() ? "-Xrs" : null;
if (PlatformUtil.onMacOSX()) {