continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r593063 - /maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDataManagementTool.java
Date Thu, 08 Nov 2007 08:32:38 GMT
Author: evenisse
Date: Thu Nov  8 00:32:37 2007
New Revision: 593063

URL: http://svn.apache.org/viewvc?rev=593063&view=rev
Log:
[CONTINUUM-1552] Create backup directory if it doesn't exist

Modified:
    maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDataManagementTool.java

Modified: maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDataManagementTool.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDataManagementTool.java?rev=593063&r1=593062&r2=593063&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDataManagementTool.java
(original)
+++ maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDataManagementTool.java
Thu Nov  8 00:32:37 2007
@@ -19,6 +19,24 @@
  * under the License.
  */
 
+import org.apache.maven.continuum.model.project.BuildDefinition;
+import org.apache.maven.continuum.model.project.ContinuumDatabase;
+import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.project.ProjectGroup;
+import org.apache.maven.continuum.model.project.Schedule;
+import org.apache.maven.continuum.model.project.io.stax.ContinuumStaxReader;
+import org.apache.maven.continuum.model.project.io.stax.ContinuumStaxWriter;
+import org.apache.maven.continuum.model.system.Installation;
+import org.apache.maven.continuum.model.system.Profile;
+import org.apache.maven.continuum.store.ContinuumStore;
+import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.codehaus.plexus.jdo.ConfigurableJdoFactory;
+import org.codehaus.plexus.jdo.PlexusJdoUtils;
+import org.codehaus.plexus.util.IOUtil;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.PersistenceManagerFactory;
+import javax.xml.stream.XMLStreamException;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.FileReader;
@@ -35,25 +53,6 @@
 import java.util.Map;
 import java.util.Properties;
 
-import javax.jdo.JDOHelper;
-import javax.jdo.PersistenceManagerFactory;
-import javax.xml.stream.XMLStreamException;
-
-import org.apache.maven.continuum.model.project.BuildDefinition;
-import org.apache.maven.continuum.model.project.ContinuumDatabase;
-import org.apache.maven.continuum.model.project.Project;
-import org.apache.maven.continuum.model.project.ProjectGroup;
-import org.apache.maven.continuum.model.project.Schedule;
-import org.apache.maven.continuum.model.project.io.stax.ContinuumStaxReader;
-import org.apache.maven.continuum.model.project.io.stax.ContinuumStaxWriter;
-import org.apache.maven.continuum.model.system.Installation;
-import org.apache.maven.continuum.model.system.Profile;
-import org.apache.maven.continuum.store.ContinuumStore;
-import org.apache.maven.continuum.store.ContinuumStoreException;
-import org.codehaus.plexus.jdo.ConfigurableJdoFactory;
-import org.codehaus.plexus.jdo.PlexusJdoUtils;
-import org.codehaus.plexus.util.IOUtil;
-
 /**
  * JDO implementation the database management tool API.
  *
@@ -103,9 +102,11 @@
 
         ContinuumStaxWriter writer = new ContinuumStaxWriter();
 
-        backupDirectory.mkdirs();
+        File backupFile = new File( backupDirectory, BUILDS_XML );
+        File parentFile = backupFile.getParentFile();
+        parentFile.mkdirs();
 
-        OutputStream out = new FileOutputStream( new File( backupDirectory, BUILDS_XML )
);
+        OutputStream out = new FileOutputStream( backupFile );
         Writer fileWriter = new OutputStreamWriter( out, Charset.forName( database.getModelEncoding()
) );
 
         try



Mime
View raw message