| java.lang.Object com.google.gwt.util.tools.Utility
Utility | final public class Utility (Code) | | A smattering of useful file functions.
|
Method Summary | |
public static void | close(InputStream is) | public static void | close(OutputStream os) | public static void | close(RandomAccessFile f) | public static void | close(Reader reader) | public static void | close(Writer writer) | public static File | createNormalFile(File parent, String fileName, boolean overwrite, boolean ignore) | public static String | getDevJarName() | public static File | getDirectory(File parent, String dirName, boolean create) | public static File | getDirectory(String dirPath, boolean create) | public static String | getFileFromClassPath(String partialPath) Gets the contents of a file from the class path as a string. | public static String | getInstallPath() | public static void | streamOut(File file, OutputStream out, int bufferSize) | public static void | streamOut(InputStream in, OutputStream out, int bufferSize) | public static void | writeTemplateFile(File file, String contents, Map replacements) |
close | public static void close(InputStream is)(Code) | | Helper that ignores exceptions during close, because what are you going to
do?
|
close | public static void close(OutputStream os)(Code) | | Helper that ignores exceptions during close, because what are you going to
do?
|
close | public static void close(RandomAccessFile f)(Code) | | Helper that ignores exceptions during close, because what are you going to
do?
|
close | public static void close(Reader reader)(Code) | | Helper that ignores exceptions during close, because what are you going to
do?
|
close | public static void close(Writer writer)(Code) | | Helper that ignores exceptions during close, because what are you going to
do?
|
createNormalFile | public static File createNormalFile(File parent, String fileName, boolean overwrite, boolean ignore) throws IOException(Code) | | Parameters: parent - Parent directory Parameters: fileName - New file name Parameters: overwrite - Is overwriting an existing file allowed? Handle to the file throws: IOException - If the file cannot be created, or if the file alreadyexisted and overwrite was false. |
getDirectory | public static File getDirectory(File parent, String dirName, boolean create) throws IOException(Code) | | Parameters: parent - Parent directory of the requested directory. Parameters: dirName - Requested name for the directory. Parameters: create - Create the directory if it does not already exist? A File representing a directory that now exists. throws: IOException - If the directory is not found and/or cannot be created. |
getDirectory | public static File getDirectory(String dirPath, boolean create) throws IOException(Code) | | Parameters: dirPath - Requested path for the directory. Parameters: create - Create the directory if it does not already exist? A File representing a directory that now exists. throws: IOException - If the directory is not found and/or cannot be created. |
getFileFromClassPath | public static String getFileFromClassPath(String partialPath) throws IOException(Code) | | Gets the contents of a file from the class path as a string.
Parameters: partialPath - the partial path to the resource from this class's classfile the contents of the file, or null if the file couldnot be found throws: IOException - |
|
|