From 35252da406b80b367bf8ff130991165c7e865687 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Sat, 19 Jan 2019 14:56:26 +0200 Subject: [PATCH] Code refactoring --- install | 2 +- pom.xml | 14 -------------- .../meviz/htmlindexer/CommandlineHandler.java | 2 +- .../java/eu/svjatoslav/meviz/htmlindexer/Main.java | 2 ++ .../eu/svjatoslav/meviz/htmlindexer/Utils.java | 1 + .../htmlindexer/{ => indexer}/AbstractIndexer.java | 4 +++- .../{ => indexer}/FilesystemIndexRemover.java | 7 +++++-- .../{ => indexer}/FilesystemIndexer.java | 4 +++- .../htmlindexer/{ => indexer}/WebIndexer.java | 6 +++++- .../meviz/htmlindexer/{ => layouts}/Layout.java | 4 +++- .../meviz/htmlindexer/layouts/MixedLayout.java | 3 +-- .../htmlindexer/metadata/DirectoryMetadata.java | 4 ++-- 12 files changed, 27 insertions(+), 26 deletions(-) rename src/main/java/eu/svjatoslav/meviz/htmlindexer/{ => indexer}/AbstractIndexer.java (93%) rename src/main/java/eu/svjatoslav/meviz/htmlindexer/{ => indexer}/FilesystemIndexRemover.java (86%) rename src/main/java/eu/svjatoslav/meviz/htmlindexer/{ => indexer}/FilesystemIndexer.java (97%) rename src/main/java/eu/svjatoslav/meviz/htmlindexer/{ => indexer}/WebIndexer.java (94%) rename src/main/java/eu/svjatoslav/meviz/htmlindexer/{ => layouts}/Layout.java (92%) diff --git a/install b/install index 933f49d..6dc8f7f 100755 --- a/install +++ b/install @@ -1,6 +1,6 @@ #!/bin/bash -sudo apt-get install maven lame vorbis-tools imagemagick ffmpeg2theora libav-tools --yes +sudo apt-get install maven lame vorbis-tools imagemagick ffmpeg2theora --yes mvn clean mvn package diff --git a/pom.xml b/pom.xml index 02b8fda..9ad5714 100644 --- a/pom.xml +++ b/pom.xml @@ -93,20 +93,6 @@ - - org.apache.maven.plugins - maven-javadoc-plugin - 2.9 - - - attach-javadocs - - jar - - - - - org.apache.maven.plugins maven-release-plugin diff --git a/src/main/java/eu/svjatoslav/meviz/htmlindexer/CommandlineHandler.java b/src/main/java/eu/svjatoslav/meviz/htmlindexer/CommandlineHandler.java index 1b945c1..93a9d7b 100755 --- a/src/main/java/eu/svjatoslav/meviz/htmlindexer/CommandlineHandler.java +++ b/src/main/java/eu/svjatoslav/meviz/htmlindexer/CommandlineHandler.java @@ -17,7 +17,7 @@ import eu.svjatoslav.meviz.encoder.EncodingOptions; import java.io.File; -class CommandlineHandler { +public class CommandlineHandler { final Parser parser = new Parser(); final NullParameter removeIndex = parser.add( diff --git a/src/main/java/eu/svjatoslav/meviz/htmlindexer/Main.java b/src/main/java/eu/svjatoslav/meviz/htmlindexer/Main.java index 6c26761..e3e1c7f 100644 --- a/src/main/java/eu/svjatoslav/meviz/htmlindexer/Main.java +++ b/src/main/java/eu/svjatoslav/meviz/htmlindexer/Main.java @@ -1,6 +1,8 @@ package eu.svjatoslav.meviz.htmlindexer; import eu.svjatoslav.meviz.Module; +import eu.svjatoslav.meviz.htmlindexer.indexer.FilesystemIndexRemover; +import eu.svjatoslav.meviz.htmlindexer.indexer.FilesystemIndexer; import java.util.ArrayList; diff --git a/src/main/java/eu/svjatoslav/meviz/htmlindexer/Utils.java b/src/main/java/eu/svjatoslav/meviz/htmlindexer/Utils.java index 82c4b58..01f2d37 100755 --- a/src/main/java/eu/svjatoslav/meviz/htmlindexer/Utils.java +++ b/src/main/java/eu/svjatoslav/meviz/htmlindexer/Utils.java @@ -9,6 +9,7 @@ package eu.svjatoslav.meviz.htmlindexer; +import eu.svjatoslav.meviz.htmlindexer.layouts.Layout; import eu.svjatoslav.meviz.htmlindexer.layouts.MixedLayout; import java.awt.image.BufferedImage; diff --git a/src/main/java/eu/svjatoslav/meviz/htmlindexer/AbstractIndexer.java b/src/main/java/eu/svjatoslav/meviz/htmlindexer/indexer/AbstractIndexer.java similarity index 93% rename from src/main/java/eu/svjatoslav/meviz/htmlindexer/AbstractIndexer.java rename to src/main/java/eu/svjatoslav/meviz/htmlindexer/indexer/AbstractIndexer.java index 22ec825..0329989 100644 --- a/src/main/java/eu/svjatoslav/meviz/htmlindexer/AbstractIndexer.java +++ b/src/main/java/eu/svjatoslav/meviz/htmlindexer/indexer/AbstractIndexer.java @@ -1,5 +1,7 @@ -package eu.svjatoslav.meviz.htmlindexer; +package eu.svjatoslav.meviz.htmlindexer.indexer; +import eu.svjatoslav.meviz.htmlindexer.IndexingContext; +import eu.svjatoslav.meviz.htmlindexer.layouts.Layout; import eu.svjatoslav.meviz.htmlindexer.metadata.Dimension; import eu.svjatoslav.meviz.htmlindexer.metadata.DirectoryMetadata; import eu.svjatoslav.meviz.htmlindexer.metadata.fileTypes.*; diff --git a/src/main/java/eu/svjatoslav/meviz/htmlindexer/FilesystemIndexRemover.java b/src/main/java/eu/svjatoslav/meviz/htmlindexer/indexer/FilesystemIndexRemover.java similarity index 86% rename from src/main/java/eu/svjatoslav/meviz/htmlindexer/FilesystemIndexRemover.java rename to src/main/java/eu/svjatoslav/meviz/htmlindexer/indexer/FilesystemIndexRemover.java index 30f1099..9023697 100644 --- a/src/main/java/eu/svjatoslav/meviz/htmlindexer/FilesystemIndexRemover.java +++ b/src/main/java/eu/svjatoslav/meviz/htmlindexer/indexer/FilesystemIndexRemover.java @@ -1,11 +1,14 @@ -package eu.svjatoslav.meviz.htmlindexer; +package eu.svjatoslav.meviz.htmlindexer.indexer; import eu.svjatoslav.commons.file.IOHelper; +import eu.svjatoslav.meviz.htmlindexer.CommandlineHandler; +import eu.svjatoslav.meviz.htmlindexer.layouts.Layout; +import eu.svjatoslav.meviz.htmlindexer.Utils; import java.io.File; import java.io.IOException; -class FilesystemIndexRemover { +public class FilesystemIndexRemover { private final CommandlineHandler commandlineHandler; diff --git a/src/main/java/eu/svjatoslav/meviz/htmlindexer/FilesystemIndexer.java b/src/main/java/eu/svjatoslav/meviz/htmlindexer/indexer/FilesystemIndexer.java similarity index 97% rename from src/main/java/eu/svjatoslav/meviz/htmlindexer/FilesystemIndexer.java rename to src/main/java/eu/svjatoslav/meviz/htmlindexer/indexer/FilesystemIndexer.java index f001d6a..6add6be 100755 --- a/src/main/java/eu/svjatoslav/meviz/htmlindexer/FilesystemIndexer.java +++ b/src/main/java/eu/svjatoslav/meviz/htmlindexer/indexer/FilesystemIndexer.java @@ -7,9 +7,11 @@ * or later as published by the Free Software Foundation. */ -package eu.svjatoslav.meviz.htmlindexer; +package eu.svjatoslav.meviz.htmlindexer.indexer; import eu.svjatoslav.commons.file.IOHelper; +import eu.svjatoslav.meviz.htmlindexer.*; +import eu.svjatoslav.meviz.htmlindexer.layouts.Layout; import eu.svjatoslav.meviz.htmlindexer.metadata.Dimension; import eu.svjatoslav.meviz.htmlindexer.metadata.DirectoryMetadata; import eu.svjatoslav.meviz.htmlindexer.metadata.MetadadaHelper; diff --git a/src/main/java/eu/svjatoslav/meviz/htmlindexer/WebIndexer.java b/src/main/java/eu/svjatoslav/meviz/htmlindexer/indexer/WebIndexer.java similarity index 94% rename from src/main/java/eu/svjatoslav/meviz/htmlindexer/WebIndexer.java rename to src/main/java/eu/svjatoslav/meviz/htmlindexer/indexer/WebIndexer.java index d2aabcd..966d10f 100644 --- a/src/main/java/eu/svjatoslav/meviz/htmlindexer/WebIndexer.java +++ b/src/main/java/eu/svjatoslav/meviz/htmlindexer/indexer/WebIndexer.java @@ -1,5 +1,9 @@ -package eu.svjatoslav.meviz.htmlindexer; +package eu.svjatoslav.meviz.htmlindexer.indexer; +import eu.svjatoslav.meviz.htmlindexer.Constants; +import eu.svjatoslav.meviz.htmlindexer.IndexingContext; +import eu.svjatoslav.meviz.htmlindexer.layouts.Layout; +import eu.svjatoslav.meviz.htmlindexer.Utils; import eu.svjatoslav.meviz.htmlindexer.layouts.MixedLayout; import eu.svjatoslav.meviz.htmlindexer.metadata.Dimension; import eu.svjatoslav.meviz.htmlindexer.metadata.DirectoryMetadata; diff --git a/src/main/java/eu/svjatoslav/meviz/htmlindexer/Layout.java b/src/main/java/eu/svjatoslav/meviz/htmlindexer/layouts/Layout.java similarity index 92% rename from src/main/java/eu/svjatoslav/meviz/htmlindexer/Layout.java rename to src/main/java/eu/svjatoslav/meviz/htmlindexer/layouts/Layout.java index 5083b39..ef250e5 100755 --- a/src/main/java/eu/svjatoslav/meviz/htmlindexer/Layout.java +++ b/src/main/java/eu/svjatoslav/meviz/htmlindexer/layouts/Layout.java @@ -7,8 +7,10 @@ * or later as published by the Free Software Foundation. */ -package eu.svjatoslav.meviz.htmlindexer; +package eu.svjatoslav.meviz.htmlindexer.layouts; +import eu.svjatoslav.meviz.htmlindexer.IndexingContext; +import eu.svjatoslav.meviz.htmlindexer.indexer.AbstractIndexer; import eu.svjatoslav.meviz.htmlindexer.metadata.DirectoryMetadata; import eu.svjatoslav.meviz.htmlindexer.metadata.fileTypes.AbstractFile; import eu.svjatoslav.meviz.htmlindexer.metadata.fileTypes.Picture; diff --git a/src/main/java/eu/svjatoslav/meviz/htmlindexer/layouts/MixedLayout.java b/src/main/java/eu/svjatoslav/meviz/htmlindexer/layouts/MixedLayout.java index 13aaff3..49ffa7e 100755 --- a/src/main/java/eu/svjatoslav/meviz/htmlindexer/layouts/MixedLayout.java +++ b/src/main/java/eu/svjatoslav/meviz/htmlindexer/layouts/MixedLayout.java @@ -10,10 +10,9 @@ package eu.svjatoslav.meviz.htmlindexer.layouts; import eu.svjatoslav.commons.file.FilePathParser; -import eu.svjatoslav.meviz.htmlindexer.AbstractIndexer; +import eu.svjatoslav.meviz.htmlindexer.indexer.AbstractIndexer; import eu.svjatoslav.meviz.htmlindexer.Constants; import eu.svjatoslav.meviz.htmlindexer.IndexingContext; -import eu.svjatoslav.meviz.htmlindexer.Layout; import eu.svjatoslav.meviz.htmlindexer.metadata.Dimension; import eu.svjatoslav.meviz.htmlindexer.metadata.DirectoryMetadata; import eu.svjatoslav.meviz.htmlindexer.metadata.fileTypes.AbstractFile; diff --git a/src/main/java/eu/svjatoslav/meviz/htmlindexer/metadata/DirectoryMetadata.java b/src/main/java/eu/svjatoslav/meviz/htmlindexer/metadata/DirectoryMetadata.java index ec10f90..f165694 100755 --- a/src/main/java/eu/svjatoslav/meviz/htmlindexer/metadata/DirectoryMetadata.java +++ b/src/main/java/eu/svjatoslav/meviz/htmlindexer/metadata/DirectoryMetadata.java @@ -17,8 +17,8 @@ import java.io.File; import java.io.Serializable; import java.util.*; -import static eu.svjatoslav.meviz.htmlindexer.AbstractIndexer.isImage; -import static eu.svjatoslav.meviz.htmlindexer.AbstractIndexer.isVideo; +import static eu.svjatoslav.meviz.htmlindexer.indexer.AbstractIndexer.isImage; +import static eu.svjatoslav.meviz.htmlindexer.indexer.AbstractIndexer.isVideo; /** * Corresponds to single filesystem directory. -- 2.20.1