Fields Summary |
---|
public static final String | SF_WEB_SITE |
public static final String | AELITIS_WEB_SITE |
public static final String | GETAZUREUS_WEB_SITE |
public static final String | AELITIS_TORRENTS |
public static final String | AELITIS_FILES |
public static final String | AZUREUS_WIKI |
public static final String | VERSION_SERVER_V4 |
public static final String | VERSION_SERVER_V6 |
public static final String | DHT_SEED_ADDRESS_V4 |
public static final String | DHT_SEED_ADDRESS_V6 |
public static final String | NAT_TEST_SERVER |
public static final String | NAT_TEST_SERVER_HTTP |
public static final String | SPEED_TEST_SERVER |
public static final String[] | AZUREUS_DOMAINS |
public static final String | DEFAULT_ENCODING |
public static final String | BYTE_ENCODING |
public static Charset | BYTE_CHARSET |
public static Charset | DEFAULT_CHARSET |
public static final String | INFINITY_STRING |
public static final int | INFINITY_AS_INT |
public static final long | INFINITE_AS_LONG |
public static final String | AZUREUS_NAME |
public static final String | AZUREUS_VERSION |
public static final byte[] | VERSION_ID |
public static final String | OSName |
public static final boolean | isOSX |
public static final boolean | isLinux |
public static final boolean | isSolaris |
public static final boolean | isFreeBSD |
public static final boolean | isWindowsXP |
public static final boolean | isWindowsVista |
public static final boolean | isWindows95 |
public static final boolean | isWindows98 |
public static final boolean | isWindowsME |
public static final boolean | isWindows9598ME |
public static final boolean | isWindows |
public static final boolean | isUnix |
public static final String | JAVA_VERSION |
public static final String | FILE_WILDCARD |
Methods Summary |
---|
public static int | compareVersions(java.lang.String version_1, java.lang.String version_2)compare two version strings of form n.n.n.n (e.g. 1.2.3.4)
try{
if ( version_1.startsWith("." )){
version_1 = "0" + version_1;
}
if ( version_2.startsWith("." )){
version_2 = "0" + version_2;
}
version_1 = version_1.replaceAll("[^0-9.]", ".");
version_2 = version_2.replaceAll("[^0-9.]", ".");
StringTokenizer tok1 = new StringTokenizer(version_1,".");
StringTokenizer tok2 = new StringTokenizer(version_2,".");
while( true ){
if ( tok1.hasMoreTokens() && tok2.hasMoreTokens()){
int i1 = Integer.parseInt(tok1.nextToken());
int i2 = Integer.parseInt(tok2.nextToken());
if ( i1 != i2 ){
return( i1 - i2 );
}
}else if ( tok1.hasMoreTokens()){
int i1 = Integer.parseInt(tok1.nextToken());
if ( i1 != 0 ){
return( 1 );
}
}else if ( tok2.hasMoreTokens()){
int i2 = Integer.parseInt(tok2.nextToken());
if ( i2 != 0 ){
return( -1 );
}
}else{
return( 0 );
}
}
}catch( Throwable e ){
Debug.printStackTrace(e);
return( 0 );
}
|
public static java.lang.String | getBaseVersion()Gets the current version, or if a CVS version, the one on which it is based
return( getBaseVersion( AZUREUS_VERSION ));
|
public static java.lang.String | getBaseVersion(java.lang.String version)
int p1 = version.indexOf("_"); // _CVS or _Bnn
if ( p1 == -1 ){
return( version );
}
return( version.substring(0,p1));
|
public static int | getIncrementalBuild()For CVS builds this returns the incremental build number. For people running their own
builds this returns -1
return( getIncrementalBuild( AZUREUS_VERSION ));
|
public static int | getIncrementalBuild(java.lang.String version)
if ( !isCVSVersion(version)){
return( 0 );
}
int p1 = version.indexOf( "_B" );
if ( p1 == -1 ){
return( -1 );
}
try{
return( Integer.parseInt( version.substring(p1+2)));
}catch( Throwable e ){
System.out.println("can't parse version");
return( -1 );
}
|
public static boolean | isCVSVersion()is this a formal build or CVS/incremental
return( isCVSVersion( AZUREUS_VERSION ));
|
public static boolean | isCVSVersion(java.lang.String version)
return( version.indexOf("_") != -1 );
|
public static void | main(java.lang.String[] args)
System.out.println(compareVersions("3.0.0.1", "3.0.0.0"));
System.out.println(compareVersions("3.0.0.0_B1", "3.0.0.0"));
System.out.println(compareVersions("3.0.0.0", "3.0.0.0_B1"));
System.out.println(compareVersions("3.0.0.0_B1", "3.0.0.0_B4"));
System.out.println(compareVersions("3.0.0.0..B1", "3.0.0.0_B4"));
|