|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.zipxap.vfs.dal.utility.FileTools
public class FileTools
This class contains a collection of utilities for working with Files (and directories).
Custom code placed here will not be overwritten/deleted by the generator. If this file is manually deleted, it will be regenerated.
Copyright 2009 ZipXap Technology, LLC. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA or visit http://www.gnu.org/licenses/lgpl.html.
| Method Summary | |
|---|---|
static byte[] |
byteArrayFromFile(java.io.File inFile)
Reads a file into a byte array using non-blocking I/O. |
static void |
byteArrayToFile(java.io.File outFile,
byte[] content)
Writes the byte array to file using non-blocking I/O. |
static boolean |
deleteRecursive(java.io.File rootDirectoryOrFile,
boolean continueThroughFailures)
Delete the directory and all files and subdirectories contained under it. |
static java.util.List<java.io.File> |
findFilesWithName(java.io.File rootDirectory,
java.lang.String filename)
|
static java.lang.String |
getNewlineSequence()
|
static java.util.List<java.lang.String> |
loadFile(java.io.File file)
Load the specified file into a List |
static java.lang.String |
loadFileAsSingleString(java.io.File file)
|
static java.util.List<java.lang.String> |
loadFileTrimUpperCase(java.io.File file)
Load the specified file into a List |
static java.util.List<java.lang.String> |
loadFileUpperCase(java.io.File file)
Load the specified file into a List |
static java.lang.String |
loadFromReader(java.io.Reader reader)
Retrieve the contents of the Reader and close the reader. |
static void |
saveFile(java.io.File file,
java.util.Collection<java.lang.String> lines)
Save the lines in the collection to the specified file, placing a newline sequence between each line. |
static void |
saveFile(java.io.File file,
java.lang.String content)
Save the specified content to the specified file, placing a newline sequence between each line. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.util.List<java.lang.String> loadFileTrimUpperCase(java.io.File file)
file -
public static java.util.List<java.lang.String> loadFileUpperCase(java.io.File file)
file -
public static java.util.List<java.lang.String> loadFile(java.io.File file)
file -
public static java.lang.String loadFileAsSingleString(java.io.File file)
public static void saveFile(java.io.File file,
java.lang.String content)
file - file The output file to create.content - the content to save to the output file.
public static void saveFile(java.io.File file,
java.util.Collection<java.lang.String> lines)
file - The output file to create.lines - the content lines to save to the output file.public static java.lang.String getNewlineSequence()
public static java.util.List<java.io.File> findFilesWithName(java.io.File rootDirectory,
java.lang.String filename)
public static byte[] byteArrayFromFile(java.io.File inFile)
inFile - The file to read from.
public static void byteArrayToFile(java.io.File outFile,
byte[] content)
outFile - The file to write to.content - the byte array to be written.
public static boolean deleteRecursive(java.io.File rootDirectoryOrFile,
boolean continueThroughFailures)
rootDirectoryOrFile - The file or directory to begin the recursive delete.continueThroughFailures - when set to true, the method continues trying to
delete other files/directories, despite failing to delete one or more files/directories.
When set to false, this method abandons the recursion at the point of first failure, leaving
the directory in an unknown state.
public static java.lang.String loadFromReader(java.io.Reader reader)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||