private ConfigurationInfo loadConfigurationInfo(Artifact configId) throws NoSuchConfigException, IOException {
File location = repository.getLocation(configId);
if (!location.exists() && !location.canRead()) {
throw new NoSuchConfigException(configId);
}
File inPlaceLocation = inPlaceConfUtil.readInPlaceLocation(location);
ConfigurationInfo configurationInfo;
if (location.isDirectory()) {
File infoFile = new File(location, "META-INF");
infoFile = new File(infoFile, "config.info");
if (!infoFile.exists() || !infoFile.canRead()) {
throw new NoSuchConfigException(configId);
}
InputStream in = new FileInputStream(infoFile);
try {
configurationInfo = ConfigurationUtil.readConfigurationInfo(in, getAbstractName(), inPlaceLocation);
} finally {
IOUtils.close(in);
}
} else {
JarFile jarFile = new JarFile(location);
InputStream in = null;
try {
ZipEntry entry = jarFile.getEntry("META-INF/config.info");
if (entry == null) {
throw new NoSuchConfigException(configId);
}
in = jarFile.getInputStream(entry);
configurationInfo = ConfigurationUtil.readConfigurationInfo(in, getAbstractName(), inPlaceLocation);
} finally {
IOUtils.close(in);