protected String getApparentVersion ( String jarName , long jarSize ) { // If we found a matching size and it's for our // jar, then return it's description // Lookup in static jarVersions Hashtable String foundSize = ( String ) jarVersions . get ( new Long ( jarSize ) ) ; if ( ( null != foundSize ) && ( foundSize . startsWith ( jarName ) ) ) { return foundSize ; } else { if ( "xerces.jar" . equalsIgnoreCase ( jarName ) || "xercesImpl.jar" . equalsIgnoreCase ( jarName ) ) // || "xalan.jar".equalsIgnoreCase(jarName)) { // For xalan.jar and xerces.jar/xercesImpl.jar, which we ship together: // The jar is not from a shipped copy of xalan-j, so // it's up to the user to ensure that it's compatible return jarName + " " + WARNING + CLASS_PRESENT ; } else { // Otherwise, it's just a jar we don't have the version info calculated for return jarName + " " + CLASS_PRESENT ; } } }
Cheap - o method to determine the product version of a . jar .