From b9f98a1eff79b1fcceb1318eb016a8246e6fb0ac Mon Sep 17 00:00:00 2001 From: prithvi Date: Sun, 18 Sep 2022 16:24:22 +0530 Subject: [PATCH 01/14] Added license and README --- LICENSE | 8 ++++++++ README.md | 2 ++ 2 files changed, 10 insertions(+) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1629551 --- /dev/null +++ b/LICENSE @@ -0,0 +1,8 @@ + +Copyright 2022 Prithvi singh + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..f34020c --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +## Download Manager +Readme will be added soon From d4ccbe933bc0381777be669d2d7bbab56ea7f9d1 Mon Sep 17 00:00:00 2001 From: prithvi Date: Sun, 18 Sep 2022 17:14:45 +0530 Subject: [PATCH 02/14] Addded basic design of Download manager --- .../downloadmanager/DownloadManager.java | 4 ++ .../downloadmanager/HelloApplication.java | 6 +- .../downloadmanager/download-manager.fxml | 64 +++++++++++++++++++ 3 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 src/main/java/dev/prithvis/downloadmanager/DownloadManager.java create mode 100644 src/main/resources/dev/prithvis/downloadmanager/download-manager.fxml diff --git a/src/main/java/dev/prithvis/downloadmanager/DownloadManager.java b/src/main/java/dev/prithvis/downloadmanager/DownloadManager.java new file mode 100644 index 0000000..ca36257 --- /dev/null +++ b/src/main/java/dev/prithvis/downloadmanager/DownloadManager.java @@ -0,0 +1,4 @@ +package dev.prithvis.downloadmanager; + +public class DownloadManager { +} diff --git a/src/main/java/dev/prithvis/downloadmanager/HelloApplication.java b/src/main/java/dev/prithvis/downloadmanager/HelloApplication.java index 58183e9..d15643f 100644 --- a/src/main/java/dev/prithvis/downloadmanager/HelloApplication.java +++ b/src/main/java/dev/prithvis/downloadmanager/HelloApplication.java @@ -10,9 +10,9 @@ public class HelloApplication extends Application { @Override public void start(Stage stage) throws IOException { - FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("hello-view.fxml")); - Scene scene = new Scene(fxmlLoader.load(), 320, 240); - stage.setTitle("Hello!"); + FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("download-manager.fxml")); + Scene scene = new Scene(fxmlLoader.load(), 960, 640); + stage.setTitle("Download Manager"); stage.setScene(scene); stage.show(); } diff --git a/src/main/resources/dev/prithvis/downloadmanager/download-manager.fxml b/src/main/resources/dev/prithvis/downloadmanager/download-manager.fxml new file mode 100644 index 0000000..54c9a4d --- /dev/null +++ b/src/main/resources/dev/prithvis/downloadmanager/download-manager.fxml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+
+
+
From 63aa1ae55bd15e73a1109c5cbaf94eab5c079e7e Mon Sep 17 00:00:00 2001 From: prithvi Date: Sun, 18 Sep 2022 18:49:38 +0530 Subject: [PATCH 03/14] Added config class and File Info model --- .../downloadmanager/DownloadManager.java | 12 ++++++++++++ .../downloadmanager/config/AppConfig.java | 5 +++++ .../downloadmanager/models/FileInfo.java | 18 ++++++++++++++++++ .../downloadmanager/download-manager.fxml | 5 ++--- 4 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 src/main/java/dev/prithvis/downloadmanager/config/AppConfig.java create mode 100644 src/main/java/dev/prithvis/downloadmanager/models/FileInfo.java diff --git a/src/main/java/dev/prithvis/downloadmanager/DownloadManager.java b/src/main/java/dev/prithvis/downloadmanager/DownloadManager.java index ca36257..c153099 100644 --- a/src/main/java/dev/prithvis/downloadmanager/DownloadManager.java +++ b/src/main/java/dev/prithvis/downloadmanager/DownloadManager.java @@ -1,4 +1,16 @@ package dev.prithvis.downloadmanager; +import javafx.event.ActionEvent; +import javafx.fxml.FXML; +import javafx.scene.control.TextField; + public class DownloadManager { + @FXML + private TextField urlTextField; + @FXML + void downloadButtonClicked(ActionEvent event) { + String urlTextField=this.urlTextField.getText(); + + } + } diff --git a/src/main/java/dev/prithvis/downloadmanager/config/AppConfig.java b/src/main/java/dev/prithvis/downloadmanager/config/AppConfig.java new file mode 100644 index 0000000..e27fcf5 --- /dev/null +++ b/src/main/java/dev/prithvis/downloadmanager/config/AppConfig.java @@ -0,0 +1,5 @@ +package dev.prithvis.downloadmanager.config; + +public class AppConfig { + private static final String DOWNLOAD_PATH="~/Documents"; +} diff --git a/src/main/java/dev/prithvis/downloadmanager/models/FileInfo.java b/src/main/java/dev/prithvis/downloadmanager/models/FileInfo.java new file mode 100644 index 0000000..d3d608f --- /dev/null +++ b/src/main/java/dev/prithvis/downloadmanager/models/FileInfo.java @@ -0,0 +1,18 @@ +package dev.prithvis.downloadmanager.models; + +import javafx.beans.property.SimpleIntegerProperty; +import javafx.beans.property.SimpleStringProperty; + +public class FileInfo { + private SimpleIntegerProperty index; + private SimpleStringProperty name; + private SimpleStringProperty url; + private SimpleStringProperty status; + + public FileInfo(int index,String name,String url,String status){ + this.index.set(index); + this.name.set(name); + this.url.set(url); + this.status.set(status); + } +} diff --git a/src/main/resources/dev/prithvis/downloadmanager/download-manager.fxml b/src/main/resources/dev/prithvis/downloadmanager/download-manager.fxml index 54c9a4d..08542be 100644 --- a/src/main/resources/dev/prithvis/downloadmanager/download-manager.fxml +++ b/src/main/resources/dev/prithvis/downloadmanager/download-manager.fxml @@ -11,7 +11,6 @@ - @@ -26,7 +25,7 @@ - + @@ -34,7 +33,7 @@ -
- + - + - + + From ed98dff86b54cad52d10744065b1b2ff882d768c Mon Sep 17 00:00:00 2001 From: prithvi Date: Sun, 2 Oct 2022 10:32:24 +0530 Subject: [PATCH 08/14] Added loggers and refactored code --- .../config/DownloadThread.java | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/main/java/dev/prithvis/downloadmanager/config/DownloadThread.java diff --git a/src/main/java/dev/prithvis/downloadmanager/config/DownloadThread.java b/src/main/java/dev/prithvis/downloadmanager/config/DownloadThread.java new file mode 100644 index 0000000..7ead7a5 --- /dev/null +++ b/src/main/java/dev/prithvis/downloadmanager/config/DownloadThread.java @@ -0,0 +1,44 @@ +package dev.prithvis.downloadmanager.config; + +import dev.prithvis.downloadmanager.DownloadManager; +import dev.prithvis.downloadmanager.models.FileInfo; + +import java.io.IOException; +import java.net.URL; +import java.nio.file.FileAlreadyExistsException; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class DownloadThread extends Thread{ + public FileInfo file; + public DownloadManager downloadManager; + public static System.Logger LOGGER; + public DownloadThread(FileInfo file,DownloadManager downloadManager){ + this.downloadManager=downloadManager; + this.file=file; + } + @Override + public void run(){ + this.file.setStatus("DOWNLOADING"); + this.downloadManager.updateUI(file); + try { + Files.copy((new URL(this.file.getUrl()).openStream()), Paths.get(this.file.getLocation())); + this.file.setStatus("DOWNLOADED"); + LOGGER.log(System.Logger.Level.INFO,String.format("%s downloaded at %s"+System.lineSeparator(), + file.getName(),file.getLocation())); + }catch (FileAlreadyExistsException fileAlreadyExistsException){ + this.file.setStatus("SKIPPED"); + LOGGER.log(System.Logger.Level.WARNING,String.format("%s already exists at %s.Skipping download"+System.lineSeparator() + ,file.getName(),file.getLocation())); + } + catch (IOException e) { + this.file.setStatus("FAILED"); + LOGGER.log(System.Logger.Level.ERROR,String.format("Download of %s failed because of %s"+System.lineSeparator(), + file.getName(),e.getMessage())); + throw new RuntimeException(e); + } + this.downloadManager.updateUI(file); + LOGGER.log(System.Logger.Level.INFO,String.format("Download of %s completed"+System.lineSeparator(), + file.getName())); + } +} From c155adf109f41971993350b94e7f3c533c59831b Mon Sep 17 00:00:00 2001 From: prithvi Date: Sun, 2 Oct 2022 12:13:55 +0530 Subject: [PATCH 09/14] Fixed access modifier for configurations --- .../java/dev/prithvis/downloadmanager/config/AppConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/dev/prithvis/downloadmanager/config/AppConfig.java b/src/main/java/dev/prithvis/downloadmanager/config/AppConfig.java index e068d23..dfc07b5 100644 --- a/src/main/java/dev/prithvis/downloadmanager/config/AppConfig.java +++ b/src/main/java/dev/prithvis/downloadmanager/config/AppConfig.java @@ -7,7 +7,7 @@ public class AppConfig { private static Properties appProperties; private static String defaultDownloadPath; public static System.Logger LOGGER; - private static void getAppConfigurations(){ + public static void getAppConfigurations(){ String fileName="application.properties"; FileInputStream fileInputStream; try { From 790f9170e4ecc3ba95d7928a79a6a9606683afb8 Mon Sep 17 00:00:00 2001 From: prithvi Date: Sun, 2 Oct 2022 12:36:12 +0530 Subject: [PATCH 10/14] Added a new constructor --- .../downloadmanager/models/FileInfo.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/main/java/dev/prithvis/downloadmanager/models/FileInfo.java b/src/main/java/dev/prithvis/downloadmanager/models/FileInfo.java index ebb6538..da7a4c6 100644 --- a/src/main/java/dev/prithvis/downloadmanager/models/FileInfo.java +++ b/src/main/java/dev/prithvis/downloadmanager/models/FileInfo.java @@ -8,8 +8,18 @@ public class FileInfo { private final SimpleStringProperty name=new SimpleStringProperty(); private final SimpleStringProperty url=new SimpleStringProperty(); private final SimpleStringProperty status=new SimpleStringProperty(); + private final SimpleStringProperty action=new SimpleStringProperty(); private final SimpleStringProperty addedOn=new SimpleStringProperty(); + public FileInfo(String downloadLocation, String filename, String urlTextField, String status, String action, String date) { + this.setLocation(downloadLocation); + this.setName(filename); + this.setUrl(urlTextField); + this.setStatus(status); + this.setAction(action); + this.setAddedOn(date); + } + public String getLocation() { return location.get(); } @@ -69,4 +79,16 @@ public SimpleStringProperty addedOnProperty() { public void setAddedOn(String addedOn) { this.addedOn.set(addedOn); } + + public String getAction() { + return action.get(); + } + + public SimpleStringProperty actionProperty() { + return action; + } + + public void setAction(String action) { + this.action.set(action); + } } From d53732cef71306e37023e17c7655e718ed875975 Mon Sep 17 00:00:00 2001 From: prithvi Date: Sun, 2 Oct 2022 20:17:35 +0530 Subject: [PATCH 11/14] Downloading part successfully completed --- pom.xml | 2 +- .../downloadmanager/DownloadManager.java | 62 ++++++++++++++++++- .../downloadmanager/HelloApplication.java | 23 ------- .../downloadmanager/HelloController.java | 14 ----- .../downloadmanager/MainDownload.java | 29 +++++++++ .../downloadmanager/config/AppConfig.java | 34 ---------- .../config/DownloadThread.java | 12 ++-- .../downloadmanager/models/FileInfo.java | 6 ++ src/main/resources/application.properties | 2 +- .../prithvis/downloadmanager/hello-view.fxml | 16 ----- .../download-manager.fxml | 4 +- 11 files changed, 104 insertions(+), 100 deletions(-) delete mode 100644 src/main/java/dev/prithvis/downloadmanager/HelloApplication.java delete mode 100644 src/main/java/dev/prithvis/downloadmanager/HelloController.java create mode 100644 src/main/java/dev/prithvis/downloadmanager/MainDownload.java delete mode 100644 src/main/java/dev/prithvis/downloadmanager/config/AppConfig.java delete mode 100644 src/main/resources/dev/prithvis/downloadmanager/hello-view.fxml rename src/main/resources/{dev/prithvis/downloadmanager => fxml}/download-manager.fxml (97%) diff --git a/pom.xml b/pom.xml index 9769d80..61f72a0 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ default-cli - dev.prithvis.downloadmanager/dev.prithvis.downloadmanager.HelloApplication + dev.prithvis.downloadmanager/dev.prithvis.downloadmanager.MainDownload app app diff --git a/src/main/java/dev/prithvis/downloadmanager/DownloadManager.java b/src/main/java/dev/prithvis/downloadmanager/DownloadManager.java index c153099..fcdd4f4 100644 --- a/src/main/java/dev/prithvis/downloadmanager/DownloadManager.java +++ b/src/main/java/dev/prithvis/downloadmanager/DownloadManager.java @@ -1,16 +1,72 @@ package dev.prithvis.downloadmanager; +import dev.prithvis.downloadmanager.config.DownloadThread; +import dev.prithvis.downloadmanager.models.FileInfo; import javafx.event.ActionEvent; import javafx.fxml.FXML; +import javafx.scene.control.TableColumn; +import javafx.scene.control.TableView; import javafx.scene.control.TextField; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; + public class DownloadManager { + public final System.Logger LOGGER=System.getLogger(this.getClass().getName()); + @FXML + private TableView downloadTable; + + @FXML + private TextField download_url_text_field; + + @FXML + private TextField file_name_field; + @FXML - private TextField urlTextField; + private TextField save_location_field; + @FXML void downloadButtonClicked(ActionEvent event) { - String urlTextField=this.urlTextField.getText(); + String urlTextField=this.download_url_text_field.getText().trim(); + String downloadLocation=this.save_location_field.getText().trim(); + String filename=this.file_name_field.getText().trim(); + String status="STARTED"; + String action="OPEN"; + DateTimeFormatter dateTimeFormatter=DateTimeFormatter.ofPattern("MMMM-dd-yyyy"); + LocalDate dateNow= LocalDate.now(); + String date= dateNow.format(dateTimeFormatter); + FileInfo file=new FileInfo(downloadLocation,filename,urlTextField,status,action,date); + LOGGER.log(System.Logger.Level.INFO,"Download file with info "+file+" started"); + DownloadThread thread=new DownloadThread(file,this); + thread.start(); + } + @FXML + public void initialize(){ + downloadTable=new TableView<>(); + TableColumn location=new TableColumn<>("Location"); + TableColumn fileName=new TableColumn<>("File Name"); + TableColumn downloadUrl=new TableColumn<>("Download URL"); + TableColumn status=new TableColumn<>("Status"); + TableColumn action=new TableColumn<>("Action"); + TableColumn addedOn=new TableColumn<>("Added on"); + + location.setCellValueFactory(p -> p.getValue().locationProperty()); + fileName.setCellValueFactory(p -> p.getValue().nameProperty()); + downloadUrl.setCellValueFactory(p -> p.getValue().urlProperty()); + status.setCellValueFactory(p -> p.getValue().statusProperty()); + action.setCellValueFactory(p -> p.getValue().actionProperty()); + addedOn.setCellValueFactory(p -> p.getValue().addedOnProperty()); + downloadTable.getColumns().add(location); + downloadTable.getColumns().add(fileName); + downloadTable.getColumns().add(downloadUrl); + downloadTable.getColumns().add(status); + downloadTable.getColumns().add(action); + downloadTable.getColumns().add(addedOn); + LOGGER.log(System.Logger.Level.DEBUG,"Initialized table"); + } + public void updateUI(FileInfo file) { + downloadTable.getItems().add(file); + downloadTable.refresh(); } - } diff --git a/src/main/java/dev/prithvis/downloadmanager/HelloApplication.java b/src/main/java/dev/prithvis/downloadmanager/HelloApplication.java deleted file mode 100644 index d15643f..0000000 --- a/src/main/java/dev/prithvis/downloadmanager/HelloApplication.java +++ /dev/null @@ -1,23 +0,0 @@ -package dev.prithvis.downloadmanager; - -import javafx.application.Application; -import javafx.fxml.FXMLLoader; -import javafx.scene.Scene; -import javafx.stage.Stage; - -import java.io.IOException; - -public class HelloApplication extends Application { - @Override - public void start(Stage stage) throws IOException { - FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("download-manager.fxml")); - Scene scene = new Scene(fxmlLoader.load(), 960, 640); - stage.setTitle("Download Manager"); - stage.setScene(scene); - stage.show(); - } - - public static void main(String[] args) { - launch(); - } -} \ No newline at end of file diff --git a/src/main/java/dev/prithvis/downloadmanager/HelloController.java b/src/main/java/dev/prithvis/downloadmanager/HelloController.java deleted file mode 100644 index bffbb51..0000000 --- a/src/main/java/dev/prithvis/downloadmanager/HelloController.java +++ /dev/null @@ -1,14 +0,0 @@ -package dev.prithvis.downloadmanager; - -import javafx.fxml.FXML; -import javafx.scene.control.Label; - -public class HelloController { - @FXML - private Label welcomeText; - - @FXML - protected void onHelloButtonClick() { - welcomeText.setText("Welcome to JavaFX Application!"); - } -} \ No newline at end of file diff --git a/src/main/java/dev/prithvis/downloadmanager/MainDownload.java b/src/main/java/dev/prithvis/downloadmanager/MainDownload.java new file mode 100644 index 0000000..e9f7dac --- /dev/null +++ b/src/main/java/dev/prithvis/downloadmanager/MainDownload.java @@ -0,0 +1,29 @@ +package dev.prithvis.downloadmanager; + +import javafx.application.Application; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.stage.Stage; + +import java.io.IOException; +import java.util.ResourceBundle; + +public class MainDownload extends Application { + public final System.Logger LOGGER= System.getLogger(this.getClass().getName()); + @Override + public void start(Stage stage) throws IOException { + ResourceBundle resourceBundle=ResourceBundle.getBundle("application"); + FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/download-manager.fxml"),resourceBundle); + Parent root = loader.load(); + LOGGER.log(System.Logger.Level.INFO,"Started application"); + Scene scene = new Scene(root,800,600); + stage.setTitle("Download Manager"); + stage.setScene(scene); + stage.show(); + } + + public static void main(String[] args) { + launch(args); + } +} \ No newline at end of file diff --git a/src/main/java/dev/prithvis/downloadmanager/config/AppConfig.java b/src/main/java/dev/prithvis/downloadmanager/config/AppConfig.java deleted file mode 100644 index dfc07b5..0000000 --- a/src/main/java/dev/prithvis/downloadmanager/config/AppConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -package dev.prithvis.downloadmanager.config; - -import java.io.*; -import java.util.Properties; - -public class AppConfig { - private static Properties appProperties; - private static String defaultDownloadPath; - public static System.Logger LOGGER; - public static void getAppConfigurations(){ - String fileName="application.properties"; - FileInputStream fileInputStream; - try { - fileInputStream=new FileInputStream(fileName); - appProperties=new Properties(); - appProperties.load(fileInputStream); - LOGGER.log(System.Logger.Level.INFO,"Successfully loaded application.properties"); - defaultDownloadPath=System.getenv("HOME")+ File.separator+appProperties.getProperty("DOWNLOAD_PATH"); - LOGGER.log(System.Logger.Level.DEBUG,"Default download path is set to "+defaultDownloadPath); - } catch (IOException ioException){ - LOGGER.log(System.Logger.Level.ERROR,ioException); - } - } - public static String getDefaultDownloadPath() { - return defaultDownloadPath; - } - - public static void setDefaultDownloadPath(String defaultDownloadPath) { - AppConfig.defaultDownloadPath = defaultDownloadPath; - } - public static void saveAppConfigurations(){ - appProperties.put("DOWNLOAD_PATH",defaultDownloadPath); - } -} diff --git a/src/main/java/dev/prithvis/downloadmanager/config/DownloadThread.java b/src/main/java/dev/prithvis/downloadmanager/config/DownloadThread.java index 7ead7a5..9e6c4b6 100644 --- a/src/main/java/dev/prithvis/downloadmanager/config/DownloadThread.java +++ b/src/main/java/dev/prithvis/downloadmanager/config/DownloadThread.java @@ -12,7 +12,7 @@ public class DownloadThread extends Thread{ public FileInfo file; public DownloadManager downloadManager; - public static System.Logger LOGGER; + public final System.Logger LOGGER=System.getLogger(this.getClass().getName()); public DownloadThread(FileInfo file,DownloadManager downloadManager){ this.downloadManager=downloadManager; this.file=file; @@ -22,23 +22,23 @@ public void run(){ this.file.setStatus("DOWNLOADING"); this.downloadManager.updateUI(file); try { - Files.copy((new URL(this.file.getUrl()).openStream()), Paths.get(this.file.getLocation())); + Files.copy((new URL(this.file.getUrl()).openStream()), Paths.get(file.getLocation(), file.getName())); this.file.setStatus("DOWNLOADED"); - LOGGER.log(System.Logger.Level.INFO,String.format("%s downloaded at %s"+System.lineSeparator(), + LOGGER.log(System.Logger.Level.INFO,String.format("%s downloaded at %s", file.getName(),file.getLocation())); }catch (FileAlreadyExistsException fileAlreadyExistsException){ this.file.setStatus("SKIPPED"); - LOGGER.log(System.Logger.Level.WARNING,String.format("%s already exists at %s.Skipping download"+System.lineSeparator() + LOGGER.log(System.Logger.Level.WARNING,String.format("%s already exists at %s.Skipping download" ,file.getName(),file.getLocation())); } catch (IOException e) { this.file.setStatus("FAILED"); - LOGGER.log(System.Logger.Level.ERROR,String.format("Download of %s failed because of %s"+System.lineSeparator(), + LOGGER.log(System.Logger.Level.ERROR,String.format("Download of %s failed because of %s", file.getName(),e.getMessage())); throw new RuntimeException(e); } this.downloadManager.updateUI(file); - LOGGER.log(System.Logger.Level.INFO,String.format("Download of %s completed"+System.lineSeparator(), + LOGGER.log(System.Logger.Level.INFO,String.format("Download of %s completed", file.getName())); } } diff --git a/src/main/java/dev/prithvis/downloadmanager/models/FileInfo.java b/src/main/java/dev/prithvis/downloadmanager/models/FileInfo.java index da7a4c6..c0e7989 100644 --- a/src/main/java/dev/prithvis/downloadmanager/models/FileInfo.java +++ b/src/main/java/dev/prithvis/downloadmanager/models/FileInfo.java @@ -91,4 +91,10 @@ public SimpleStringProperty actionProperty() { public void setAction(String action) { this.action.set(action); } + + @Override + public String toString() { + return "name=" + name.get() + + ",location=" + location.get(); + } } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index fa25a71..27fb8fa 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,2 +1,2 @@ -DOWNLOAD_PATH=Documents/Downloads +DOWNLOAD_PATH=/Users/prithvisingh/Documents/Downloads diff --git a/src/main/resources/dev/prithvis/downloadmanager/hello-view.fxml b/src/main/resources/dev/prithvis/downloadmanager/hello-view.fxml deleted file mode 100644 index 83c06df..0000000 --- a/src/main/resources/dev/prithvis/downloadmanager/hello-view.fxml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - -