fix: change methode for move upload file
All checks were successful
Deploy Production Server / if_merged (pull_request) Successful in 6m59s
All checks were successful
Deploy Production Server / if_merged (pull_request) Successful in 6m59s
This commit is contained in:
parent
e8555f7992
commit
ea17989a82
@ -20,6 +20,8 @@ import java.io.*;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URLConnection;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
@ -226,8 +228,6 @@ public class Utils {
|
||||
"THREAT_DETECTED on File " + file.fileName() + " is infected: " + result.getMessage());
|
||||
}
|
||||
}
|
||||
File f = file.filePath().toFile();
|
||||
System.out.println(f.exists() + " - " + f);
|
||||
|
||||
// File is clean - now we can safely process it
|
||||
LOGGER.infof("File is clean: %s (size=%d) (contentType=%s)", file.fileName(), file.size(),
|
||||
@ -252,10 +252,10 @@ public class Utils {
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println(
|
||||
f.exists() + " - " + f + " -> " + new File(dirFile, id + "." + detectedExtensions[0]));
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
System.out.println(f.renameTo(new File(dirFile, id + "." + detectedExtensions[0])));
|
||||
Path f = file.filePath();
|
||||
System.out.println(f + " -> " + new File(dirFile, id + "." + detectedExtensions[0]));
|
||||
Files.copy(f, new File(dirFile, id + "." + detectedExtensions[0]).toPath(),
|
||||
StandardCopyOption.REPLACE_EXISTING);
|
||||
return "ok";
|
||||
})));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user