Clean up formatting & Update NIO in some remaining files

This commit is contained in:
Đạt Nhân Trương
2022-08-01 14:25:32 +07:00
parent a44744c05b
commit 4496e0854f
29 changed files with 603 additions and 613 deletions

View File

@@ -301,31 +301,31 @@ public class SkillMakerFetcher {
printWriter.println(sb_reward);
}
private static void writeMakerTableData() {
// This will reference one line at a time
String line = null;
private static void writeMakerTableData() {
// This will reference one line at a time
String line = null;
try(PrintWriter pw = new PrintWriter(Files.newOutputStream(OUTPUT_FILE));
BufferedReader br = Files.newBufferedReader(INPUT_FILE);) {
printWriter = pw;
bufferedReader = br;
try (PrintWriter pw = new PrintWriter(Files.newOutputStream(OUTPUT_FILE));
BufferedReader br = Files.newBufferedReader(INPUT_FILE);) {
printWriter = pw;
bufferedReader = br;
resetMakerDataFields();
resetMakerDataFields();
while ((line = bufferedReader.readLine()) != null) {
translateToken(line);
}
while ((line = bufferedReader.readLine()) != null) {
translateToken(line);
}
WriteMakerTableFile();
WriteMakerTableFile();
} catch (FileNotFoundException ex) {
System.out.println("Unable to open file '" + INPUT_FILE + "'");
} catch (IOException ex) {
System.out.println("Error reading file '" + INPUT_FILE + "'");
} catch (Exception e) {
e.printStackTrace();
}
}
} catch (FileNotFoundException ex) {
System.out.println("Unable to open file '" + INPUT_FILE + "'");
} catch (IOException ex) {
System.out.println("Error reading file '" + INPUT_FILE + "'");
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
DatabaseConnection.initializeConnectionPool(); // Using ItemInformationProvider which loads som unrelated things from the db