public class FileHelper
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static int |
buffer_size
The size of the buffer for the copy of the file.
|
| Constructor and Description |
|---|
FileHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
copyDirectory(java.io.File inDir,
java.io.File outDir)
Copy the files and subdirectories from the input directory to the output directory.
|
static void |
copyFile(java.io.File in,
java.io.File out)
Copy a file from in file to the out file.
|
protected static long |
getFreeSpace(java.io.File path)
Get the free space where the path points to.
|
static boolean |
hasCapacity(java.io.File path,
long size)
The function checks if there is enoug capacity to store a file of the given size.
|
static void |
main(java.lang.String[] args) |
static void |
setVerbose(boolean verb)
Set the verbose flag.
|
protected static int buffer_size
public static boolean hasCapacity(java.io.File path,
long size)
path - the path where to store the file.size - the size of the fileprotected static long getFreeSpace(java.io.File path)
path - the devicepublic static void setVerbose(boolean verb)
verb - the new verbose flag, true the verbose is activ.public static void copyFile(java.io.File in,
java.io.File out)
throws java.io.IOException
in - the source file.out - the destination file.java.lang.Exception - any occurring exception.java.io.IOExceptionpublic static void copyDirectory(java.io.File inDir,
java.io.File outDir)
throws java.lang.Exception
inDir - the input directoryoutDir - the output directory.java.lang.Exception - anny occurring exceptionpublic static void main(java.lang.String[] args)