Compare commits
No commits in common. "d5c1273e1840b3103631a52ce0980ec7ddda3e9e" and "eda96d5ed223021b32efd6e90e50e908e9ed072b" have entirely different histories.
d5c1273e18
...
eda96d5ed2
@ -20,8 +20,6 @@ import java.io.*;
|
|||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.nio.file.StandardCopyOption;
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
@ -228,6 +226,8 @@ public class Utils {
|
|||||||
"THREAT_DETECTED on File " + file.fileName() + " is infected: " + result.getMessage());
|
"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
|
// File is clean - now we can safely process it
|
||||||
LOGGER.infof("File is clean: %s (size=%d) (contentType=%s)", file.fileName(), file.size(),
|
LOGGER.infof("File is clean: %s (size=%d) (contentType=%s)", file.fileName(), file.size(),
|
||||||
@ -252,10 +252,10 @@ public class Utils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Path f = file.filePath();
|
System.out.println(
|
||||||
System.out.println(f + " -> " + new File(dirFile, id + "." + detectedExtensions[0]));
|
f.exists() + " - " + f + " -> " + new File(dirFile, id + "." + detectedExtensions[0]));
|
||||||
Files.copy(f, new File(dirFile, id + "." + detectedExtensions[0]).toPath(),
|
//noinspection ResultOfMethodCallIgnored
|
||||||
StandardCopyOption.REPLACE_EXISTING);
|
System.out.println(f.renameTo(new File(dirFile, id + "." + detectedExtensions[0])));
|
||||||
return "ok";
|
return "ok";
|
||||||
})));
|
})));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user