diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/DefaultFileUploadService.java b/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/DefaultFileUploadService.java index f9ca3d0d1..95712a891 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/DefaultFileUploadService.java +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/DefaultFileUploadService.java @@ -180,7 +180,8 @@ public class DefaultFileUploadService { File file = new File( SystemUtils.getJavaIoTmpDir(), fileName ); log.debug( "delete file:{},exists:{}", file.getPath(), file.exists() ); - boolean removed = getSessionFileMetadatas().remove( new FileMetadata( fileName ) ); + boolean removed = getSessionFileMetadatas().remove( + new FileMetadata( SystemUtils.getJavaIoTmpDir().getPath() + "/" + fileName ) ); if ( file.exists() ) { return file.delete(); @@ -194,7 +195,7 @@ public class DefaultFileUploadService List fileMetadatas = new ArrayList( getSessionFileMetadatas() ); for ( FileMetadata fileMetadata : fileMetadatas ) { - deleteFile( fileMetadata.getServerFileName() ); + deleteFile( new File( fileMetadata.getServerFileName() ).getName() ); } return Boolean.TRUE; }