Class FileUtils
- java.lang.Object
- org.springframework.boot.loader.tools.FileUtils
Constructor Summary
Constructors Constructor Description FileUtils()
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
removeDuplicatesFromOutputDirectory(File outputDirectory, File originDirectory)
Utility to remove duplicate files from an "output" directory if they already exist in an "origin".static String
sha1Hash(File file)
Generate a SHA.1 Hash for a given file.
Constructor Detail
FileUtils
public FileUtils()
Method Detail
removeDuplicatesFromOutputDirectory
public static void removeDuplicatesFromOutputDirectory(File outputDirectory, File originDirectory)
Utility to remove duplicate files from an "output" directory if they already exist in an "origin". Recursively scans the origin directory looking for files (not directories) that exist in both places and deleting the copy.- Parameters:
outputDirectory
- the output directoryoriginDirectory
- the origin directory
sha1Hash
public static String sha1Hash(File file) throws IOException
Generate a SHA.1 Hash for a given file.- Parameters:
file
- the file to hash- Returns:
- the hash value as a String
- Throws:
IOException
- if the file cannot be read