public class ChecksumUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
FOLDER_CHECKSUM_CACHE |
Modifier and Type | Method and Description |
---|---|
static long |
checksum(InputStream is)
Compute a checksum for the file or directory that consists of the name, length and the last modified date
for a file and its children in case of a directory
|
static long |
checksumFile(File file) |
static Map<File,Long> |
loadInstalledChecksumCache(File dir)
If there is a file called
FOLDER_CHECKSUM_CACHE load it where the key is the file name and the value is the checksum |
static void |
saveInstalledChecksumCache(File dir,
Map<File,Long> checksums)
Saves the given checksums into the folder in the
FOLDER_CHECKSUM_CACHE file |
public static final String FOLDER_CHECKSUM_CACHE
public static long checksum(InputStream is) throws IOException
is
- the input streamIOException
public static long checksumFile(File file) throws IOException
IOException
public static Map<File,Long> loadInstalledChecksumCache(File dir)
FOLDER_CHECKSUM_CACHE
load it where the key is the file name and the value is the checksumpublic static void saveInstalledChecksumCache(File dir, Map<File,Long> checksums) throws IOException
FOLDER_CHECKSUM_CACHE
fileIOException
Copyright © 2011–2016 Red Hat. All rights reserved.