]> source.dussan.org Git - archiva.git/commitdiff
avoid creating temp directory in repository directory
authorOlivier Lamy <olamy@apache.org>
Mon, 2 Apr 2012 15:02:12 +0000 (15:02 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 2 Apr 2012 15:02:12 +0000 (15:02 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1308376 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyConnectors.java
archiva-modules/plugins/maven2-repository/pom.xml
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java

index d51afc5ae73617b749d5ef47f6f77b9375704f90..d9d61542617a644a033e77a4437b34f4e6051dfa 100644 (file)
@@ -1009,19 +1009,6 @@ public class DefaultRepositoryProxyConnectors
      */
     private File createWorkingDirectory( ManagedRepositoryContent repository )
     {
-        // TODO: This is ugly - lets actually clean this up when we get the new repository api
-        /*
-        try
-        {
-            File tmpDir = File.createTempFile( ".workingdirectory", null );
-            tmpDir.delete();
-            tmpDir.mkdirs();
-            return tmpDir;
-        }
-        catch ( IOException e )
-        {
-            throw new RuntimeException( "Could not create working directory for this request", e );
-        } */
         return Files.createTempDir();
     }
 
index 157257c46a96f07d6311c332437eddcf8ffb8eb2..47de02dea9636d3a39ca65edcb2148de8ff25c32 100644 (file)
               org.apache.maven.index*,
               org.apache.maven.wagon*,
               org.codehaus.plexus*,
+              com.google.common.io,
               org.codehaus.redback.components*,
               org.dom4j*;version="[1.6,2)",
               org.springframework*;version="[3,4)",
index d3dc6e969da3526ef6b37ff9de52aac1887cbd00..946e2f610f617a6d1c69e8113bb2e66529561e9e 100644 (file)
@@ -19,6 +19,7 @@ package org.apache.archiva.metadata.repository.storage.maven2;
  * under the License.
  */
 
+import com.google.common.io.Files;
 import org.apache.archiva.admin.model.beans.ManagedRepository;
 import org.apache.archiva.admin.model.beans.NetworkProxy;
 import org.apache.archiva.admin.model.beans.RemoteRepository;
@@ -424,17 +425,7 @@ public class RepositoryModelResolver
 
     private File createWorkingDirectory( String targetRepository )
     {
-        try
-        {
-            File tmpDir = File.createTempFile( ".workingdirectory", null, new File( targetRepository ) );
-            tmpDir.delete();
-            tmpDir.mkdirs();
-            return tmpDir;
-        }
-        catch ( IOException e )
-        {
-            throw new RuntimeException( "Could not create working directory for this request", e );
-        }
+        return Files.createTempDir();
     }
 
     private void moveFileIfExists( File fileToMove, File directory )