only:prependIfNotAbsolute
This commit is contained in:
parent
bb9a9da1f5
commit
be8442cef1
|
@ -33,7 +33,7 @@ public class IoUtil2 {
|
|||
}
|
||||
|
||||
private static long getCrc32(String fileName) throws IOException {
|
||||
File file = new File(prependIfNotAbsolute(RootHolder.ROOT, fileName));
|
||||
File file = new File(IoUtil3.prependIfNotAbsolute(RootHolder.ROOT, fileName));
|
||||
byte[] fileContent = Files.readAllBytes(file.toPath());
|
||||
for (int i = 0; i < fileContent.length; i++) {
|
||||
byte aByte = fileContent[i];
|
||||
|
@ -45,14 +45,6 @@ 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
|
||||
long crc32 = 0;
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
package com.rusefi;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class IoUtil3 {
|
||||
public static String prependIfNotAbsolute(String prefix, String fileName) {
|
||||
if (new File(fileName).isAbsolute()) {
|
||||
return fileName;
|
||||
} else {
|
||||
return prefix + fileName;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -61,7 +61,7 @@ public class VariableRegistry {
|
|||
}
|
||||
|
||||
public void readPrependValues(String prependFile, boolean ignoreUnexpectedLined) {
|
||||
File file = new File(RootHolder.ROOT + prependFile);
|
||||
File file = new File(IoUtil3.prependIfNotAbsolute(RootHolder.ROOT, prependFile));
|
||||
try {
|
||||
readPrependValues(new FileReader(file), ignoreUnexpectedLined);
|
||||
} catch (Throwable e) {
|
||||
|
|
Loading…
Reference in New Issue