public class RecursiveFileTool
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static int |
COPY_BUFFER_SIZE |
private static int |
EOF |
private static int |
INIT_DEPTH |
private static int |
MAX_DEPTH_IGNORE |
Constructor and Description |
---|
RecursiveFileTool() |
Modifier and Type | Method and Description |
---|---|
static void |
copy(java.io.File src,
java.io.File dest) |
private static void |
copyRecursion(java.io.File src,
java.io.File dest,
int depth,
int maxDepth) |
static void |
copyRecursive(java.io.File src,
java.io.File dest) |
static void |
copyRecursive(java.io.File src,
java.io.File dest,
int maxDepth) |
(package private) static void |
copySingleFile(java.io.File src,
java.io.File dest) |
(package private) static void |
copySingleFile(java.io.InputStream src,
java.io.File dest) |
static byte[] |
createMD5Digest(java.io.File a_file) |
static boolean |
deleteRecursion(java.io.File src) |
static boolean |
equals(java.io.File a_oneFile,
byte[] a_md5HashSecond,
long a_sizeSecond) |
static boolean |
equals(java.io.File a_oneFile,
java.io.File a_otherFile,
boolean a_doHashComparison)
Compares two files.
|
static long |
getFileSize(java.io.File a_file) |
static java.io.File |
readFileName(java.lang.String a_fileName) |
private static final int INIT_DEPTH
private static final int MAX_DEPTH_IGNORE
private static final int COPY_BUFFER_SIZE
private static final int EOF
public static java.io.File readFileName(java.lang.String a_fileName)
public static void copy(java.io.File src, java.io.File dest)
public static void copyRecursive(java.io.File src, java.io.File dest)
public static void copyRecursive(java.io.File src, java.io.File dest, int maxDepth)
private static void copyRecursion(java.io.File src, java.io.File dest, int depth, int maxDepth)
static void copySingleFile(java.io.File src, java.io.File dest) throws java.io.IOException
java.io.IOException
public static boolean deleteRecursion(java.io.File src)
static void copySingleFile(java.io.InputStream src, java.io.File dest) throws java.io.IOException
java.io.IOException
public static boolean equals(java.io.File a_oneFile, byte[] a_md5HashSecond, long a_sizeSecond)
public static boolean equals(java.io.File a_oneFile, java.io.File a_otherFile, boolean a_doHashComparison)
a_oneFile
- a_otherFile
- a_hashComparison
- if true, the MD5 hashes of the two files are compared if they seem to
be equal after a quick check; false otherwisepublic static long getFileSize(java.io.File a_file) throws java.lang.SecurityException
java.lang.SecurityException
public static byte[] createMD5Digest(java.io.File a_file) throws java.io.IOException, java.lang.SecurityException
java.io.IOException
java.lang.SecurityException
Copyright © 2023. All rights reserved.