caramel.util
Class FileUtils

java.lang.Object
  |
  +--caramel.util.FileUtils

public class FileUtils
extends java.lang.Object


Constructor Summary
FileUtils()
           
 
Method Summary
static void copy(java.io.File from_file, java.io.File to_file)
           
static void copy(java.lang.String from_name, java.lang.String to_name)
          The static method that actually performs the file copy.
static void download(DownloadTracker tracker, java.net.URL from, java.io.File toFile)
           
static java.io.File[] findByExt(java.io.File base, java.lang.String ext)
           
static java.lang.String getBaseName(java.lang.String name)
          Strips path and extension from a filename example: lib/venus.jnlp -> venus
static java.lang.String getFileAsString(java.io.File file)
           
static java.lang.String getFileAsString(java.lang.String name)
           
static java.lang.String getFileExtension(java.io.File file)
           
static java.lang.String getFileExtension(java.io.File file, boolean keepDot)
           
static java.lang.String getFileExtension(java.lang.String filename)
           
static java.lang.String getFileExtension(java.lang.String filename, boolean keepDot)
           
static java.lang.String getInputStreamAsString(java.io.InputStream inStream)
           
static java.io.File getRoot(java.io.File file)
           
static boolean isDefaultExclude(java.io.File file)
           
static java.lang.String prettyPrintFileSize(java.io.File file)
           
static void saveStreamToFile(java.io.InputStream in, java.io.File outFile)
           
 
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

isDefaultExclude

public static boolean isDefaultExclude(java.io.File file)

prettyPrintFileSize

public static java.lang.String prettyPrintFileSize(java.io.File file)

getRoot

public static java.io.File getRoot(java.io.File file)

getFileExtension

public static java.lang.String getFileExtension(java.lang.String filename)

getFileExtension

public static java.lang.String getFileExtension(java.io.File file)

findByExt

public static java.io.File[] findByExt(java.io.File base,
                                       java.lang.String ext)

getFileExtension

public static java.lang.String getFileExtension(java.lang.String filename,
                                                boolean keepDot)

getFileExtension

public static java.lang.String getFileExtension(java.io.File file,
                                                boolean keepDot)

getBaseName

public static java.lang.String getBaseName(java.lang.String name)
Strips path and extension from a filename example: lib/venus.jnlp -> venus


saveStreamToFile

public static void saveStreamToFile(java.io.InputStream in,
                                    java.io.File outFile)
                             throws java.io.IOException
java.io.IOException

getInputStreamAsString

public static java.lang.String getInputStreamAsString(java.io.InputStream inStream)
                                               throws java.io.IOException
java.io.IOException

getFileAsString

public static java.lang.String getFileAsString(java.lang.String name)
                                        throws java.io.IOException
java.io.IOException

getFileAsString

public static java.lang.String getFileAsString(java.io.File file)
                                        throws java.io.IOException
java.io.IOException

download

public static void download(DownloadTracker tracker,
                            java.net.URL from,
                            java.io.File toFile)
                     throws java.io.IOException
java.io.IOException

copy

public static void copy(java.io.File from_file,
                        java.io.File to_file)
                 throws java.io.IOException
java.io.IOException

copy

public static void copy(java.lang.String from_name,
                        java.lang.String to_name)
                 throws java.io.IOException
The static method that actually performs the file copy. Before copying the file, however, it performs a lot of tests to make sure everything is as it should be.

java.io.IOException


Copyright © 2001, 2002, 2003 Gerald Bauer. All Rights Reserved. Hosted by SourceForge Logo