]> source.dussan.org Git - archiva.git/commitdiff
take care about using full file path on delete
authorOlivier Lamy <olamy@apache.org>
Mon, 2 Apr 2012 07:21:06 +0000 (07:21 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 2 Apr 2012 07:21:06 +0000 (07:21 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1308259 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/DefaultFileUploadService.java

index f9ca3d0d185825cc47df58fc5b81dbc22ec2293f..95712a8918278da847281ecf1af0bdb5ef240cef 100644 (file)
@@ -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<FileMetadata> fileMetadatas = new ArrayList( getSessionFileMetadatas() );
         for ( FileMetadata fileMetadata : fileMetadatas )
         {
-            deleteFile( fileMetadata.getServerFileName() );
+            deleteFile( new File( fileMetadata.getServerFileName() ).getName() );
         }
         return Boolean.TRUE;
     }