diff options
author | Martin Stockhammer <martin_s@apache.org> | 2020-02-29 18:52:24 +0100 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2020-02-29 18:52:24 +0100 |
commit | 24aba5ac73da0ad83caf43ce606f07cd57bc2891 (patch) | |
tree | d8c5c2262c6998e8331bb2f99549e995fc8c4abc /archiva-modules/archiva-web | |
parent | de22e846edafd2ba8b06ab135be43b4c596c3db0 (diff) | |
download | archiva-24aba5ac73da0ad83caf43ce606f07cd57bc2891.tar.gz archiva-24aba5ac73da0ad83caf43ce606f07cd57bc2891.zip |
Moving storage utility methods to api module
Diffstat (limited to 'archiva-modules/archiva-web')
4 files changed, 7 insertions, 11 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java index 7899fdf22..053e12c3a 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java @@ -22,7 +22,6 @@ import org.apache.archiva.admin.model.beans.ManagedRepository; import org.apache.archiva.common.utils.VersionComparator; import org.apache.archiva.common.utils.VersionUtil; import org.apache.archiva.dependency.tree.maven2.DependencyTreeBuilder; -import org.apache.archiva.maven2.metadata.MavenMetadataReader; import org.apache.archiva.maven2.model.Artifact; import org.apache.archiva.maven2.model.TreeEntry; import org.apache.archiva.metadata.generic.GenericMetadataFacet; @@ -45,14 +44,13 @@ import org.apache.archiva.repository.RepositoryNotFoundException; import org.apache.archiva.repository.RepositoryRegistry; import org.apache.archiva.repository.metadata.MetadataReader; import org.apache.archiva.repository.metadata.base.MetadataTools; +import org.apache.archiva.repository.storage.FsStorageUtil; import org.apache.archiva.repository.storage.StorageAsset; -import org.apache.archiva.repository.storage.StorageUtil; import org.apache.archiva.rest.api.model.*; import org.apache.archiva.rest.api.services.ArchivaRestServiceException; import org.apache.archiva.rest.api.services.BrowseService; import org.apache.archiva.rest.services.utils.ArtifactContentEntryComparator; import org.apache.archiva.security.ArchivaSecurityException; -import org.apache.archiva.xml.XMLException; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; @@ -849,7 +847,7 @@ public class DefaultBrowseService if ( StringUtils.isNotBlank( path ) ) { // zip entry of the path -> path must a real file entry of the archive - StorageUtil.PathInformation pathInfo = StorageUtil.getAssetDataAsPath(file); + FsStorageUtil.PathInformation pathInfo = FsStorageUtil.getAssetDataAsPath(file); JarFile jarFile = new JarFile( pathInfo.getPath().toFile()); ZipEntry zipEntry = jarFile.getEntry( path ); try (InputStream inputStream = jarFile.getInputStream( zipEntry )) @@ -1180,7 +1178,7 @@ public class DefaultBrowseService filterDepth++; } - StorageUtil.PathInformation pathInfo = StorageUtil.getAssetDataAsPath(file); + FsStorageUtil.PathInformation pathInfo = FsStorageUtil.getAssetDataAsPath(file); JarFile jarFile = new JarFile(pathInfo.getPath().toFile()); try { diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java index c313cd9d7..0dcaee681 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java @@ -51,9 +51,9 @@ import org.apache.archiva.repository.RepositoryException; import org.apache.archiva.repository.RepositoryNotFoundException; import org.apache.archiva.repository.RepositoryRegistry; import org.apache.archiva.repository.RepositoryType; +import org.apache.archiva.repository.storage.FsStorageUtil; import org.apache.archiva.repository.storage.RepositoryStorage; import org.apache.archiva.repository.storage.StorageAsset; -import org.apache.archiva.repository.storage.StorageUtil; import org.apache.archiva.metadata.audit.RepositoryListener; import org.apache.archiva.repository.metadata.base.MetadataTools; import org.apache.archiva.repository.metadata.RepositoryMetadataException; @@ -528,7 +528,7 @@ public class DefaultRepositoriesService throws IOException { - StorageUtil.copyAsset( sourceFile, targetPath, true ); + FsStorageUtil.copyAsset( sourceFile, targetPath, true ); if ( fixChecksums ) { fixChecksums( targetPath ); diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/ArtifactBuilder.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/ArtifactBuilder.java index 2c6db17bf..76d3292a8 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/ArtifactBuilder.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/ArtifactBuilder.java @@ -24,10 +24,8 @@ import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet; import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.storage.StorageAsset; -import org.apache.archiva.repository.storage.StorageUtil; -import org.apache.commons.io.FilenameUtils; +import org.apache.archiva.repository.storage.util.StorageUtil; -import java.nio.file.Path; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.util.Locale; diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/util/IndexWriter.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/util/IndexWriter.java index f224c49da..415a01f1a 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/util/IndexWriter.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/util/IndexWriter.java @@ -168,7 +168,7 @@ public class IndexWriter SortedMap<String, StorageAsset> uniqueChildFiles = new TreeMap<>(); for ( StorageAsset resource : repositoryAssets ) { - List<StorageAsset> files = resource.list(); + List<? extends StorageAsset> files = resource.list(); for ( StorageAsset file : files ) { // the first entry wins |