public class FilesystemIndexer extends AbstractIndexer {
- public static final Logger logger = Logger
+ private static final Logger logger = Logger
.getLogger(FilesystemIndexer.class);
- private final HashSet<String> validMetadataFiles = new HashSet<String>();
+ private final HashSet<String> validMetadataFiles = new HashSet<>();
private final File directoryToIndex;
private final List<String> pathElements;
}
- public boolean canWriteIndexFile(final File indexFile)
+ private boolean canWriteIndexFile(final File indexFile)
throws IOException {
return !indexFile.exists() || Utils.isMevizGeneratedIndexFile(indexFile);
}
- public void generateHtmlFromMetadata(final HashSet<Layout> layouts) {
+ private void generateHtmlFromMetadata(final HashSet<Layout> layouts) {
// Generate HTML from metadata
for (final Layout layout : layouts)
try {
}
}
- public List<String> getChildPath(final File file) {
+ private List<String> getChildPath(final File file) {
- final List<String> result = new ArrayList<String>();
+ final List<String> result = new ArrayList<>();
result.addAll(pathElements);
result.add(file.getName());
+ Utils.urlEncode(thumbnailFileName);
}
- public void initializeLayouts() {
+ private void initializeLayouts() {
layouts = Utils.getLayouts();
"", "."));
}
- public void initializeThumbnailsDirectory() {
+ private void initializeThumbnailsDirectory() {
final File thumbnailsDirectory = Utils
.getThumbnailsDirectory(directoryToIndex);
thumbnailsDirectory.mkdirs();
}
- public void loadOrCreateMetadata() {
+ private void loadOrCreateMetadata() {
metadataFile = new File(
Utils.getThumbnailsDirectoryPath(directoryToIndex)
}
- public void updateMetadata() throws Exception {
+ private void updateMetadata() throws Exception {
for (final File file : directoryToIndex.listFiles())
if (shallFileBeIndexed(file)) {