continue;
}
if (jarEntryContents.containsKey( jarEntry.getName() )) {
if (!collisionAllowed)
throw new JclException( "Class/Resource " + jarEntry.getName() + " already loaded" );
else {
if (logger.isLoggable( Level.FINEST ))
logger.finest( "Class/Resource " + jarEntry.getName()
+ " already loaded; ignoring entry..." );
continue;
}
}
if (logger.isLoggable( Level.FINEST ))
logger.finest( "Entry Name: " + jarEntry.getName() + ", " + "Entry Size: " + jarEntry.getSize() );
byte[] b = new byte[2048];
ByteArrayOutputStream out = new ByteArrayOutputStream();
int len = 0;
while (( len = jis.read( b ) ) > 0) {
out.write( b, 0, len );
}
// add to internal resource HashMap
jarEntryContents.put( jarEntry.getName(), out.toByteArray() );
if (logger.isLoggable( Level.FINEST ))
logger.finest( jarEntry.getName() + ": size=" + out.size() + " ,csize="
+ jarEntry.getCompressedSize() );
out.close();
}
} catch (IOException e) {
throw new JclException( e );
} catch (NullPointerException e) {
if (logger.isLoggable( Level.FINEST ))
logger.finest( "Done loading." );
} finally {
if (jis != null)
try {
jis.close();
} catch (IOException e) {
throw new JclException( e );
}
if (bis != null)
try {
bis.close();
} catch (IOException e) {
throw new JclException( e );
}
}
}