use of jp.ossc.nimbus.lang.ServiceException in project nimbus by nimbus-org.
the class CashedClassLoader method setupJarPropList.
/**
* Jarファイルからクラス名の抽出を行う.
* @param item
*/
protected void setupJarPropList(URL item) {
String dirPath = StringOperator.replaceString(item.getFile(), C_BK_SRASH, C_SRASH);
JarFile jar;
try {
jar = new JarFile(dirPath);
} catch (IOException e) {
// $NON-NLS-1$//$NON-NLS-2$
throw new ServiceException("CASHCLASSLODER001", "IOException filename = " + dirPath, e);
}
for (Enumeration enumeration = jar.entries(); enumeration.hasMoreElements(); ) {
ZipEntry entry = (ZipEntry) enumeration.nextElement();
String name = entry.getName();
if (name.endsWith(C_CLASS_EXT)) {
name = StringOperator.replaceString(name, C_SRASH, C_DOT);
// name = name.substring(1,name.length()-C_CLASS_EXT.length()) ;
// 2003.11.13 Hirokado 1→0変更
name = name.substring(0, name.length() - C_CLASS_EXT.length());
Class cls = null;
try {
cls = this.loadClass(name);
} catch (ClassNotFoundException e) {
// $NON-NLS-1$//$NON-NLS-2$
throw new ServiceException("CASHCLASSLODER002", "ClassNotFoundException clsename = " + name, e);
}
mClassHash.put(name, cls);
}
}
}
Aggregations