1 package eu.svjatoslav.meviz.htmlindexer;
3 import eu.svjatoslav.commons.file.IOHelper;
6 import java.io.IOException;
8 public class FilesystemIndexRemover {
10 private final CommandlineHandler commandlineHandler;
12 public FilesystemIndexRemover(final CommandlineHandler commandlineHandler)
14 this.commandlineHandler = commandlineHandler;
16 removeIndex(commandlineHandler.getWorkingDirectory());
19 public void removeIndex(final File workingDirectory) throws IOException {
21 // remove thumbnails directory from current directory
22 final File thumbnailsDirectory = Utils
23 .getThumbnailsDirectory(workingDirectory);
24 if (thumbnailsDirectory.exists()) {
25 System.out.println("Deleting thumbnails directory: "
26 + thumbnailsDirectory);
27 IOHelper.deleteRecursively(thumbnailsDirectory);
30 // recursively remove thumbnail directories from sub directories
31 for (final File subFile : workingDirectory.listFiles())
32 if (subFile.isDirectory())
35 for (final Layout layout : Utils.getLayouts()) {
36 final File indexFile = Utils.getLayoutIndexFile(layout,
39 if (indexFile.exists())
40 if (Utils.isMevizGeneratedIndexFile(indexFile)) {
41 System.out.println("Deleting generated index file: "