org.hsqldb.lib
Class FileUtil

java.lang.Object
  extended byorg.hsqldb.lib.FileUtil

public class FileUtil
extends Object

A collection of static file management methods.

Author:
fredt@users, boucherb@users

Field Summary
static boolean fsIsIgnoreCase
           
static boolean fsNormalizesPosixSeparator
           
 
Constructor Summary
FileUtil()
           
 
Method Summary
static File absoluteFile(String path)
          Retrieves the absolute File, given some path specification.
static String absolutePath(String path)
          Retrieves the absolute path, given some path specification.
static File canonicalFile(File f)
          Retrieves the canonical file for the given file, in a JDK 1.1 complaint way.
static File canonicalFile(String path)
          Retrieves the canonical file for the given path, in a JDK 1.1 complaint way.
static String canonicalOrAbsolutePath(String path)
          Retrieves the canonical path for the given path, or the absolute path if attemting to retrieve the canonical path fails.
static String canonicalPath(File f)
          Retrieves the canonical path for the given File in a JDK 1.1 complaint way.
static String canonicalPath(String path)
          Retrieves the canonical path for the given path in a JDK 1.1 complaint way.
static void delete(String filename)
          Delete the named file
static boolean exists(String filename)
          Return true or false based on whether the named file exists.
static void renameOverwrite(String oldname, String newname)
          Rename the file with oldname to newname.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fsIsIgnoreCase

public static final boolean fsIsIgnoreCase

fsNormalizesPosixSeparator

public static final boolean fsNormalizesPosixSeparator
Constructor Detail

FileUtil

public FileUtil()
Method Detail

delete

public static void delete(String filename)
                   throws IOException
Delete the named file

Throws:
IOException

exists

public static boolean exists(String filename)
                      throws IOException
Return true or false based on whether the named file exists.

Throws:
IOException

renameOverwrite

public static void renameOverwrite(String oldname,
                                   String newname)
                            throws IOException
Rename the file with oldname to newname. Do nothing if the oldname file does not exist. If a file named newname already exists, delete it before ranaming.

Throws:
IOException

absolutePath

public static String absolutePath(String path)
Retrieves the absolute path, given some path specification.

Parameters:
path - the path for which to retrieve the absolute path
Returns:
the absolute path

absoluteFile

public static File absoluteFile(String path)
Retrieves the absolute File, given some path specification.

Parameters:
path - the path for which to retrieve the absolute File
Returns:
the absolute File

canonicalFile

public static File canonicalFile(File f)
                          throws IOException
Retrieves the canonical file for the given file, in a JDK 1.1 complaint way.

Parameters:
f - the File for which to retrieve the absolute File
Returns:
the canonical File
Throws:
IOException

canonicalFile

public static File canonicalFile(String path)
                          throws IOException
Retrieves the canonical file for the given path, in a JDK 1.1 complaint way.

Parameters:
path - the path for which to retrieve the canonical File
Returns:
the canonical File
Throws:
IOException

canonicalPath

public static String canonicalPath(File f)
                            throws IOException
Retrieves the canonical path for the given File in a JDK 1.1 complaint way.

Parameters:
f - the File for which to retrieve the canonical path
Returns:
the canonical path
Throws:
IOException

canonicalPath

public static String canonicalPath(String path)
                            throws IOException
Retrieves the canonical path for the given path in a JDK 1.1 complaint way.

Parameters:
path - the path for which to retrieve the canonical path
Returns:
the canonical path
Throws:
IOException

canonicalOrAbsolutePath

public static String canonicalOrAbsolutePath(String path)
Retrieves the canonical path for the given path, or the absolute path if attemting to retrieve the canonical path fails.

Parameters:
path - the path for which to retrieve the canonical or absolute path
Returns:
the canonical or absolute path


Copyright © 2001 - 2004 HSQL Development Group. All Rights Reserved.