Updated copyright message.
[meviz.git] / src / main / java / eu / svjatoslav / meviz / bomremove / Main.java
index d792bb6..24d7cdd 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * Meviz - Various tools collection to work with multimedia.
- * Copyright (C) 2012, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Copyright (C) 2012 -- 2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 2 of the GNU General Public License
@@ -20,13 +20,13 @@ import java.util.Arrays;
 
 public class Main implements Module {
 
-    byte[] bomHeader = new byte[]{(byte) 0xef, (byte) 0xbb, (byte) 0xbf};
+    private final byte[] bomHeader = new byte[]{(byte) 0xef, (byte) 0xbb, (byte) 0xbf};
 
-    CommandlineHandler commandlineHandler = new CommandlineHandler();
+    private final CommandlineHandler commandlineHandler = new CommandlineHandler();
 
-    BomStrippingOptions options;
+    private BomStrippingOptions options;
 
-    public boolean contains(final byte[] header, final byte[] patternToSeek) {
+    private boolean contains(final byte[] header, final byte[] patternToSeek) {
 
         for (int i = 0; i < patternToSeek.length; i++)
             if (header[i] != patternToSeek[i])
@@ -35,7 +35,7 @@ public class Main implements Module {
         return true;
     }
 
-    public boolean fileContainsHeader(final File file)
+    private boolean fileContainsHeader(final File file)
             throws IOException {
 
         final FileInputStream fileInputStream = new FileInputStream(file);
@@ -47,7 +47,7 @@ public class Main implements Module {
         return contains(currentFileHeader, bomHeader);
     }
 
-    public boolean fileMatchesInputPattern(final File file) {
+    private boolean fileMatchesInputPattern(final File file) {
         final String fileName = file.getName().toLowerCase();
 
         for (final String inputPattern : options.inputPatterns)
@@ -67,7 +67,7 @@ public class Main implements Module {
         return "stripbom";
     }
 
-    public void processDirectory(final File directory) {
+    private void processDirectory(final File directory) {
 
         for (final File subFile : directory.listFiles())
             if (subFile.isDirectory()) {
@@ -85,7 +85,7 @@ public class Main implements Module {
 
     }
 
-    public void processFile(final File file) throws IOException {
+    private void processFile(final File file) throws IOException {
 
         if (file.length() < bomHeader.length)
             return;
@@ -116,7 +116,7 @@ public class Main implements Module {
         commandlineHandler.parser.showHelp();
     }
 
-    public void stripFileFromHeader(final File file)
+    private void stripFileFromHeader(final File file)
             throws IOException {
         // read entire file
         final byte[] fileContents = IOHelper.getFileContents(file);