Package org.h2.store
Class FileLister
- java.lang.Object
-
- org.h2.store.FileLister
-
public class FileLister extends java.lang.ObjectUtility class to list the files of a database.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateFileLister()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.StringgetDir(java.lang.String dir)Normalize the directory name.static voidtryUnlockDatabase(java.util.List<java.lang.String> files, java.lang.String message)Try to lock the database, and then unlock it.
-
-
-
Method Detail
-
tryUnlockDatabase
public static void tryUnlockDatabase(java.util.List<java.lang.String> files, java.lang.String message) throws java.sql.SQLExceptionTry to lock the database, and then unlock it. If this worked, the .lock.db file will be removed.- Parameters:
files- the database files to checkmessage- the text to include in the error message- Throws:
java.sql.SQLException- if it failed
-
getDir
public static java.lang.String getDir(java.lang.String dir)
Normalize the directory name.- Parameters:
dir- the directory (null for the current directory)- Returns:
- the normalized directory name
-
getDatabaseFiles
public static java.util.ArrayList<java.lang.String> getDatabaseFiles(java.lang.String dir, java.lang.String db, boolean all)Get the list of database files.- Parameters:
dir- the directory (must be normalized)db- the database name (null for all databases)all- if true, files such as the lock, trace, and lob files are included. If false, only data, index, log, and lob files are returned- Returns:
- the list of files
-
-