@@ -775,14 +775,6 @@ private void saveChangesToZip(Map<String, ZipEntry> updatedZipEntries, Map<Strin
775775 private File getNewOutputFile () throws WLSDeployArchiveIOException {
776776 final String METHOD = "getNewOutputFile" ;
777777
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 );
786778
787779 File directory = getFile ().getParentFile ();
788780 File newOutputFile ;
@@ -791,7 +783,18 @@ private File getNewOutputFile() throws WLSDeployArchiveIOException {
791783 newOutputFile = getFile ();
792784 LOGGER .finest ("WLSDPLY-01523" , newOutputFile .getAbsolutePath ());
793785 } 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 );
795798 LOGGER .finest ("WLSDPLY-01524" , newOutputFile .getAbsolutePath ());
796799 }
797800 LOGGER .finer ("WLSDPLY-01525" , getFileName (), newOutputFile .getAbsolutePath ());
0 commit comments