try {
ZipFile plugInZip = new ZipFile(plugin) ;
/* Retrieve plug-in information object */
ZipEntry infoFileEntry = plugInZip.getEntry(PLUGIN_INFO_FILE_NAME) ;
if (infoFileEntry == null) {
throw new InvalidPlugInException(plugin.getName()) ;
}// if
PlugInInfo info = (PlugInInfo) IOObject.readObjectFromFile(
new BufferedInputStream(
plugInZip.getInputStream(infoFileEntry))) ;
// Close the zip file in order to copy it
plugInZip.close() ;
/* Determine the nature of the plug-in before adding it */
if (info.isAnalyzer()) {
addJar(plugin, info, this.analyzerFolder) ;
addConfiguration(info, this.analyzerConfigFile) ;
this.am.addAnalyzerInfo(info) ;
} else {
addJar(plugin, info, this.generatorFolder) ;
addConfiguration(info, this.generatorConfigFile) ;
}// if
copyImages(info) ;
return info ;
} catch (ZipException e) {
throw new InvalidPlugInException(plugin.getName()) ;
} catch (IOException e) {
throw new FileReadingException(plugin) ;
}// try
}// addPlugIn(File, String, String, String)