@@ -775,14 +775,6 @@ private void saveChangesToZip(Map<String, ZipEntry> updatedZipEntries, Map<Strin
775
775
private File getNewOutputFile () throws WLSDeployArchiveIOException {
776
776
final String METHOD = "getNewOutputFile" ;
777
777
778
- String fileName = getFileName ();
779
- if (fileName .contains (File .separator )) {
780
- int lastSeparator = fileName .lastIndexOf (File .separator );
781
- if (lastSeparator > 0 )
782
- fileName = fileName .substring (lastSeparator +1 );
783
- }
784
-
785
- String [] nameComponents = FileUtils .parseFileName (fileName );
786
778
787
779
File directory = getFile ().getParentFile ();
788
780
File newOutputFile ;
@@ -791,7 +783,18 @@ private File getNewOutputFile() throws WLSDeployArchiveIOException {
791
783
newOutputFile = getFile ();
792
784
LOGGER .finest ("WLSDPLY-01523" , newOutputFile .getAbsolutePath ());
793
785
} else {
794
- newOutputFile = File .createTempFile (nameComponents [0 ], DOT + nameComponents [1 ], directory );
786
+ // Is there a real case the the archive file with no extension ?
787
+ String fileName = getFileName ();
788
+ if (fileName .contains (File .separator )) {
789
+ int lastSeparator = fileName .lastIndexOf (File .separator );
790
+ if (lastSeparator > 0 )
791
+ fileName = fileName .substring (lastSeparator +1 );
792
+ }
793
+ String [] nameComponents = FileUtils .parseFileName (fileName );
794
+
795
+ // prefix shouldn't matter what we put here, but it has to be at least 3 characters
796
+
797
+ newOutputFile = File .createTempFile ("wdt_temparchive" , DOT + nameComponents [1 ], directory );
795
798
LOGGER .finest ("WLSDPLY-01524" , newOutputFile .getAbsolutePath ());
796
799
}
797
800
LOGGER .finer ("WLSDPLY-01525" , getFileName (), newOutputFile .getAbsolutePath ());
0 commit comments