only:prependIfNotAbsolute
This commit is contained in:
parent
453cecd81b
commit
bb9a9da1f5
|
@ -33,7 +33,7 @@ public class IoUtil2 {
|
|||
}
|
||||
|
||||
private static long getCrc32(String fileName) throws IOException {
|
||||
File file = new File(RootHolder.ROOT + fileName);
|
||||
File file = new File(prependIfNotAbsolute(RootHolder.ROOT, fileName));
|
||||
byte[] fileContent = Files.readAllBytes(file.toPath());
|
||||
for (int i = 0; i < fileContent.length; i++) {
|
||||
byte aByte = fileContent[i];
|
||||
|
@ -45,6 +45,13 @@ public class IoUtil2 {
|
|||
return c.getValue();
|
||||
}
|
||||
|
||||
private static String prependIfNotAbsolute(String prefix, String fileName) {
|
||||
if (new File(fileName).isAbsolute()) {
|
||||
return fileName;
|
||||
} else {
|
||||
return prefix + fileName;
|
||||
}
|
||||
}
|
||||
|
||||
static long getCrc32(List<String> inputFileNames) throws IOException {
|
||||
// get CRC32 of given input files
|
||||
|
|
Loading…
Reference in New Issue