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-web/archiva-web-common | |
parent | ec1e655c9d996f20bd231b21505a6df865d8a1f7 (diff) | |
download | archiva-65bcbc9d45b654b66a188c69b55cec2e00037268.tar.gz archiva-65bcbc9d45b654b66a188c69b55cec2e00037268.zip |
do the same as FileUtils.copyFile do
Diffstat (limited to 'archiva-modules/archiva-web/archiva-web-common')
-rw-r--r-- | archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultFileUploadService.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultFileUploadService.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultFileUploadService.java index c232e03fa..1719a7188 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultFileUploadService.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultFileUploadService.java @@ -70,6 +70,7 @@ import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; import java.nio.file.Files; +import java.nio.file.StandardCopyOption; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -577,7 +578,8 @@ public class DefaultFileUploadService throws IOException { - Files.copy( sourceFile.toPath(), new File( targetPath, targetFilename ).toPath() ); + Files.copy( sourceFile.toPath(), new File( targetPath, targetFilename ).toPath(), StandardCopyOption.REPLACE_EXISTING, + StandardCopyOption.COPY_ATTRIBUTES ); if ( fixChecksums ) { |