com.uwyn.rife.tools
Class FileUtils

java.lang.Object
  extended by com.uwyn.rife.tools.FileUtils

public abstract class FileUtils
extends Object


Constructor Summary
FileUtils()
           
 
Method Summary
static String convertPathToSystemSeperator(String path)
           
static void copy(File source, File target)
           
static void copy(File source, OutputStream outputStream)
           
static void copy(InputStream inputStream, File target)
           
static void copy(InputStream inputStream, OutputStream outputStream)
           
static void deleteDirectory(File source)
           
static void deleteFile(File file)
           
static String getBaseName(File file)
           
static String getBaseName(String fileName)
           
static String getExtension(File file)
           
static String getExtension(String fileName)
           
static ArrayList<String> getFileList(File file)
           
static ArrayList<String> getFileList(File file, Pattern[] included, Pattern[] excluded)
           
static ArrayList<String> getFileList(File file, Pattern included, Pattern excluded)
           
static String getUniqueFilename()
           
static void moveDirectory(File source, File target)
           
static void moveFile(File source, File target)
           
static byte[] readBytes(File source)
           
static byte[] readBytes(InputStream inputStream)
           
static byte[] readBytes(URL source)
           
static ByteArrayOutputStream readStream(InputStream inputStream)
           
static String readString(File source)
           
static String readString(File source, String encoding)
           
static String readString(InputStream inputStream)
           
static String readString(InputStream inputStream, String encoding)
           
static String readString(Reader reader)
           
static String readString(URL source)
           
static String readString(URL source, String encoding)
           
static void unzipFile(File source, File destination)
           
static void writeBytes(byte[] content, File destination)
           
static void writeString(String content, File destination)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtils

public FileUtils()
Method Detail

getFileList

public static ArrayList<String> getFileList(File file)

getFileList

public static ArrayList<String> getFileList(File file,
                                            Pattern included,
                                            Pattern excluded)

getFileList

public static ArrayList<String> getFileList(File file,
                                            Pattern[] included,
                                            Pattern[] excluded)

moveFile

public static void moveFile(File source,
                            File target)
                     throws FileUtilsErrorException
Throws:
FileUtilsErrorException

moveDirectory

public static void moveDirectory(File source,
                                 File target)
                          throws FileUtilsErrorException
Throws:
FileUtilsErrorException

deleteDirectory

public static void deleteDirectory(File source)
                            throws FileUtilsErrorException
Throws:
FileUtilsErrorException

copy

public static void copy(InputStream inputStream,
                        OutputStream outputStream)
                 throws FileUtilsErrorException
Throws:
FileUtilsErrorException

copy

public static void copy(InputStream inputStream,
                        File target)
                 throws FileUtilsErrorException
Throws:
FileUtilsErrorException

copy

public static void copy(File source,
                        OutputStream outputStream)
                 throws FileUtilsErrorException
Throws:
FileUtilsErrorException

copy

public static void copy(File source,
                        File target)
                 throws FileUtilsErrorException
Throws:
FileUtilsErrorException

readStream

public static ByteArrayOutputStream readStream(InputStream inputStream)
                                        throws FileUtilsErrorException
Throws:
FileUtilsErrorException

readString

public static String readString(InputStream inputStream)
                         throws FileUtilsErrorException
Throws:
FileUtilsErrorException

readString

public static String readString(Reader reader)
                         throws FileUtilsErrorException
Throws:
FileUtilsErrorException

readString

public static String readString(InputStream inputStream,
                                String encoding)
                         throws FileUtilsErrorException
Throws:
FileUtilsErrorException

readBytes

public static byte[] readBytes(InputStream inputStream)
                        throws FileUtilsErrorException
Throws:
FileUtilsErrorException

readString

public static String readString(URL source)
                         throws FileUtilsErrorException
Throws:
FileUtilsErrorException

readString

public static String readString(URL source,
                                String encoding)
                         throws FileUtilsErrorException
Throws:
FileUtilsErrorException

readBytes

public static byte[] readBytes(URL source)
                        throws FileUtilsErrorException
Throws:
FileUtilsErrorException

readString

public static String readString(File source)
                         throws FileUtilsErrorException
Throws:
FileUtilsErrorException

readString

public static String readString(File source,
                                String encoding)
                         throws FileUtilsErrorException
Throws:
FileUtilsErrorException

readBytes

public static byte[] readBytes(File source)
                        throws FileUtilsErrorException
Throws:
FileUtilsErrorException

writeBytes

public static void writeBytes(byte[] content,
                              File destination)
                       throws FileUtilsErrorException
Throws:
FileUtilsErrorException

writeString

public static void writeString(String content,
                               File destination)
                        throws FileUtilsErrorException
Throws:
FileUtilsErrorException

convertPathToSystemSeperator

public static String convertPathToSystemSeperator(String path)

deleteFile

public static void deleteFile(File file)

getUniqueFilename

public static String getUniqueFilename()

unzipFile

public static void unzipFile(File source,
                             File destination)
                      throws FileUtilsErrorException
Throws:
FileUtilsErrorException

getBaseName

public static String getBaseName(File file)

getBaseName

public static String getBaseName(String fileName)

getExtension

public static String getExtension(File file)

getExtension

public static String getExtension(String fileName)


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.