use of java.nio.file.Files.readString in project hedera-services by hashgraph.
the class ValidationScenarios method appropriateContents.
private static ByteString appropriateContents(long fileNum) {
SysFileSerde<String> serde = SYS_FILE_SERDES.get(fileNum);
String name = serde.preferredFileName();
String loc = "files/" + params.getTargetNetwork() + "-" + name;
try {
var stylized = Files.readString(Paths.get(loc));
return ByteString.copyFrom(serde.toRawFile(stylized));
} catch (IOException e) {
throw new IllegalStateException("Cannot read update file @ '" + loc + "'!", e);
}
}
Aggregations