Package io.joshworks.snappy.maven.tools
Class FileUtils
- java.lang.Object
-
- io.joshworks.snappy.maven.tools.FileUtils
-
public abstract class FileUtils extends java.lang.ObjectUtilities for manipulating files and directories in Spring Boot tooling.- Author:
- Dave Syer, Phillip Webb
-
-
Constructor Summary
Constructors Constructor Description FileUtils()
-
Method Summary
Modifier and Type Method Description static voidremoveDuplicatesFromOutputDirectory(java.io.File outputDirectory, java.io.File originDirectory)Utility to remove duplicate files from an "output" directory if they already exist in an "origin".static java.lang.Stringsha1Hash(java.io.File file)Generate a SHA.1 Hash for a given file.
-
-
-
Method Detail
-
removeDuplicatesFromOutputDirectory
public static void removeDuplicatesFromOutputDirectory(java.io.File outputDirectory, java.io.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 java.lang.String sha1Hash(java.io.File file) throws java.io.IOExceptionGenerate a SHA.1 Hash for a given file.- Parameters:
file- the file to hash- Returns:
- the hash value as a String
- Throws:
java.io.IOException- if the file cannot be read
-
-