From ee41acf81a8b91c54a40a2559093e5407d78e1b4 Mon Sep 17 00:00:00 2001 From: nadeaj Date: Fri, 19 Aug 2016 07:04:38 -0400 Subject: [PATCH] Resume Support - Resume Support --- OSVUploadr/pom.xml | 2 +- .../java/ca/osmcanada/osvuploadr/JPMain.java | 46 ++++++++++++++++++- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/OSVUploadr/pom.xml b/OSVUploadr/pom.xml index dcf9e8c..32eae26 100644 --- a/OSVUploadr/pom.xml +++ b/OSVUploadr/pom.xml @@ -3,7 +3,7 @@ 4.0.0 ca.osmcanada OSVUploadr - 0.1-ALPHA + 0.1.1-ALPHA jar diff --git a/OSVUploadr/src/main/java/ca/osmcanada/osvuploadr/JPMain.java b/OSVUploadr/src/main/java/ca/osmcanada/osvuploadr/JPMain.java index 6d8ce8e..06b35e5 100644 --- a/OSVUploadr/src/main/java/ca/osmcanada/osvuploadr/JPMain.java +++ b/OSVUploadr/src/main/java/ca/osmcanada/osvuploadr/JPMain.java @@ -393,6 +393,45 @@ public int compare(File f1, File f2) } //TODO: Load count from file int cnt =0; + File f_cnt = new File(dir+"/count_file.txt"); + if(f_cnt.exists()) + { + try + { + List id = Files.readAllLines(Paths.get(f_cnt.getPath())); + if(id.size()>0) + { + cnt= Integer.parseInt(id.get(0)); + } + } + catch(Exception ex) + { + cnt=0; + } + } + else + { + try{ + f_cnt.createNewFile(); + } + catch(Exception ex) + { + Logger.getLogger(JPMain.class.getName()).log(Level.SEVERE, null, ex); + } + } + if(cnt>0){ + if(file_list.length>cnt){ + File[] tmp = new File[file_list.length-cnt]; + int local_cnt=0; + for(int i=cnt;i