archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdu...@apache.org
Subject svn commit: r671209 - in /archiva/sandbox/new-repository-api: ./ src/main/java/org/apache/archiva/repository/ src/main/java/org/apache/archiva/repository/filesystem/
Date Tue, 24 Jun 2008 15:23:26 GMT
Author: jdumay
Date: Tue Jun 24 08:23:26 2008
New Revision: 671209

URL: http://svn.apache.org/viewvc?rev=671209&view=rev
Log:
Adding some unit tests for the basic file system repository backend. Fixed up imports.

Modified:
    archiva/sandbox/new-repository-api/   (props changed)
    archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/Repository.java
    archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/RepositoryProxyManager.java
    archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/RepositoryWriteException.java
    archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/ResourceContext.java
    archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/ResourceRepository.java
    archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/filesystem/FileSystemRepositoryBackend.java

Propchange: archiva/sandbox/new-repository-api/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Jun 24 08:23:26 2008
@@ -0,0 +1 @@
+target

Modified: archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/Repository.java
URL: http://svn.apache.org/viewvc/archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/Repository.java?rev=671209&r1=671208&r2=671209&view=diff
==============================================================================
--- archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/Repository.java
(original)
+++ archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/Repository.java
Tue Jun 24 08:23:26 2008
@@ -1,3 +1,5 @@
+package org.apache.archiva.repository;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -16,13 +18,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.archiva.repository;
 
 import java.io.InputStream;
 
 /**
- *
- * @author jdumay
+ * @author <a href="mailto:james@atlassian.com">James William Dumay</a>
  */
 public interface Repository
 {

Modified: archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/RepositoryProxyManager.java
URL: http://svn.apache.org/viewvc/archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/RepositoryProxyManager.java?rev=671209&r1=671208&r2=671209&view=diff
==============================================================================
--- archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/RepositoryProxyManager.java
(original)
+++ archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/RepositoryProxyManager.java
Tue Jun 24 08:23:26 2008
@@ -1,3 +1,5 @@
+package org.apache.archiva.repository;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -16,7 +18,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.archiva.repository;
 
 import java.io.InputStream;
 

Modified: archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/RepositoryWriteException.java
URL: http://svn.apache.org/viewvc/archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/RepositoryWriteException.java?rev=671209&r1=671208&r2=671209&view=diff
==============================================================================
--- archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/RepositoryWriteException.java
(original)
+++ archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/RepositoryWriteException.java
Tue Jun 24 08:23:26 2008
@@ -1,3 +1,5 @@
+package org.apache.archiva.repository;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -16,7 +18,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.archiva.repository;
 
 /**
  *

Modified: archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/ResourceContext.java
URL: http://svn.apache.org/viewvc/archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/ResourceContext.java?rev=671209&r1=671208&r2=671209&view=diff
==============================================================================
--- archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/ResourceContext.java
(original)
+++ archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/ResourceContext.java
Tue Jun 24 08:23:26 2008
@@ -1,3 +1,5 @@
+package org.apache.archiva.repository;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -16,7 +18,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.archiva.repository;
 
 /**
  * @author <a href="mailto:james@atlassian.com">James William Dumay</a>

Modified: archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/ResourceRepository.java
URL: http://svn.apache.org/viewvc/archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/ResourceRepository.java?rev=671209&r1=671208&r2=671209&view=diff
==============================================================================
--- archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/ResourceRepository.java
(original)
+++ archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/ResourceRepository.java
Tue Jun 24 08:23:26 2008
@@ -1,3 +1,5 @@
+package org.apache.archiva.repository;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -16,7 +18,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.archiva.repository;
 
 import java.io.InputStream;
 

Modified: archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/filesystem/FileSystemRepositoryBackend.java
URL: http://svn.apache.org/viewvc/archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/filesystem/FileSystemRepositoryBackend.java?rev=671209&r1=671208&r2=671209&view=diff
==============================================================================
--- archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/filesystem/FileSystemRepositoryBackend.java
(original)
+++ archiva/sandbox/new-repository-api/src/main/java/org/apache/archiva/repository/filesystem/FileSystemRepositoryBackend.java
Tue Jun 24 08:23:26 2008
@@ -46,10 +46,10 @@
     public InputStream getStream(ResourceContext context)
         throws RepositoryReadException
     {
-        File file = new File(rootPath, context.getRepositoryId());
+        File file = getFileForContext(context);
         if (!file.exists())
         {
-            throw new RepositoryReadException("");
+            throw new RepositoryReadException(file.getAbsolutePath() + " does not exist");
         }
         
         try
@@ -65,7 +65,7 @@
     public void writeStream(ResourceContext context, InputStream is)
         throws RepositoryWriteException
     {
-        File file = new File(rootPath, context.getLogicalPath());
+        File file = getFileForContext(context);
         if (!file.exists())
         {
             if (!file.getParentFile().mkdirs())
@@ -89,4 +89,9 @@
             IOUtils.closeQuietly(os);
         }
     }
+    
+    private File getFileForContext(ResourceContext context)
+    {
+        return new File(new File(rootPath, context.getRepositoryId()), context.getLogicalPath());
+    }
 }



Mime
View raw message