org.h2.store
Class FileLister

java.lang.Object
  extended by org.h2.store.FileLister

public class FileLister
extends java.lang.Object

Utility class to list the files of a database.


Method Summary
static java.util.ArrayList<java.lang.String> getDatabaseFiles(java.lang.String dir, java.lang.String db, boolean all)
          Get the list of database files.
static java.lang.String getDatabaseNameFromFileName(java.lang.String fileName)
          Extract the name of the database from a given file name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDatabaseNameFromFileName

public static java.lang.String getDatabaseNameFromFileName(java.lang.String fileName)
Extract the name of the database from a given file name. Only files ending with .data.db are considered, all others return null.

Parameters:
fileName - the file name (without directory)
Returns:
the database name or null

getDatabaseFiles

public static java.util.ArrayList<java.lang.String> getDatabaseFiles(java.lang.String dir,
                                                                     java.lang.String db,
                                                                     boolean all)
                                                              throws java.sql.SQLException
Get the list of database files.

Parameters:
dir - the directory (null for the current directory)
db - the database name (null for all databases)
all - if true, files such as the lock, trace, hash index, and lob files are included. If false, only data, index and log files are returned
Returns:
the list of files
Throws:
java.sql.SQLException