net.ontopia.utils
Class FileUtils

java.lang.Object
  extended by net.ontopia.utils.FileUtils

public class FileUtils
extends java.lang.Object

INTERNAL: Class that contains useful file operation methods.

Since:
1.3

Constructor Summary
FileUtils()
           
 
Method Summary
static boolean compare(java.io.File file1, java.io.File file2)
          INTERNAL: Compares the two files for equality.
static boolean compare(java.lang.String file1, java.lang.String file2)
          INTERNAL: Compares the two files for equality.
static boolean compareFileToResource(java.io.File file, java.lang.String resourceName)
          INTERNAL: Compares the contents of a file and a resource that will be loaded from classpath
static boolean compareFileToResource(java.lang.String fileName, java.lang.String resourceName)
          INTERNAL: Compares the contents of a file and a resource that will be loaded from classpath
static void copyFile(java.io.File source, java.io.File target)
          INTERNAL: Copies a file's content to another file.
static void delete(java.io.File file_or_dir, boolean recursive)
          INTERNAL: Deletes the file or directory, recursively if specified.
static void delete(java.lang.String file_or_dirname, boolean recursive)
          INTERNAL: Deletes the file or directory with the given name, recursively if specified.
static void deleteDirectory(java.io.File dir, boolean recursive)
          INTERNAL: Deletes the directory, recursively if specified.
static void deleteDirectory(java.lang.String dirname, boolean recursive)
          INTERNAL: Deletes the directory with the given name, recursively if specified.
static void deleteFile(java.io.File file)
          INTERNAL: Deletes the file.
static void deleteFile(java.lang.String filename)
          INTERNAL: Deletes the file with the given name.
static boolean fileExists(java.lang.String filename)
          INTERNAL: Returns true if file exists.
 
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

fileExists

public static boolean fileExists(java.lang.String filename)
INTERNAL: Returns true if file exists.


deleteFile

public static void deleteFile(java.lang.String filename)
                       throws java.io.IOException
INTERNAL: Deletes the file with the given name.

Throws:
java.io.IOException

deleteFile

public static void deleteFile(java.io.File file)
                       throws java.io.IOException
INTERNAL: Deletes the file.

Throws:
java.io.IOException

deleteDirectory

public static void deleteDirectory(java.lang.String dirname,
                                   boolean recursive)
                            throws java.io.IOException
INTERNAL: Deletes the directory with the given name, recursively if specified.

Throws:
java.io.IOException

deleteDirectory

public static void deleteDirectory(java.io.File dir,
                                   boolean recursive)
                            throws java.io.IOException
INTERNAL: Deletes the directory, recursively if specified.

Throws:
java.io.IOException

delete

public static void delete(java.lang.String file_or_dirname,
                          boolean recursive)
                   throws java.io.IOException
INTERNAL: Deletes the file or directory with the given name, recursively if specified.

Throws:
java.io.IOException

delete

public static void delete(java.io.File file_or_dir,
                          boolean recursive)
                   throws java.io.IOException
INTERNAL: Deletes the file or directory, recursively if specified.

Throws:
java.io.IOException

compare

public static boolean compare(java.lang.String file1,
                              java.lang.String file2)
                       throws java.io.IOException
INTERNAL: Compares the two files for equality.

Throws:
java.io.IOException

compare

public static boolean compare(java.io.File file1,
                              java.io.File file2)
                       throws java.io.IOException
INTERNAL: Compares the two files for equality.

Throws:
java.io.IOException

compareFileToResource

public static boolean compareFileToResource(java.lang.String fileName,
                                            java.lang.String resourceName)
                                     throws java.io.IOException
INTERNAL: Compares the contents of a file and a resource that will be loaded from classpath

Throws:
java.io.IOException

compareFileToResource

public static boolean compareFileToResource(java.io.File file,
                                            java.lang.String resourceName)
                                     throws java.io.IOException
INTERNAL: Compares the contents of a file and a resource that will be loaded from classpath

Throws:
java.io.IOException

copyFile

public static void copyFile(java.io.File source,
                            java.io.File target)
                     throws java.io.IOException
INTERNAL: Copies a file's content to another file.

Throws:
java.io.IOException


Copyright © 2000-2012 Ontopia.