projects
/
meviz.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Moved to Java 8. Code cleanup.
[meviz.git]
/
src
/
main
/
java
/
eu
/
svjatoslav
/
meviz
/
bomremove
/
Main.java
diff --git
a/src/main/java/eu/svjatoslav/meviz/bomremove/Main.java
b/src/main/java/eu/svjatoslav/meviz/bomremove/Main.java
index
d792bb6
..
65c99da
100755
(executable)
--- a/
src/main/java/eu/svjatoslav/meviz/bomremove/Main.java
+++ b/
src/main/java/eu/svjatoslav/meviz/bomremove/Main.java
@@
-20,13
+20,13
@@
import java.util.Arrays;
public class Main implements Module {
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;
- p
ublic
boolean contains(final byte[] header, final byte[] patternToSeek) {
+ p
rivate
boolean contains(final byte[] header, final byte[] patternToSeek) {
for (int i = 0; i < patternToSeek.length; i++)
if (header[i] != patternToSeek[i])
for (int i = 0; i < patternToSeek.length; i++)
if (header[i] != patternToSeek[i])
@@
-35,7
+35,7
@@
public class Main implements Module {
return true;
}
return true;
}
- p
ublic
boolean fileContainsHeader(final File file)
+ p
rivate
boolean fileContainsHeader(final File file)
throws IOException {
final FileInputStream fileInputStream = new FileInputStream(file);
throws IOException {
final FileInputStream fileInputStream = new FileInputStream(file);
@@
-47,7
+47,7
@@
public class Main implements Module {
return contains(currentFileHeader, bomHeader);
}
return contains(currentFileHeader, bomHeader);
}
- p
ublic
boolean fileMatchesInputPattern(final File file) {
+ p
rivate
boolean fileMatchesInputPattern(final File file) {
final String fileName = file.getName().toLowerCase();
for (final String inputPattern : options.inputPatterns)
final String fileName = file.getName().toLowerCase();
for (final String inputPattern : options.inputPatterns)
@@
-67,7
+67,7
@@
public class Main implements Module {
return "stripbom";
}
return "stripbom";
}
- p
ublic
void processDirectory(final File directory) {
+ p
rivate
void processDirectory(final File directory) {
for (final File subFile : directory.listFiles())
if (subFile.isDirectory()) {
for (final File subFile : directory.listFiles())
if (subFile.isDirectory()) {
@@
-85,7
+85,7
@@
public class Main implements Module {
}
}
- p
ublic
void processFile(final File file) throws IOException {
+ p
rivate
void processFile(final File file) throws IOException {
if (file.length() < bomHeader.length)
return;
if (file.length() < bomHeader.length)
return;
@@
-116,7
+116,7
@@
public class Main implements Module {
commandlineHandler.parser.showHelp();
}
commandlineHandler.parser.showHelp();
}
- p
ublic
void stripFileFromHeader(final File file)
+ p
rivate
void stripFileFromHeader(final File file)
throws IOException {
// read entire file
final byte[] fileContents = IOHelper.getFileContents(file);
throws IOException {
// read entire file
final byte[] fileContents = IOHelper.getFileContents(file);