aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base
diff options
context:
space:
mode:
authorMartin Stockhammer <martin_s@apache.org>2020-02-29 19:02:27 +0100
committerMartin Stockhammer <martin_s@apache.org>2020-02-29 19:02:27 +0100
commit7ddf0265ee0e6ba67b5fc34432250eb971bb9f5a (patch)
tree1e867b02ce6545d87a60bfe9c30a25d6b954d54d /archiva-modules/archiva-base
parent24aba5ac73da0ad83caf43ce606f07cd57bc2891 (diff)
downloadarchiva-7ddf0265ee0e6ba67b5fc34432250eb971bb9f5a.tar.gz
archiva-7ddf0265ee0e6ba67b5fc34432250eb971bb9f5a.zip
Changing visibility of utility method
Diffstat (limited to 'archiva-modules/archiva-base')
-rw-r--r--archiva-modules/archiva-base/archiva-storage-api/src/main/java/org/apache/archiva/repository/storage/util/StorageUtil.java2
-rw-r--r--archiva-modules/archiva-base/archiva-storage-fs/src/main/java/org/apache/archiva/repository/storage/FsStorageUtil.java12
2 files changed, 12 insertions, 2 deletions
diff --git a/archiva-modules/archiva-base/archiva-storage-api/src/main/java/org/apache/archiva/repository/storage/util/StorageUtil.java b/archiva-modules/archiva-base/archiva-storage-api/src/main/java/org/apache/archiva/repository/storage/util/StorageUtil.java
index f8c5745f1..fa637c669 100644
--- a/archiva-modules/archiva-base/archiva-storage-api/src/main/java/org/apache/archiva/repository/storage/util/StorageUtil.java
+++ b/archiva-modules/archiva-base/archiva-storage-api/src/main/java/org/apache/archiva/repository/storage/util/StorageUtil.java
@@ -214,7 +214,7 @@ public class StorageUtil
}
- public static final void wrapWriteFunction( ReadableByteChannel is, RepositoryStorage targetStorage, StorageAsset target, boolean locked) {
+ private static final void wrapWriteFunction( ReadableByteChannel is, RepositoryStorage targetStorage, StorageAsset target, boolean locked) {
try {
targetStorage.writeDataToChannel( target, os -> copy(is, os), locked );
} catch (Exception e) {
diff --git a/archiva-modules/archiva-base/archiva-storage-fs/src/main/java/org/apache/archiva/repository/storage/FsStorageUtil.java b/archiva-modules/archiva-base/archiva-storage-fs/src/main/java/org/apache/archiva/repository/storage/FsStorageUtil.java
index a0094407c..50eacac31 100644
--- a/archiva-modules/archiva-base/archiva-storage-fs/src/main/java/org/apache/archiva/repository/storage/FsStorageUtil.java
+++ b/archiva-modules/archiva-base/archiva-storage-fs/src/main/java/org/apache/archiva/repository/storage/FsStorageUtil.java
@@ -22,11 +22,13 @@ package org.apache.archiva.repository.storage;
import org.apache.archiva.common.filelock.FileLockException;
import org.apache.archiva.common.filelock.FileLockManager;
import org.apache.archiva.common.filelock.Lock;
+import org.apache.archiva.repository.storage.util.StorageUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.nio.channels.FileChannel;
+import java.nio.channels.ReadableByteChannel;
import java.nio.file.*;
import java.util.HashSet;
@@ -104,7 +106,7 @@ public class FsStorageUtil
try {
final RepositoryStorage sourceStorage = source.getStorage();
final RepositoryStorage targetStorage = target.getStorage();
- sourceStorage.consumeDataFromChannel( source, is -> org.apache.archiva.repository.storage.util.StorageUtil.wrapWriteFunction( is, targetStorage, target, locked ), locked);
+ sourceStorage.consumeDataFromChannel( source, is -> wrapWriteFunction( is, targetStorage, target, locked ), locked);
} catch (IOException e) {
throw e;
} catch (Throwable e) {
@@ -119,6 +121,14 @@ public class FsStorageUtil
}
}
+ private static final void wrapWriteFunction( ReadableByteChannel is, RepositoryStorage targetStorage, StorageAsset target, boolean locked) {
+ try {
+ targetStorage.writeDataToChannel( target, os -> StorageUtil.copy(is, os), locked );
+ } catch (Exception e) {
+ throw new RuntimeException( e );
+ }
+ }
+
public static final void copyToLocalFile(StorageAsset asset, Path destination, CopyOption... copyOptions) throws IOException {
if (asset.isFileBased()) {