|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.util.FileUtils
public class FileUtils
Utility class used for file manipulation operations.
Constructor Summary | |
---|---|
FileUtils()
|
Method Summary | |
---|---|
static void |
delete(java.io.File file)
Simply calls the delete() method of the provided file object. |
static void |
delete(java.io.File file,
Log log)
Simply calls the delete() method of the provided file object. |
static void |
delete(java.lang.String path)
Simply calls the delete() method of the provided file object. |
static void |
delete(java.lang.String path,
Log log)
Simply calls the delete() method of the provided file object. |
static java.lang.String |
loadFile(java.io.File file)
Loads the specified file and returns its content as String. |
static java.lang.String |
loadFile(java.io.File file,
java.lang.String encoding)
Loads the specified file and returns its content as String. |
static java.lang.String |
loadFile(java.lang.String file)
Loads the specified file and returns its content as String. |
static void |
mkdir(java.io.File file)
Simply calls the mkdir() method of the provided file object. |
static void |
mkdir(java.io.File file,
Log log)
Simply calls the mkdir() method of the provided file object. |
static void |
mkdir(java.lang.String path)
Simply calls the mkdir() method of the provided file object. |
static void |
mkdir(java.lang.String path,
Log log)
Simply calls the mkdir() method of the provided file object. |
static void |
mkdirs(java.io.File file)
Simply calls the mkdirs() method of the provided file object. |
static void |
mkdirs(java.io.File file,
Log log)
Simply calls the mkdirs() method of the provided file object. |
static void |
mkdirs(java.lang.String path)
Simply calls the mkdirs() method of the provided file object. |
static void |
mkdirs(java.lang.String path,
Log log)
Simply calls the mkdirs() method of the provided file object. |
static byte[] |
readInputStream(java.io.InputStream is)
Reads the provided input stream and returns it as an array of bytes. |
static void |
renameTo(java.io.File from,
java.io.File to)
Simply calls the renameTo() method of the provided file object. |
static void |
renameTo(java.io.File from,
java.io.File to,
Log log)
Simply calls the renameTo() method of the provided file object. |
static void |
renameTo(java.lang.String from,
java.lang.String to)
Simply calls the renameTo() method of the provided file object. |
static void |
renameTo(java.lang.String from,
java.lang.String to,
Log log)
Simply calls the renameTo() method of the provided file object. |
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 java.lang.String loadFile(java.lang.String file) throws java.lang.Exception
file
- the path to the file to load.
java.lang.Exception
- if an I/O error occurs.public static java.lang.String loadFile(java.io.File file) throws java.lang.Exception
file
- the file to load.
java.lang.Exception
- if an I/O error occurs.public static java.lang.String loadFile(java.io.File file, java.lang.String encoding) throws java.lang.Exception
file
- the file to load.encoding
- the name of the encoding to use, if this is null the platform
default encoding will be used.
java.lang.Exception
- if an I/O error occurs.public static byte[] readInputStream(java.io.InputStream is) throws java.io.IOException
InputStream
object.
is
- the input stream to read
java.io.IOException
- if reading error occurs.public static void delete(java.io.File file, Log log)
file
- the file to deletelog
-
java.lang.IllegalArgumentException
- -
if either of the parameters is null or the specified file
does not exists.
java.lang.SecurityException
- if the file could not be deleted.public static void delete(java.lang.String path, Log log)
path
- the file to deletelog
-
java.lang.IllegalArgumentException
- -
if either of the parameters is null.
java.lang.SecurityException
- if the file could not be deleted.
java.lang.NullPointerException
- if the provided path argument is null.public static void mkdirs(java.io.File file, Log log)
file
- the directory to createlog
-
java.lang.IllegalArgumentException
- -
if either of the parameters is null
java.lang.SecurityException
- if the directories could not be createdpublic static void mkdirs(java.lang.String path, Log log)
path
- the directory to createlog
-
java.lang.IllegalArgumentException
- -
if either of the parameters is null.
java.lang.SecurityException
- if the directories could not be created
java.lang.NullPointerException
- if the provided path argument is null.public static void mkdir(java.io.File file, Log log)
file
- the directory to createlog
-
java.lang.IllegalArgumentException
- -
if either of the parameters is null
java.lang.SecurityException
- if the directories could not be createdpublic static void mkdir(java.lang.String path, Log log)
path
- the directory to createlog
-
java.lang.IllegalArgumentException
- -
if either of the parameters is null.
java.lang.SecurityException
- if the directory could not be created
java.lang.NullPointerException
- if the provided path argument is null.public static void renameTo(java.io.File from, java.io.File to, Log log)
from
- the file to renameto
- the name of the file to setlog
-
java.lang.IllegalArgumentException
- -
if either of the parameters is null or the specified file
does not renamed.
java.lang.SecurityException
- if the file could not be deleted.public static void renameTo(java.lang.String from, java.lang.String to, Log log)
from
- the file to renameto
- the name of the file to setlog
-
java.lang.IllegalArgumentException
- -
if either of the parameters is null.
java.lang.SecurityException
- if the file could not be renamed.
java.lang.NullPointerException
- if the provided path argument is null.public static void delete(java.io.File file) throws java.lang.Exception
file
- the file to delete
java.lang.Exception
- if the file cannot be deleted.
java.lang.IllegalArgumentException
- -
if either of the parameters is null or the specified file
does not exists.
java.lang.SecurityException
- if the file could not be deleted.public static void delete(java.lang.String path) throws java.lang.Exception
path
- the file to delete
java.lang.Exception
- if the file could not be deleted.
java.lang.IllegalArgumentException
- -
if either of the parameters is null.
java.lang.SecurityException
- if the file could not be deleted.
java.lang.NullPointerException
- if the provided path argument is null.public static void mkdirs(java.io.File file) throws java.lang.Exception
file
- the directory to create
java.lang.Exception
- if the directories could not be created.
java.lang.IllegalArgumentException
- -
if either of the parameters is null
java.lang.SecurityException
- if the directories could not be createdpublic static void mkdirs(java.lang.String path) throws java.lang.Exception
path
- the directory to create
java.lang.Exception
- if the directories could not be created.
java.lang.IllegalArgumentException
- -
if either of the parameters is null.
java.lang.SecurityException
- if the directories could not be created
java.lang.NullPointerException
- if the provided path argument is null.public static void mkdir(java.io.File file) throws java.lang.Exception
file
- the directory to create
java.lang.Exception
- if the directory could not be created.
java.lang.IllegalArgumentException
- -
if either of the parameters is null
java.lang.SecurityException
- if the directories could not be createdpublic static void mkdir(java.lang.String path) throws java.lang.Exception
path
- the directory to create
java.lang.Exception
java.lang.IllegalArgumentException
- -
if either of the parameters is null.
java.lang.SecurityException
- if the directory could not be created
java.lang.NullPointerException
- if the provided path argument is null.public static void renameTo(java.io.File from, java.io.File to) throws java.lang.Exception
from
- the file to renameto
- the name of the file to set
java.lang.Exception
- if the file could not be renamed.
java.lang.IllegalArgumentException
- -
if either of the parameters is null or the specified file
does not renamed.
java.lang.SecurityException
- if the file could not be renamed.public static void renameTo(java.lang.String from, java.lang.String to) throws java.lang.Exception
from
- the file to renameto
- the name of the file to set
java.lang.Exception
- if the file could not be renamed.
java.lang.IllegalArgumentException
- -
if either of the parameters is null.
java.lang.SecurityException
- if the file could not be renamed.
java.lang.NullPointerException
- if the provided path argument is null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |