org.objectweb.telosys.util
Class FileUtil

java.lang.Object
  extended byorg.objectweb.telosys.util.FileUtil

public class FileUtil
extends java.lang.Object

Utility class for FILE operations ( set of static methods )


Method Summary
static void copy(java.lang.String sInputFileName, java.lang.String sOutputFileName)
          Copy a file into another one
static boolean delete(java.lang.String sFileName)
          Delete a file (and only a file)
static boolean exists(java.lang.String sFileName)
          Checks the existence of a file
static boolean isFile(java.lang.String sFileName)
          Deprecated. use "exists" instead
static byte[] load(java.lang.String sFileName)
          Load a file content in memory
static void save(java.lang.String sFileName, byte[] content)
          Save a memory content in a file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

save

public static void save(java.lang.String sFileName,
                        byte[] content)
                 throws TelosysException
Save a memory content in a file

Parameters:
sFileName -
content -
Throws:
TelosysException

load

public static byte[] load(java.lang.String sFileName)
                   throws TelosysException
Load a file content in memory

Parameters:
sFileName -
Returns:
file content or null if the file doesn't exist
Throws:
TelosysException

copy

public static void copy(java.lang.String sInputFileName,
                        java.lang.String sOutputFileName)
                 throws TelosysException
Copy a file into another one

Parameters:
sInputFileName -
sOutputFileName -
Throws:
TelosysException

delete

public static boolean delete(java.lang.String sFileName)
                      throws TelosysException
Delete a file (and only a file)

Parameters:
sFileName - the full name of the file to delete
Returns:
true if and only if the file or directory is successfully deleted; false otherwise
Throws:
TelosysException - if the given filename is not a 'normal file' ( directory or other )

exists

public static boolean exists(java.lang.String sFileName)
Checks the existence of a file

Parameters:
sFileName -
Returns:
true if the file exists and is realy a file (not a directory)
Since:
v 1.1.0

isFile

public static boolean isFile(java.lang.String sFileName)
Deprecated. use "exists" instead

Test if the given filename exist and is realy a 'normal file'

Parameters:
sFileName -
Returns:
true if the file exists, false if it is a directory or if it doesn't exist