-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #680 from IkeVoodoo/master
Attempting to speed up file scanning
- Loading branch information
Showing
4 changed files
with
453 additions
and
393 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
MCAntiMalware-Core/src/main/java/optic_fusion1/antimalware/scanner/ScanHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package optic_fusion1.antimalware.scanner; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
|
||
import static optic_fusion1.antimalware.AntiMalware.LOGGER; | ||
|
||
public final class ScanHelper { | ||
|
||
private ScanHelper() { | ||
|
||
} | ||
|
||
public static boolean isFileEmpty(Path path) { | ||
try { | ||
return Files.size(path) == 0; | ||
} catch (IOException e) { | ||
LOGGER.exception(e); | ||
return false; | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.