|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectopenr66.protocol.utils.FileUtils
public class FileUtils
File Utils
Constructor Summary | |
---|---|
FileUtils()
|
Method Summary | |
---|---|
static String |
consolidatePath(String base,
String path)
|
static File[] |
copy(File[] from,
File directoryTo,
boolean move)
Copy a group of files to a directory |
static void |
copy(File from,
File to,
boolean move,
boolean append)
Copy one file to another one |
static File |
copyToDir(File from,
File directoryTo,
boolean move)
Copy one file to a directory |
static boolean |
createDir(File directory)
Create the directory associated with the File as path |
static boolean |
delete(File file)
Delete physically the file |
static boolean |
deleteDir(File directory)
Delete the directory associated with the File as path if empty |
static void |
deleteOnExit(File file)
Delete physically the file but when the JVM exits (useful for temporary file) |
static boolean |
deleteRecursiveDir(File directory)
Delete the directory and its subdirs associated with the File as path if empty |
static boolean |
FileExist(String _FileName,
String _Path)
|
static File[] |
getFiles(File directory)
Get the list of files from a given directory |
static File[] |
getFiles(File directory,
FilenameFilter filter)
Get the list of files from a given directory and a filter |
static org.jboss.netty.buffer.ChannelBuffer |
getHash(org.jboss.netty.buffer.ChannelBuffer buffer)
|
static String |
getHash(File f)
Calculates and returns the hash of the contents of the given file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileUtils()
Method Detail |
---|
public static String consolidatePath(String base, String path) throws OpenR66ProtocolSystemException
base
- in absolutepath
- path in absolute or relative
OpenR66ProtocolSystemException
public static void copy(File from, File to, boolean move, boolean append) throws OpenR66ProtocolSystemException
from
- to
- move
- True if the copy is in fact a move operationappend
- True if the copy is in append
OpenR66ProtocolSystemException
public static File[] copy(File[] from, File directoryTo, boolean move) throws OpenR66ProtocolSystemException
from
- directoryTo
- move
- True if the copy is in fact a move operation
OpenR66ProtocolSystemException
public static File copyToDir(File from, File directoryTo, boolean move) throws OpenR66ProtocolSystemException
from
- directoryTo
- move
- True if the copy is in fact a move operation
OpenR66ProtocolSystemException
public static boolean createDir(File directory)
directory
-
public static boolean delete(File file)
file
-
public static boolean deleteDir(File directory)
directory
-
public static void deleteOnExit(File file)
file
- public static boolean deleteRecursiveDir(File directory)
directory
-
public static boolean FileExist(String _FileName, String _Path)
_FileName
- _Path
-
public static File[] getFiles(File directory)
directory
-
public static File[] getFiles(File directory, FilenameFilter filter)
directory
- filter
-
public static String getHash(File f) throws OpenR66ProtocolSystemException
f
- FileInterface to hash
OpenR66ProtocolSystemException
public static org.jboss.netty.buffer.ChannelBuffer getHash(org.jboss.netty.buffer.ChannelBuffer buffer)
buffer
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |