|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.installguru.installer.FileUtilities
This is an utility class to copy files and directories.
| Method Summary | |
static boolean |
changeFileMode(java.io.File file,
java.lang.String octalMode)
Changes the file permissions for user, group and other on the UNIX like aperating systems. |
static void |
copyDirectory(java.io.File source,
java.io.File dest,
boolean create,
boolean recursive)
Copies a directory. |
static void |
copyDirectory(java.io.File source,
java.io.File dest,
boolean create,
boolean recursive,
boolean uninstall)
Copies a directory. |
static void |
copyDirectory(java.io.File source,
java.io.File dest,
java.io.FileFilter filter,
boolean create,
boolean recursive)
Copies a directory. |
static void |
copyFile(java.io.File source,
java.io.File dest)
Copies a file. |
static void |
copyFile(java.io.InputStream in,
java.io.OutputStream out)
Copies a file. |
static void |
deleteDirectory(java.io.File dir,
boolean recursive)
Copies a directory. |
static void |
replaceString(java.io.File file,
java.lang.String oldStr,
java.lang.String newStr,
boolean allOccurances)
Replaces one or more occurances of a string with a new string in a file. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static void copyFile(java.io.File source,
java.io.File dest)
throws java.io.IOException
source - Source file to be copied.dest - destination file.java.io.IOException -
public static void copyFile(java.io.InputStream in,
java.io.OutputStream out)
throws java.io.IOException
in - Source file stream to be copied.out - destination file stream.java.io.IOException -
public static void copyDirectory(java.io.File source,
java.io.File dest,
boolean create,
boolean recursive,
boolean uninstall)
throws java.io.IOException
source - Source directory to be copied.dest - destination directory.create - If true creates the destination directory if not already exists.recursive - If true recursively copies all the sub-directories.uninstall - If true marks the file for uninstall.java.io.IOException -
public static void copyDirectory(java.io.File source,
java.io.File dest,
boolean create,
boolean recursive)
throws java.io.IOException
source - Source directory to be copied.dest - destination directory.create - If true creates the destination directory if not already exists.recursive - If true recursively copies all the sub-directories.java.io.IOException -
public static void copyDirectory(java.io.File source,
java.io.File dest,
java.io.FileFilter filter,
boolean create,
boolean recursive)
throws java.io.IOException
source - Source directory to be copied.dest - destination directory.filter - filters the files to be copied.create - If true creates the destination directory if not already exists.recursive - If true recursively copies all the sub-directories.java.io.IOException -
public static void deleteDirectory(java.io.File dir,
boolean recursive)
dir - Directory to be deleted.recursive - If true recursively deletes all the files and sub-directories.java.io.IOException -
public static boolean changeFileMode(java.io.File file,
java.lang.String octalMode)
file - Target file.octalMode - Octal string representing the file permission.
For Example: 755 represents rwer-er-e permission.
public static void replaceString(java.io.File file,
java.lang.String oldStr,
java.lang.String newStr,
boolean allOccurances)
throws java.io.IOException
file - file to search for.oldStr - Old string to be replaced.newStr - New replacement string.allOccurances - If true replaces all occurances of the oldStr or only first occurancejava.io.IOException -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||