diff options
author | Olivier Lamy <olamy@apache.org> | 2014-04-16 19:48:53 +1000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2014-04-16 19:48:53 +1000 |
commit | 65bcbc9d45b654b66a188c69b55cec2e00037268 (patch) | |
tree | e05b1f32c62c2385f621bb85549ce4951841fa1d /archiva-modules/archiva-base/archiva-filelock/src | |
parent | ec1e655c9d996f20bd231b21505a6df865d8a1f7 (diff) | |
download | archiva-65bcbc9d45b654b66a188c69b55cec2e00037268.tar.gz archiva-65bcbc9d45b654b66a188c69b55cec2e00037268.zip |
do the same as FileUtils.copyFile do
Diffstat (limited to 'archiva-modules/archiva-base/archiva-filelock/src')
-rw-r--r-- | archiva-modules/archiva-base/archiva-filelock/src/test/java/org/apache/archiva/common/filelock/DefaultFileLockManagerTest.java | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/archiva-modules/archiva-base/archiva-filelock/src/test/java/org/apache/archiva/common/filelock/DefaultFileLockManagerTest.java b/archiva-modules/archiva-base/archiva-filelock/src/test/java/org/apache/archiva/common/filelock/DefaultFileLockManagerTest.java index e72704e35..cc63e0c3a 100644 --- a/archiva-modules/archiva-base/archiva-filelock/src/test/java/org/apache/archiva/common/filelock/DefaultFileLockManagerTest.java +++ b/archiva-modules/archiva-base/archiva-filelock/src/test/java/org/apache/archiva/common/filelock/DefaultFileLockManagerTest.java @@ -37,6 +37,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; import java.util.concurrent.atomic.AtomicInteger; //import org.apache.commons.io.IOUtils; @@ -90,7 +91,8 @@ public class DefaultFileLockManagerTest try { lock.getFile().delete(); - Files.copy( largeJar.toPath(), lock.getFile().toPath() ); + Files.copy( largeJar.toPath(), lock.getFile().toPath(), StandardCopyOption.REPLACE_EXISTING, + StandardCopyOption.COPY_ATTRIBUTES ); } finally { @@ -108,7 +110,8 @@ public class DefaultFileLockManagerTest try { lock.getFile().delete(); - Files.copy( largeJar.toPath(), lock.getFile().toPath() ); + Files.copy( largeJar.toPath(), lock.getFile().toPath(), StandardCopyOption.REPLACE_EXISTING, + StandardCopyOption.COPY_ATTRIBUTES ); } finally { @@ -144,7 +147,8 @@ public class DefaultFileLockManagerTest try { lock.getFile().delete(); - Files.copy( largeJar.toPath(), lock.getFile().toPath() ); + Files.copy( largeJar.toPath(), lock.getFile().toPath(), StandardCopyOption.REPLACE_EXISTING, + StandardCopyOption.COPY_ATTRIBUTES ); } finally { @@ -162,7 +166,8 @@ public class DefaultFileLockManagerTest try { lock.getFile().delete(); - Files.copy( largeJar.toPath(), lock.getFile().toPath() ); + Files.copy( largeJar.toPath(), lock.getFile().toPath(), StandardCopyOption.REPLACE_EXISTING, + StandardCopyOption.COPY_ATTRIBUTES ); } finally { @@ -179,8 +184,7 @@ public class DefaultFileLockManagerTest Lock lock = fileLockManager.readFileLock( this.file ); try { - Files.copy( lock.getFile().toPath(), - new FileOutputStream( File.createTempFile( "foo", ".jar" ) ) ); + Files.copy( lock.getFile().toPath(), new FileOutputStream( File.createTempFile( "foo", ".jar" ) ) ); } finally { @@ -198,7 +202,8 @@ public class DefaultFileLockManagerTest try { lock.getFile().delete(); - Files.copy( largeJar.toPath(), lock.getFile().toPath() ); + Files.copy( largeJar.toPath(), lock.getFile().toPath(), StandardCopyOption.REPLACE_EXISTING, + StandardCopyOption.COPY_ATTRIBUTES ); } finally { @@ -233,7 +238,8 @@ public class DefaultFileLockManagerTest try { lock.getFile().delete(); - Files.copy( largeJar.toPath(), lock.getFile().toPath() ); + Files.copy( largeJar.toPath(), lock.getFile().toPath(), StandardCopyOption.REPLACE_EXISTING, + StandardCopyOption.COPY_ATTRIBUTES ); } finally { @@ -250,8 +256,7 @@ public class DefaultFileLockManagerTest Lock lock = fileLockManager.readFileLock( this.file ); try { - Files.copy( lock.getFile().toPath(), - new FileOutputStream( File.createTempFile( "foo", ".jar" ) ) ); + Files.copy( lock.getFile().toPath(), new FileOutputStream( File.createTempFile( "foo", ".jar" ) ) ); } finally { |