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:
JavaMail Source Code Files are provided in the source package file, httpcomponents-client-5. 2-src.zi...
Rhino JavaScript Java Library is an open-source implementation of JavaScript written entirely in Jav...
Snappy-Java is a Java port of the "snappy", a fast C++ compresser/decompresser developed by Google. ...
A stream buffer is a stream-based representation of an XML infoset in Java. Stream buffers are desig...
JDK 11 java.compiler.jmod is the JMOD file for JDK 11 Compiler module. JDK 11 Compiler module compil...