private String getStockNativePathString() { // return the path that is setup by the JVM String s = System.getProperty(JAVA_NATIVE_SYSPROP_NAME); if(!GFLauncherUtils.ok(s)) s = ""; return s; }
String getNativeLibraryPrefix() { String s = map.get(NATIVE_LIB_PREFIX); if(!GFLauncherUtils.ok(s)) s = ""; return s; }
String getNativeLibrarySuffix() { String s = map.get(NATIVE_LIB_SUFFIX); if(!GFLauncherUtils.ok(s)) s = ""; return s; }
private void addIgnoreNull(List<String> list, String s) { if (GFLauncherUtils.ok(s)) list.add(s); }
List<File> getSuffixClasspath() { String cp = map.get("classpath-suffix"); if(GFLauncherUtils.ok(cp)) { return GFLauncherUtils.stringToFiles(cp); } else { return new ArrayList<File>(); } }
List<File> getSystemClasspath() { String cp = map.get("system-classpath"); if(GFLauncherUtils.ok(cp)) { return GFLauncherUtils.stringToFiles(cp); } else { return new ArrayList<File>(); } }
List<String> getDebugOptions() { // we MUST break this up into the total number of -X commands (currently 2), // Since our final command line is a List<String>, we can't have 2 // options in one String -- the JVM will ignore the second option... // sample "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999" List<String> empty = Collections.emptyList(); String s = map.get("debug-options"); if(!GFLauncherUtils.ok(s)) { return empty; } String[] ss = s.split(" "); if(ss.length <= 0) { return empty; } return Arrays.asList(ss); }
List<File> getPrefixClasspath() { String cp = map.get("classpath-prefix"); if(GFLauncherUtils.ok(cp)) { return GFLauncherUtils.stringToFiles(cp); } else { return new ArrayList<File>(); } }
List<File> getClasspath() { if (!enabled) { return Collections.emptyList(); } String cp = config.get("classpath"); if (GFLauncherUtils.ok(cp)) { return GFLauncherUtils.stringToFiles(cp); } else { return Collections.emptyList(); } }
static private boolean isValidJavaRoot(String javaRootName) { if (!GFLauncherUtils.ok(javaRootName)) return false; // look for ${javaRootName}/bin/java[.exe] File f = new File(javaRootName); if (GFLauncherUtils.isWindows()) f = new File(f, "bin/java.exe"); else f = new File(f, "bin/java"); return f.exists(); }
static private boolean isValidJavaRoot(String javaRootName) { if (!GFLauncherUtils.ok(javaRootName)) return false; // look for ${javaRootName}/bin/java[.exe] File f = new File(javaRootName); if (GFLauncherUtils.isWindows()) f = new File(f, "bin/java.exe"); else f = new File(f, "bin/java"); return f.exists(); }
List<File> getNativePath() { if (!enabled) { return Collections.emptyList(); } String cp = config.get("native-library-path"); if (GFLauncherUtils.ok(cp)) { return GFLauncherUtils.stringToFiles(cp); } else { return Collections.emptyList(); } }
static private boolean isValidJavaRoot(String javaRootName) { if (!GFLauncherUtils.ok(javaRootName)) return false; // look for ${javaRootName}/bin/java[.exe] File f = new File(javaRootName); if (GFLauncherUtils.isWindows()) f = new File(f, "bin/java.exe"); else f = new File(f, "bin/java"); return f.exists(); }
private static void setInstallDirFromSystemProp() { // https://embedded-glassfish.dev.java.net/issues/show_bug.cgi?id=54 // // For instance if we are called from an Embedded Server then InstallRoot // may already be set as a System Prop -- and the jar we are running from has // nothing whatever to do with the concept of an "install root". // In that case we certainly do not want to wipe out the already set install root. // if anything is not kosher simply return w/o setting installDir to anything. String installRootDirName = System.getProperty(INSTALL_ROOT_PROPERTY); if(!ok(installRootDirName)) return; File f = SmartFile.sanitize(new File(installRootDirName)); if(f.isDirectory()) { installDir = f; } }
/** * Convert a classpath like string, e.g. c:/a;c:/b, and convert to List of File * @param cp The classpath-like string * @return the list of File */ public static List<File> stringToFiles(String cp) { List<File> list = new ArrayList<File>(); if(ok(cp)) { cp = SmartFile.sanitizePaths(cp); String[] ss = cp.split(File.pathSeparator); for(String s : ss) list.add(new File(s)); } return list; }
/** * Convert a classpath like string, e.g. c:/a;c:/b, and convert to List of File * @param cp The classpath-like string * @return the list of File */ public static List<File> stringToFiles(String cp) { List<File> list = new ArrayList<File>(); if(ok(cp)) { cp = SmartFile.sanitizePaths(cp); String[] ss = cp.split(File.pathSeparator); for(String s : ss) list.add(new File(s)); } return list; }
private static void setInstallDirFromSystemProp() { // https://embedded-glassfish.dev.java.net/issues/show_bug.cgi?id=54 // // For instance if we are called from an Embedded Server then InstallRoot // may already be set as a System Prop -- and the jar we are running from has // nothing whatever to do with the concept of an "install root". // In that case we certainly do not want to wipe out the already set install root. // if anything is not kosher simply return w/o setting installDir to anything. String installRootDirName = System.getProperty(INSTALL_ROOT_PROPERTY); if(!ok(installRootDirName)) return; File f = SmartFile.sanitize(new File(installRootDirName)); if(f.isDirectory()) { installDir = f; } }
/** * Convert a classpath like string, e.g. c:/a;c:/b, and convert to List of File * @param cp The classpath-like string * @return the list of File */ public static List<File> stringToFiles(String cp) { List<File> list = new ArrayList<File>(); if(ok(cp)) { cp = SmartFile.sanitizePaths(cp); String[] ss = cp.split(File.pathSeparator); for(String s : ss) list.add(new File(s)); } return list; }
private static void setInstallDirFromSystemProp() { // https://embedded-glassfish.dev.java.net/issues/show_bug.cgi?id=54 // // For instance if we are called from an Embedded Server then InstallRoot // may already be set as a System Prop -- and the jar we are running from has // nothing whatever to do with the concept of an "install root". // In that case we certainly do not want to wipe out the already set install root. // if anything is not kosher simply return w/o setting installDir to anything. String installRootDirName = System.getProperty(INSTALL_ROOT_PROPERTY); if(!ok(installRootDirName)) return; File f = SmartFile.sanitize(new File(installRootDirName)); if(f.isDirectory()) { installDir = f; } }
private void parseCluster(ParsedCluster pc) throws XMLStreamException, EndDocumentException { // cursor --> cluster element while (skipToButNotPast("cluster", "system-property", "server-ref")) { String name = parser.getLocalName(); if ("system-property".equals(name)) { // NOT parseSystemProperty() because this might not be "our" cluster // finalTouches() will add the correct system-property's parseProperty(pc.sysProps); } else if ("server-ref".equals(name)) { Map<String, String> atts = parseAttributes(); // atts is guaranteed to be non-null String sname = atts.get("ref"); if (GFLauncherUtils.ok(sname)) pc.serverNames.add(sname); } } }