Skip to content

Commit

Permalink
make default action to append to folder, clearer wording
Browse files Browse the repository at this point in the history
  • Loading branch information
dominic-03 committed Apr 4, 2024
1 parent 04dbe45 commit 0c50a8c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/main/java/org/redalert/pits/LogDownload.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ public class LogDownload extends Thread {
private final String ip;
private final String path;
private final boolean delete;
private final boolean append;
private final boolean overwrite;

@Override
public void run() {
PITSUtility.displayStatus(download(ip, path, delete, append));
PITSUtility.displayStatus(download(ip, path, delete, overwrite));
}
public LogDownload(String ip, String path, boolean delete, boolean append) {
public LogDownload(String ip, String path, boolean delete, boolean overwrite) {
this.ip = ip;
this.path = path;
this.delete = delete;
this.append = append;
this.overwrite = overwrite;
}

public int download(String ip, String path, boolean delete, boolean append) {
public int download(String ip, String path, boolean delete, boolean overwrite) {
FTPClient ftp = new FTPClient();
System.out.println("Connecting to robot");
try {
Expand Down Expand Up @@ -55,8 +55,8 @@ public int download(String ip, String path, boolean delete, boolean append) {
System.out.println("Security exception when creating log folder");
}
} else {
if (!append) {
int reply = JOptionPane.showConfirmDialog(null, "Log folder already exists. Overwrite it?", "Overwrite folder", JOptionPane.YES_NO_OPTION);
if (overwrite) {
int reply = JOptionPane.showConfirmDialog(null, "Delete existing log folder and create a new one?", "Overwrite folder", JOptionPane.YES_NO_OPTION);
if (reply == JOptionPane.YES_OPTION) {
try {
FileUtils.deleteDirectory(new File("./logs"));
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/redalert/pits/PITSUtility.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public PITSUtility() {
add(deleteToggle);

// Append to folder checkbox
appendToggle = new Checkbox("Append to existing folder");
appendToggle = new Checkbox("Clear current folder");
add(appendToggle);

// Status
Expand Down

0 comments on commit 0c50a8c

Please sign in to comment.