+++ /dev/null
-package eu.svjatoslav.meviz.htmlindexer;
-
-import eu.svjatoslav.commons.file.IOHelper;
-
-import java.io.File;
-import java.io.IOException;
-
-class FilesystemIndexRemover {
-
- private final CommandlineHandler commandlineHandler;
-
- public FilesystemIndexRemover(final CommandlineHandler commandlineHandler)
- throws IOException {
- this.commandlineHandler = commandlineHandler;
-
- removeIndex(commandlineHandler.getWorkingDirectory());
- }
-
- private void removeIndex(final File workingDirectory) throws IOException {
-
- // remove thumbnails directory from current directory
- final File thumbnailsDirectory = Utils
- .getThumbnailsDirectory(workingDirectory);
- if (thumbnailsDirectory.exists()) {
- System.out.println("Deleting thumbnails directory: "
- + thumbnailsDirectory);
- IOHelper.deleteRecursively(thumbnailsDirectory);
- }
-
- // recursively remove thumbnail directories from sub directories
- for (final File subFile : workingDirectory.listFiles())
- if (subFile.isDirectory())
- removeIndex(subFile);
-
- for (final Layout layout : Utils.getLayouts()) {
- final File indexFile = Utils.getLayoutIndexFile(layout,
- workingDirectory);
-
- if (indexFile.exists())
- if (Utils.isMevizGeneratedIndexFile(indexFile)) {
- System.out.println("Deleting generated index file: "
- + indexFile);
- indexFile.delete();
- }
- }
-
- }
-
-}