|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gridbus.broker.util.FileOpsUtil
public class FileOpsUtil
This class has utility methods for operations such as finding and replacing specific strings / lines in a file.
| Constructor Summary | |
|---|---|
FileOpsUtil()
|
|
| Method Summary | |
|---|---|
static void |
copyFile(java.lang.String source,
java.lang.String destination,
boolean overwrite)
|
static java.lang.String |
findParaminFile(java.lang.String filename,
java.lang.String param)
Returns the complete line which contains the string 'param' in the file 'filename', or null if the param is not found in the file |
static void |
replaceParaminFile(java.lang.String oldfile,
java.lang.String oldline,
java.lang.String newfile,
java.lang.String newline)
Replaces the complete line 'oldline' in the 'oldfile' with the 'newline' in the 'newfile' or null if the param is not found in the file |
static java.lang.String |
replaceString(java.lang.String str,
java.lang.String pattern,
java.lang.String replace)
Replaces the string pattern in an input string with another string |
static void |
writeToFile(java.lang.String filename,
java.lang.String content,
boolean append)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileOpsUtil()
| Method Detail |
|---|
public static java.lang.String findParaminFile(java.lang.String filename,
java.lang.String param)
throws java.io.FileNotFoundException,
java.io.IOException
filename - param -
java.io.FileNotFoundException
java.io.IOException
public static void writeToFile(java.lang.String filename,
java.lang.String content,
boolean append)
throws java.lang.Exception
filename - content - append -
java.lang.Exception
public static void replaceParaminFile(java.lang.String oldfile,
java.lang.String oldline,
java.lang.String newfile,
java.lang.String newline)
throws java.io.FileNotFoundException,
java.io.IOException
oldfile - : file to searcholdline - : line to search fornewfile - : new file to be written outnewline - : new line which will replace the old line
java.io.FileNotFoundException
java.io.IOException
public static java.lang.String replaceString(java.lang.String str,
java.lang.String pattern,
java.lang.String replace)
str - : string to searchpattern - : pattern to search forreplace - : string which will replace the pattern
public static void copyFile(java.lang.String source,
java.lang.String destination,
boolean overwrite)
source - destination - overwrite -
|
Copyright © The University of Melbourne. 2006 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||