]> source.dussan.org Git - archiva.git/commitdiff
Changing visibility of utility method
authorMartin Stockhammer <martin_s@apache.org>
Sat, 29 Feb 2020 18:02:27 +0000 (19:02 +0100)
committerMartin Stockhammer <martin_s@apache.org>
Sat, 29 Feb 2020 18:02:27 +0000 (19:02 +0100)
archiva-modules/archiva-base/archiva-storage-api/src/main/java/org/apache/archiva/repository/storage/util/StorageUtil.java
archiva-modules/archiva-base/archiva-storage-fs/src/main/java/org/apache/archiva/repository/storage/FsStorageUtil.java

index f8c5745f1ee2794319d5824338a0c38ebc2b75fb..fa637c66930976cab3b63196a9de869de49e3535 100644 (file)
@@ -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) {
index a0094407c4022581821ab6e0aac323923595af03..50eacac3134f0664748b8e90d11b15e6306d78b1 100644 (file)
@@ -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()) {