Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Oberlies2014-04-08 07:47:43 -0400
committerTobias Oberlies2014-04-08 07:59:12 -0400
commit2f27e20dec7202567cc7600248cdb991a352ee32 (patch)
tree15ebddbacdff9400ce0fe308f5483067082097cd
parent8e5e9f83e31b9e61a22b890bd688e38dd0c493f6 (diff)
downloadorg.eclipse.tycho.nexus-2f27e20dec7202567cc7600248cdb991a352ee32.tar.gz
org.eclipse.tycho.nexus-2f27e20dec7202567cc7600248cdb991a352ee32.tar.xz
org.eclipse.tycho.nexus-2f27e20dec7202567cc7600248cdb991a352ee32.zip
431866 Clean up of request object change
- Cleanup of already submitted change 7a0ae4b. Mostly copyright statement, JavaDoc and parameter name changes. Bug: 431866 Change-Id: I29aa7f328d586073851745cc7d29ce5fa6b68aa3
-rw-r--r--unzip-repository-plugin-its/src/test/java/org/eclipse/tycho/nexus/internal/plugin/UnzipRepositoryPluginITCase.java2
-rw-r--r--unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepository.java20
-rw-r--r--unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/cache/UnzipCache.java2
-rw-r--r--unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZipAwareStorageCollectionItem.java2
-rw-r--r--unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedItem.java12
-rw-r--r--unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedStorageCollectionItem.java2
-rw-r--r--unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedStorageFileItem.java2
-rw-r--r--unzip-repository-plugin/src/test/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepositoryTest.java2
-rw-r--r--unzip-repository-plugin/src/test/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedItemTest.java2
-rw-r--r--unzip-repository-plugin/src/test/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedStorageCollectionItemTest.java2
-rw-r--r--unzip-repository-plugin/src/test/java/org/eclipse/tycho/nexus/internal/plugin/test/RepositoryMock.java2
11 files changed, 26 insertions, 24 deletions
diff --git a/unzip-repository-plugin-its/src/test/java/org/eclipse/tycho/nexus/internal/plugin/UnzipRepositoryPluginITCase.java b/unzip-repository-plugin-its/src/test/java/org/eclipse/tycho/nexus/internal/plugin/UnzipRepositoryPluginITCase.java
index e4c831f..e5e4f3c 100644
--- a/unzip-repository-plugin-its/src/test/java/org/eclipse/tycho/nexus/internal/plugin/UnzipRepositoryPluginITCase.java
+++ b/unzip-repository-plugin-its/src/test/java/org/eclipse/tycho/nexus/internal/plugin/UnzipRepositoryPluginITCase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013 SAP AG and others.
+ * Copyright (c) 2013, 2014 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepository.java b/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepository.java
index e7273d5..550dd8e 100644
--- a/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepository.java
+++ b/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepository.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 SAP AG and others.
+ * Copyright (c) 2010, 2014 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -244,24 +244,24 @@ public class DefaultUnzipRepository extends AbstractShadowRepository implements
}
/**
- * Retrieves an item from the master repository. The method includes some workaround logic to
- * access folders (some folders are only accessible if the request URL end with a double slash).
- * In addition this method also finds file items if the request URL ends with a slash.
+ * Retrieves an item from the master repository.
*
+ * @param requestPath
+ * the path to the item be retrieved from the master repository
* @param originalRequest
- * the request that defines which item be retrieved
- * @param conversionResult
+ * the original request to the virtual repository providing context information the
+ * request to the master repository
* @return the item from the master repository
* @throws ItemNotFoundException
* is thrown if there is no item under the specified request path in the master
* repository
* @throws LocalStorageException
*/
- StorageItem retrieveItemFromMaster(final ResourceStoreRequest originalRequest, ConversionResult conversionResult)
+ StorageItem retrieveItemFromMaster(String requestPath, ResourceStoreRequest originalRequest)
throws ItemNotFoundException, LocalStorageException {
try {
// use original request with modified path (e.g. like in AbstractMavenRepository.doRetrieveArtifactItem)
- originalRequest.pushRequestPath(conversionResult.getConvertedPath());
+ originalRequest.pushRequestPath(requestPath);
try {
return doRetrieveItemFromMaster(originalRequest);
} finally {
@@ -304,7 +304,7 @@ public class DefaultUnzipRepository extends AbstractShadowRepository implements
// check if item exists in master repository
// this call will fail with ItemNotFoundException if the item does not exist in the master repository
- final StorageItem masterItem = retrieveItemFromMaster(request, conversionResult);
+ final StorageItem masterItem = retrieveItemFromMaster(conversionResult.getConvertedPath(), request);
if (masterItem instanceof StorageCollectionItem) {
// item is non-zip folder
@@ -328,6 +328,8 @@ public class DefaultUnzipRepository extends AbstractShadowRepository implements
* @param conversionResult
* the result of the snapshot path conversion, containing the converted path
* @param request
+ * the {@link ResourceStoreRequest} for the item. The request is included in the
+ * {@link StorageItem} returned by the repository.
* @return item that represents a file or folder within a zip file, <code>null</code> if the
* requested path does not point to zip content
* @throws LocalStorageException
diff --git a/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/cache/UnzipCache.java b/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/cache/UnzipCache.java
index 15e518e..dc11828 100644
--- a/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/cache/UnzipCache.java
+++ b/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/cache/UnzipCache.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 SAP AG and others.
+ * Copyright (c) 2010, 2014 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZipAwareStorageCollectionItem.java b/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZipAwareStorageCollectionItem.java
index ad3cb7a..a91c000 100644
--- a/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZipAwareStorageCollectionItem.java
+++ b/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZipAwareStorageCollectionItem.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 SAP AG and others.
+ * Copyright (c) 2010, 2014 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedItem.java b/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedItem.java
index f993436..62e99a8 100644
--- a/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedItem.java
+++ b/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedItem.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 SAP AG and others.
+ * Copyright (c) 2010, 2014 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -97,7 +97,7 @@ public class ZippedItem {
* @param repository
* the repository in which the zipped item is accessed (the unzip repository)
* @param parentContext
- * the context for the request of the parent item being listed
+ * the context of the request to the parent item being listed
* @param zipItemPath
* the path to the zip file
* @param pathInZip
@@ -147,10 +147,6 @@ public class ZippedItem {
return request;
}
- private static String removeTrailingSlash(final String path) {
- return (path.endsWith("/") ? path.substring(0, path.length() - 1) : path);
- }
-
private ZippedItem(final DefaultUnzipRepository repository, final ResourceStoreRequest request,
final String zipItemPath, final String pathInZip, final long lastModified, final Logger logger) {
this.repository = repository;
@@ -167,6 +163,10 @@ public class ZippedItem {
}
}
+ private static String removeTrailingSlash(final String path) {
+ return (path.endsWith("/") ? path.substring(0, path.length() - 1) : path);
+ }
+
/**
* Returns the path of the zipped item relative to the zip file. The returned path is always
* without trailing slash (this is consistent with the behaviour of
diff --git a/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedStorageCollectionItem.java b/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedStorageCollectionItem.java
index b4ee587..30b6622 100644
--- a/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedStorageCollectionItem.java
+++ b/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedStorageCollectionItem.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 SAP AG and others.
+ * Copyright (c) 2010, 2014 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedStorageFileItem.java b/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedStorageFileItem.java
index 85f8605..916cd5c 100644
--- a/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedStorageFileItem.java
+++ b/unzip-repository-plugin/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedStorageFileItem.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 SAP AG and others.
+ * Copyright (c) 2010, 2014 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/unzip-repository-plugin/src/test/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepositoryTest.java b/unzip-repository-plugin/src/test/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepositoryTest.java
index 452d5a7..6282c26 100644
--- a/unzip-repository-plugin/src/test/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepositoryTest.java
+++ b/unzip-repository-plugin/src/test/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepositoryTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 SAP AG and others.
+ * Copyright (c) 2010, 2014 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/unzip-repository-plugin/src/test/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedItemTest.java b/unzip-repository-plugin/src/test/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedItemTest.java
index 4d571dd..1ec0d51 100644
--- a/unzip-repository-plugin/src/test/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedItemTest.java
+++ b/unzip-repository-plugin/src/test/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedItemTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 SAP AG and others.
+ * Copyright (c) 2010, 2014 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/unzip-repository-plugin/src/test/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedStorageCollectionItemTest.java b/unzip-repository-plugin/src/test/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedStorageCollectionItemTest.java
index f7400f1..5c60ca8 100644
--- a/unzip-repository-plugin/src/test/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedStorageCollectionItemTest.java
+++ b/unzip-repository-plugin/src/test/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedStorageCollectionItemTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 SAP AG and others.
+ * Copyright (c) 2010, 2014 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/unzip-repository-plugin/src/test/java/org/eclipse/tycho/nexus/internal/plugin/test/RepositoryMock.java b/unzip-repository-plugin/src/test/java/org/eclipse/tycho/nexus/internal/plugin/test/RepositoryMock.java
index 221b2f0..53c4d72 100644
--- a/unzip-repository-plugin/src/test/java/org/eclipse/tycho/nexus/internal/plugin/test/RepositoryMock.java
+++ b/unzip-repository-plugin/src/test/java/org/eclipse/tycho/nexus/internal/plugin/test/RepositoryMock.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 SAP AG and others.
+ * Copyright (c) 2010, 2014 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at

Back to the top