|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.airavata.common.utils.IOUtil
public class IOUtil
| Constructor Summary | |
|---|---|
IOUtil()
|
|
| Method Summary | |
|---|---|
static boolean |
deleteDirectory(File path)
|
static String |
getExtension(File file)
Gets the extension of a specified file. |
static String |
readFileToString(File file)
Returns the content of a specified file as a String. |
static String |
readFileToString(String path)
Returns the content of a specified file as a String. |
static byte[] |
readToByteArray(File file)
|
static byte[] |
readToByteArray(InputStream inputStream)
|
static String |
readToString(InputStream stream)
Returns a String read from a specified InputStream. |
static String |
readToString(Reader reader)
Returns a String read from a specified Reader. |
static void |
writeToFile(InputStream inputStream,
File file)
|
static void |
writeToFile(String content,
File file)
|
static void |
writeToFile(String content,
String path)
|
static void |
writeToWriter(String content,
Writer writer)
Writes a specified String to a specified Writer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IOUtil()
| Method Detail |
|---|
public static void writeToFile(String content,
String path)
throws IOException
path - content -
IOException
public static void writeToFile(String content,
File file)
throws IOException
content - file -
IOException
public static void writeToFile(InputStream inputStream,
File file)
throws IOException
inputStream - file -
IOException
public static void writeToWriter(String content,
Writer writer)
throws IOException
content - The content to writewriter - The specified Writer
IOException
public static String readFileToString(String path)
throws IOException
path -
IOException
public static String readFileToString(File file)
throws IOException
file -
IOException
public static String readToString(InputStream stream)
throws IOException
stream - The specified InputStream
IOException
public static String readToString(Reader reader)
throws IOException
reader - The specified Reader
IOException
public static byte[] readToByteArray(File file)
throws IOException
file -
IOException
public static byte[] readToByteArray(InputStream inputStream)
throws IOException
inputStream -
IOExceptionpublic static boolean deleteDirectory(File path)
path -
true if and only if the file or directory is successfully deleted; false
otherwisepublic static String getExtension(File file)
file - the specified file.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||