use of se.light.assembly64.model.WorkLocation in project assembly64fx by freabemania.
the class LocalDBService method getWorkLocations.
public List<WorkLocation> getWorkLocations(boolean forceUpdate) throws RuntimeException {
if (workLocations != null && !forceUpdate) {
return workLocations;
}
try {
File file = pathService.getWorkLocationsFile();
// bootstrap file
if (!file.exists()) {
storeWorkLocations(new ArrayList<>());
}
CollectionLikeType constructCollectionType = getObjectMapper().getTypeFactory().constructCollectionLikeType(ArrayList.class, WorkLocation.class);
this.workLocations = getObjectMapper().readValue(FileUtils.readFileToString(file), constructCollectionType);
return workLocations;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Aggregations