|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dsto.dfc.util.Files
public final class Files
General file utilities
Method Summary | |
---|---|
static File |
addDefaultExtension(File file,
String extension)
Add a default extension to a file if it does not already have one. |
static String |
addDefaultExtension(String file,
String extension)
|
static void |
copyFile(File srcFile,
File trgFile)
Copy one file to another. |
static void |
copyFile(String srcFile,
String trgFile)
Copy one file to another. |
static String |
getExtension(File file)
Get the extension from a file's name. |
static String |
getExtension(String name)
|
static String |
readScriptLine(Reader input)
Read the next line from a "script-like stream", where script-like streams are line-oriented text streams with "#" comments and \ as a line-continuation operator, similar to Bourne shell scripts and Java .property files. |
static String |
readString(Reader reader)
Read all of the content supplied by a Reader into a String. |
static StringBuilder |
readStringBuilder(Reader reader)
Read all of the content supplied by a Reader into a StringBuilder. |
static String |
removeExtension(File file)
|
static String |
removeExtension(String fileName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static String getExtension(File file)
file
- The file to examine.
public static String getExtension(String name)
public static String removeExtension(File file)
public static String removeExtension(String fileName)
public static File addDefaultExtension(File file, String extension)
file
- The file to examine.extension
- The extension to add.
public static String addDefaultExtension(String file, String extension)
public static void copyFile(File srcFile, File trgFile) throws IOException
IOException
copyFile(String, String)
public static void copyFile(String srcFile, String trgFile) throws IOException
srcFile
- The source file.trgFile
- The target file.
IOException
- if an error occurs.public static String readString(Reader reader) throws IOException
reader
- The reader.
IOException
- if an error occurs while reading.readStringBuilder(Reader)
public static StringBuilder readStringBuilder(Reader reader) throws IOException
reader
- The reader.
IOException
- if an error occurs while reading.public static String readScriptLine(Reader input) throws IOException
input
- The input stream.
IOException
- if an error occurs reading the stream.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |