Commit in lcsim/src/org/lcsim/util/aida on MAIN
AIDA.java+17-71.8 -> 1.9
Add convenience methods to AIDA

lcsim/src/org/lcsim/util/aida
AIDA.java 1.8 -> 1.9
diff -u -r1.8 -r1.9
--- AIDA.java	22 Oct 2008 04:25:12 -0000	1.8
+++ AIDA.java	30 Jan 2009 00:07:50 -0000	1.9
@@ -74,6 +74,7 @@
          throw new AIDAException("IOException creating temporary store",x);
       }
    }
+
    private void checkPath(String path)
    {
       int pos = path.lastIndexOf('/');
@@ -283,17 +284,26 @@
 
    public void saveAs(String name) throws IOException
    {
-       save(name, false);
+       if (!name.toLowerCase().endsWith(".aida")) name = name + ".aida";
+       save(new File(name), false);
    }
-   
-   public void saveAsZip(String name) throws IOException
+
+   public void saveAs(File outFile) throws IOException
    {
-       save(name, true);
+       save(outFile,false);
    }
    
-   void save(String name, boolean useZip) throws IOException {
+   public void saveAsZip(String name) throws IOException
+   {
        if (!name.toLowerCase().endsWith(".aida")) name = name + ".aida";
-       File dest = new File(name);
+       save(new File(name), true);
+   }
+
+   public void saveAsZip(File outFile) throws IOException
+   {
+       save(outFile,true);
+   }
+   void save(File dest, boolean useZip) throws IOException {
        if (!useZip) {
            tree.commit();
            if (dest.exists()) dest.delete();
@@ -317,7 +327,7 @@
       } else {
           AidaXMLStore store = new AidaXMLStore();
           if (dest.exists()) dest.delete();
-          de.schlichtherle.io.File newFile = new de.schlichtherle.io.File(name);
+          de.schlichtherle.io.File newFile = new de.schlichtherle.io.File(dest);
           //if (newFile.exists() && !newFile.isDirectory()) 
               //throw new IOException("File already exists: "+newFile.getAbsolutePath());
           store.commit(tree, newFile, null, useZip, false, false);
CVSspam 0.2.8