use of de.schlichtherle.truezip.file.TFileReader in project alfresco-repository by Alfresco.
the class InstalledFiles method load.
/**
* Loads the exisiting information about the installed files from the WAR
*/
public void load() {
TFile file = new TFile(getFileLocation());
if (file.exists() == true) {
try {
BufferedReader reader = new BufferedReader(new TFileReader(file));
try {
String line = reader.readLine();
while (line != null) {
String[] modification = line.split("\\" + DELIMITER);
String mod = modification[0];
String location = modification[1];
if (mod.equals(MOD_ADD_FILE) == true) {
this.adds.add(location);
} else if (mod.equals(MOD_MK_DIR) == true) {
this.mkdirs.add(location);
} else if (mod.equals(MOD_UPDATE_FILE) == true) {
this.updates.put(location, modification[2]);
}
line = reader.readLine();
}
} finally {
reader.close();
}
} catch (FileNotFoundException exception) {
throw new ModuleManagementToolException("The module file install file '" + getFileLocation() + "' does not exist", exception);
} catch (IOException exception) {
throw new ModuleManagementToolException("Error whilst reading file '" + getFileLocation(), exception);
}
} else {
throw new ModuleManagementToolException("Invalid module. The installation file does not exist for module: " + moduleId);
}
}
Aggregations