Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JBrowser Source Code Files
JBrowser Source Code Files are provided in the
source package file.
You can download JBrowser source package as described in the previous tutorial and go to the "src" sub-folder to view Source Code files.
You can also browse JBrowser Source Code files below:
✍: FYIcenter
⏎ org/mozilla/browser/common/Platform.java
/**
*
*/
package org.mozilla.browser.common;
import java.util.StringTokenizer;
public enum Platform {
OSX("macosx"), Linux("linux"), Win32("win32"), Solaris("solaris"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
public static final Platform platform;
public static final String arch;
//http://lopica.sourceforge.net/os.html
//mapping of known os.name:os.arch combinations to xulrunner location
// SunOS:x86 --> solaris-x86
static {
String osname = System.getProperty("os.name"); //$NON-NLS-1$
if ("Mac OS X".equals(osname)) { //$NON-NLS-1$
platform = Platform.OSX;
} else if ("Linux".equals(osname)) { //$NON-NLS-1$
platform = Platform.Linux;
} else if ("SunOS".equals(osname)) { //$NON-NLS-1$
platform = Platform.Solaris;
} else {
platform = Platform.Win32;
}
String osarch = System.getProperty("os.arch"); //$NON-NLS-1$
String archTemp = osarch;
for (String x : new String[]{"i386", "i486", "i586", "i686"}) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
if (x.equals(osarch)) {
archTemp = "x86"; //$NON-NLS-1$
break;
}
}
arch = archTemp;
}
private final String libDir;
private Platform(String libDir) {
this.libDir = libDir;
}
public String libDir() {
return libDir;
}
public String arch() {
return arch;
}
public static boolean usingGTK2Toolkit() {
return platform==Linux || platform==Solaris;
}
public static long getJavaVersion() {
String v = System.getProperty("java.version"); //$NON-NLS-1$
return jdkVersionToNumber(v);
}
public static boolean checkJavaVersion(String minVersion, String maxVersion) {
long current = getJavaVersion();
if (minVersion!=null && minVersion.length()>0) {
long min = jdkVersionToNumber(minVersion);
if (current<min) return false;
}
if (maxVersion!=null && maxVersion.length()>0) {
long max = jdkVersionToNumber(maxVersion);
if (current>max) return false;
}
return true;
}
private static long jdkVersionToNumber(String verStr) {
try {
String numStr;
String buildStr;
int idx = verStr.indexOf("_"); //$NON-NLS-1$
if (idx>=0) {
numStr = verStr.substring(0, idx);
buildStr = verStr.substring(idx+1);
} else {
numStr = verStr;
buildStr = ""; //$NON-NLS-1$
}
long num = 0;
StringTokenizer st = new StringTokenizer(numStr, "."); //$NON-NLS-1$
long shift = 100*100*100;
while (st.hasMoreTokens()) {
String s = st.nextToken();
int n = Integer.parseInt(s);
num += n*shift;
shift /= 100;
}
if (buildStr.startsWith("b")) buildStr = buildStr.substring(1); //$NON-NLS-1$
if (buildStr.length()>0) {
int n = Integer.parseInt(buildStr);
num += n;
}
return num;
} catch (NumberFormatException e) {
throw new RuntimeException("Error parsing java version: "+verStr); //$NON-NLS-1$
}
}
}
⏎ org/mozilla/browser/common/Platform.java
Or download all of them as a single archive file:
File name: jbrowser-1.9-fyi.zip File size: 625318 bytes Release date: 2022-11-10 Download
⇐ Download and Install JBrowser Source Package
2017-07-17, ≈34🔥, 1💬
Popular Posts:
JDK 11 jdk.jlink.jmod is the JMOD file for JDK 11 JLink tool, which can be invoked by the "jlink" co...
Java Architecture for XML Binding (JAXB) is a Java API that allows Java developers to map Java class...
Woodstox 6.4.0 Source Code Files are provided at the Woodstox GitHub Website . You can download them...
xml-commons External Source Code Files are provided in the source package file, xml-commons-external...
What Is jtds-1.2.2.jar? jtds-1.2.2.jar is the JAR files of jTDS Java library 1.2.2, which is a JDBC ...