Replaces with more efficient way of file retrieval.

This commit is contained in:
JSQui
2022-10-06 14:45:34 -07:00
parent be812630ea
commit 7d62ce06df
2 changed files with 12 additions and 20 deletions

View File

@ -1414,16 +1414,7 @@ public class delegationServices {
try
{
File homedir = new File(System.getProperty("user.home"));
String fileName = homedir + "/ocs/policy/launcher/legal/eula.txt";
Path path = Paths.get(fileName);
byte[] bytes = Files.readAllBytes(path);
List<String> allLines = Files.readAllLines(path, StandardCharsets.UTF_8);
String formattedString = allLines.toString()
.replace("[", "") //remove the right bracket
.replace("]", "") //remove the left bracket
.replace(",", "")
.trim(); //remove trailing spaces from partially initialized arrays
policyDocument = formattedString;
policyDocument = Files.readString(Path.of(homedir + "/ocs/policy/launcher/legal/eula.txt"));
}
catch (Exception EXR)
{
@ -1454,16 +1445,7 @@ public class delegationServices {
try
{
File homedir = new File(System.getProperty("user.home"));
String fileName = homedir + "/ocs/policy/launcher/legal/accountagreement.txt";
Path path = Paths.get(fileName);
byte[] bytes = Files.readAllBytes(path);
List<String> allLines = Files.readAllLines(path, StandardCharsets.UTF_8);
String formattedString = allLines.toString()
.replace("[", "") //remove the right bracket
.replace("]", "") //remove the left bracket
.replace(",", "")
.trim(); //remove trailing spaces from partially initialized arrays
policyDocument = formattedString;
policyDocument = Files.readString(Path.of(homedir + "/ocs/policy/launcher/legal/eula.txt"));
}
catch (Exception EXR)
{