com.optrak.tools.repository.client
Class AnalyseJar

java.lang.Object
  extended by com.optrak.tools.repository.client.AnalyseJar

public class AnalyseJar
extends java.lang.Object

Determine name, version, signed state. Attempt to determine the version of 3rd party jar files.


Constructor Summary
AnalyseJar()
           
 
Method Summary
 void analyse(java.io.File jar)
          Analyse jar file.
 java.lang.String getBaseName()
          File name without any encoded version.
 java.lang.String getVersion()
          version of the jar file.
 java.lang.String getVersionExtra()
           
 boolean isSigned()
          is the jar file signed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnalyseJar

public AnalyseJar()
Method Detail

isSigned

public boolean isSigned()
is the jar file signed.

Returns:
true if it was signed.

getVersion

public java.lang.String getVersion()
version of the jar file. The analysis first looks for an implementation version in the jar file. If not found it also examines the name of the file to see if it appears to have a version encoded in it. If the resulting version contains spaces, then this property will contain the first component with the rest going in versionExtra.

Returns:
version of the jar file if any otherwise null

getVersionExtra

public java.lang.String getVersionExtra()

getBaseName

public java.lang.String getBaseName()
File name without any encoded version.

Returns:
baseName of the jar file. This is the name after removing any encoded version

analyse

public void analyse(java.io.File jar)
             throws java.io.IOException
Analyse jar file. If successful the properties on this object are set to reflect the results.

Parameters:
jar - file to examine
Throws:
java.io.IOException