Move the zip block outside the bundle block

Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/commit/c954f5b7
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/tree/c954f5b7
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/diff/c954f5b7

Branch: refs/heads/cwl
Commit: c954f5b77e30011bbc31df05c660f161594acff2
Parents: 26664a8
Author: Ian Dunlop <[email protected]>
Authored: Wed Feb 24 15:29:25 2016 +0000
Committer: Ian Dunlop <[email protected]>
Committed: Wed Feb 24 15:29:25 2016 +0000

----------------------------------------------------------------------
 .../taverna/robundle/validator/RoValidator.java | 28 +++++++++-----------
 1 file changed, 13 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/blob/c954f5b7/taverna-robundle/src/main/java/org/apache/taverna/robundle/validator/RoValidator.java
----------------------------------------------------------------------
diff --git 
a/taverna-robundle/src/main/java/org/apache/taverna/robundle/validator/RoValidator.java
 
b/taverna-robundle/src/main/java/org/apache/taverna/robundle/validator/RoValidator.java
index 7757135..7035262 100644
--- 
a/taverna-robundle/src/main/java/org/apache/taverna/robundle/validator/RoValidator.java
+++ 
b/taverna-robundle/src/main/java/org/apache/taverna/robundle/validator/RoValidator.java
@@ -81,24 +81,22 @@ public class RoValidator {
        }
        
        public void validate(){
-               
-               try (Bundle bundle = Bundles.openBundle(path)) {
-                       
+               // Autoclose the zip file
+               try(ZipFile zip = new ZipFile(new File(path.toString()))) {
+                       Enumeration<? extends ZipEntry> ent = zip.entries();
+                       while(ent.hasMoreElements()){
+                               ZipEntry entry = ent.nextElement();
+                               if(!entry.isDirectory()){
+                                       items.add("/"+entry.getName());
+                               }
+                       }
+               } catch (IOException e) {
+                               e.printStackTrace();
+               }
+               try (Bundle bundle = Bundles.openBundle(path)) {        
                        Manifest manifest = bundle.getManifest();
                        this.aggr = manifest.getAggregates();
                        this.anno = manifest.getAnnotations();
-                       // Autoclose the zip file
-                       try(ZipFile zip = new ZipFile(new 
File(path.toString()))) {
-                               Enumeration<? extends ZipEntry> ent = 
zip.entries();
-                               while(ent.hasMoreElements()){
-                                       ZipEntry entry = ent.nextElement();
-                                       if(!entry.isDirectory()){
-                                               items.add("/"+entry.getName());
-                                       }
-                               }
-                               } catch (IOException e) {
-                                       e.printStackTrace();
-                       }
                } catch (IOException e) {
                        // TODO Auto-generated catch block
                        System.err.println("Unable to open the bundle");

Reply via email to