--- a/tool/run/plugins/spdx/create.java
+++ b/tool/run/plugins/spdx/create.java
@@ -13,15 +13,12 @@
package spdx;
import GUI.swingUtils;
-import spdxlib.DocumentCreate;
import definitions.Messages;
import definitions.is;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
-import script.Plugin;
-import script.log;
import main.core;
import main.param;
import org.rauschig.jarchivelib.ArchiveFormat;
@@ -29,7 +26,10 @@
import org.rauschig.jarchivelib.ArchiverFactory;
import org.rauschig.jarchivelib.CompressionType;
import script.DownloadBigFile;
+import script.Plugin;
import script.RunningTask;
+import script.log;
+import spdxlib.DocumentCreate;
import utils.html;
import www.RequestOrigin;
import www.WebRequest;
@@ -254,6 +254,8 @@
// show the dialog
File result = swingUtils.chooseFolder(new File(selectedFolder));
+ log.write(is.ACCEPTED, "Chose folder %1 as source for the SPDX "
+ + "document", result.getAbsolutePath());
// place the result in our settings
if(result != null){
@@ -318,14 +320,27 @@
DocumentCreate newSPDX){
task.setStatus("Creating the SPDX document");
-
+ String result = "";
+
+ try{
// do all the heavy work
- String result = newSPDX.create(extractedFolder);
+ result = newSPDX.create(extractedFolder);
+ }catch (Exception e){
+ log.write(is.ERROR, "CR01- Exception occurred when creating SPDX");
+ }
// count the time it took to run this task
long time = System.currentTimeMillis() - task.getUID();
String timeCount = utils.time.timeNumberToHumanReadable(time) + " were "
+ "necessary to complete this task";
task.setStatus(timeCount);
+
+ // something went wrong, raise a flag
+ if(result.isEmpty()){
+ task.setStatus("Exception occurred when creating SPDX!");
+ task.setPercentageComplete(100);
+ return "";
+ }
+
// all done
task.setStatus("All done!");
task.setPercentageComplete(100);
@@ -462,9 +477,9 @@
* updating the tree view
*/
private void concludeCreation(DocumentCreate newSPDX){
- String UID = newSPDX.UID;
- // refresh the tree
- swingUtils.refreshAll(core.studio.getTree(), UID);
+// String UID = newSPDX.UID;
+// // refresh the tree
+// swingUtils.refreshAll(core.studio.getTree(), UID);
}
}