org.eclipse.swtbot.swt.finder.utils
Class FileUtils
java.lang.Object
org.eclipse.swtbot.swt.finder.utils.FileUtils
public class FileUtils
- extends Object
Provides utilities to read and write to files.
- Version:
- $Id$
- Author:
- Ketan Padegaonkar <KetanPadegaonkar [at] gmail [dot] com>
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileUtils
public FileUtils()
read
public static String read(String filePath)
- Parameters:
filePath
- the path to the file.
- Returns:
- the contents of the file in filePath.
read
public static String read(File file)
- Parameters:
file
- the file to read from.
- Returns:
- the contents of the file.
read
public static String read(InputStream in)
- Parameters:
in
- the input stream to read from.
- Returns:
- the contents of the inputstream.
read
public static String read(URL url)
- Parameters:
url
- the URL to read from.
- Returns:
- the contents of the url.
read
public static String read(Reader in)
- Parameters:
in
- the reader to read from.
- Returns:
- the contents of the reader.
readlines
public static List<String> readlines(String file)
write
public static void write(String text,
File file)
- Parameters:
text
- the contents to write to the file.file
- the file to write to.
mkdirs
public static void mkdirs(String destination)
- Creates directory specified by destination, and all its parents if they don't exist.
- Parameters:
destination
- the directory to create.
mkdirs
public static void mkdirs(File destination)
- Creates directory specified by destination, and all its parents if they don't exist.
- Parameters:
destination
- the directory to create.