return new ArrayList<FSDesignResourceState>();
}
private List<FSDesignResourceState> createStates(FileObject base, FileObject file) throws NoSuchAlgorithmException, IOException {
List<FSDesignResourceState> states = new ArrayList<FSDesignResourceState>();
FSDesignResourceState state = new FSDesignResourceState();
String path = computeRelativePath(base, file);
state.setPath(path);
states.add(state);
if (file.getType() == FileType.FOLDER) {
state.setType(FSDesignResourceState.TYPE_FOLDER);
long lastModified = 0;
for (FileObject child : file.getChildren()) {
List<FSDesignResourceState> childStates = createStates(base, child);
for (FSDesignResourceState childState : childStates) {
states.add(childState);
lastModified = Math.max(lastModified, childState.getLastmodified());
}
}
state.setLastmodified(lastModified);
} else {
state.setType(FSDesignResourceState.TYPE_FILE);
state.setLastmodified(file.getContent().getLastModifiedTime());
state.setMd5sum(WGUtils.createMD5HEX(file.getContent().getInputStream()));
}
return states;
}