|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectde.unikassel.android.sdcframework.util.FileUtils
public final class FileUtils
A static utility class providing functions for IO and file operations.
| Field Summary | |
|---|---|
static int |
DEFAULT_BUFFER_SIZE
The default buffer size |
| Constructor Summary | |
|---|---|
FileUtils()
|
|
| Method Summary | |
|---|---|
static boolean |
copy(File source,
File dest)
Method to copy one file to another |
static boolean |
copy(FileInputStream sourceStream,
FileOutputStream destStream)
Method to copy one file stream to another |
static boolean |
copy(FileInputStream sourceStream,
String destFilename)
Method to copy a file from an input stream to another file |
static boolean |
copy(String sourceFilename,
String destFilename)
Method to copy one file to another |
static boolean |
deleteFile(String filename)
Method to delete a file |
static File |
fileFromPath(String pathToFile)
Method to create a file object from a path to a file |
static String |
fileNameFromPath(String pathToFile)
Method to extract the filename from a path |
static String |
readTextFileContent(String fileName)
Does read the content of a text file |
static String |
readTextFileContentFromArchive(ZipInputStream zipStream,
String fileName)
Does read the content of a text file from an archive stream if the file is contained in the archive |
static String |
readTextStreamContent(InputStream in)
Method to read input from text stream into a string |
static boolean |
writeToTextFile(String text,
String fileName)
Does write text into a file |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_BUFFER_SIZE
| Constructor Detail |
|---|
public FileUtils()
| Method Detail |
|---|
public static final String fileNameFromPath(String pathToFile)
pathToFile - the path to the file
public static final File fileFromPath(String pathToFile)
pathToFile - the path to the file
public static final boolean deleteFile(String filename)
filename - the file name and path to delete
public static final boolean copy(String sourceFilename,
String destFilename)
sourceFilename - the source file name and pathdestFilename - the destination file name and path
public static final boolean copy(FileInputStream sourceStream,
String destFilename)
sourceStream - the source file streamdestFilename - the destination file name and path
public static final boolean copy(File source,
File dest)
source - the source filedest - the destination file
public static final boolean copy(FileInputStream sourceStream,
FileOutputStream destStream)
sourceStream - the source file streamdestStream - the destination file stream
public static final boolean writeToTextFile(String text,
String fileName)
text - the text to writefileName - the filename
public static final String readTextFileContent(String fileName)
fileName - the filename
public static final String readTextStreamContent(InputStream in)
in - the input stream
public static final String readTextFileContentFromArchive(ZipInputStream zipStream,
String fileName)
zipStream - the archive streamfileName - the filename in archive to read
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||