at.molindo.utils.io
Class FileUtils

java.lang.Object
  extended by at.molindo.utils.io.FileUtils

public class FileUtils
extends Object


Method Summary
static byte[] bytes(File file)
           
static byte[] bytes(File file, Compression compression)
           
static Compression compression(File file)
           
static Compression compression(String name)
           
static boolean delete(File file)
          deletes files and directories
static String extension(File file)
           
static String extension(String fileName)
           
static String extensionFull(File file)
           
static String extensionFull(String fileName)
           
static InputStream in(File file, Compression compression)
           
static OutputStream out(File file, Compression compression)
           
static BufferedReader read(File file, Compression compression)
           
static BufferedWriter write(File file, Compression compression)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

extension

public static String extension(File file)
Returns:
normalized (trimmed, lower case) extension of file including last '.' or empty string (e.g. "foo.tar.gz" => ".gz")

extension

public static String extension(String fileName)

extensionFull

public static String extensionFull(File file)
Returns:
normalized (trimmed, lower case) full extension of file including first '.' or empty string (e.g. "foo.tar.gz" => ".tar.gz")

extensionFull

public static String extensionFull(String fileName)

in

public static InputStream in(File file,
                             Compression compression)
                      throws FileNotFoundException,
                             IOException
Throws:
FileNotFoundException
IOException

out

public static OutputStream out(File file,
                               Compression compression)
                        throws FileNotFoundException,
                               IOException
Throws:
FileNotFoundException
IOException

read

public static BufferedReader read(File file,
                                  Compression compression)
                           throws FileNotFoundException,
                                  IOException
Throws:
FileNotFoundException
IOException

write

public static BufferedWriter write(File file,
                                   Compression compression)
                            throws FileNotFoundException,
                                   IOException
Throws:
FileNotFoundException
IOException

bytes

public static byte[] bytes(File file)
                    throws FileNotFoundException,
                           IOException
Throws:
FileNotFoundException
IOException

bytes

public static byte[] bytes(File file,
                           Compression compression)
                    throws FileNotFoundException,
                           IOException
Throws:
FileNotFoundException
IOException

compression

public static Compression compression(File file)

compression

public static Compression compression(String name)
Parameters:
name - name of a file
Returns:
never null, never Compression.AUTO

delete

public static boolean delete(File file)
deletes files and directories

Returns:
true if file does not exist (anymore)


Copyright © 2013 Molindo GmbH. All Rights Reserved.