if (transletTimestamp < xslTimestamp)
return null;
}
// Create a ZipFile object for the jar file
ZipFile jarFile = null;
try {
jarFile = new ZipFile(file);
}
catch (IOException e) {
return null;
}
String transletPath = fullClassName.replace('.', '/');
String transletAuxPrefix = transletPath + "$";
String transletFullName = transletPath + ".class";
Vector bytecodes = new Vector();
// Iterate through all entries in the jar file to find the
// translet and auxiliary classes.
Enumeration entries = jarFile.entries();
while (entries.hasMoreElements())
{
ZipEntry entry = (ZipEntry)entries.nextElement();
String entryName = entry.getName();
if (entry.getSize() > 0 &&
(entryName.equals(transletFullName) ||
(entryName.endsWith(".class") &&
entryName.startsWith(transletAuxPrefix))))
{
try {
InputStream input = jarFile.getInputStream(entry);
int size = (int)entry.getSize();
byte[] bytes = new byte[size];
readFromInputStream(bytes, input, size);
input.close();
bytecodes.addElement(bytes);