public final class Databases extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DBCHARS
Allowed characters for database names (additional to letters and digits).
|
Modifier and Type | Method and Description |
---|---|
StringList |
backups()
Returns the names of all backups.
|
StringList |
backups(String db)
Returns the name of a specific backup, or all backups found for a specific database,
in a descending order.
|
static String |
date(String backup)
Extracts the date of a database from the name of a backup.
|
StringList |
list()
Lists all available databases and backups.
|
static String |
name(String backup)
Extracts the name of a database from the name of a backup.
|
static Pattern |
regex(String pattern)
Returns a regular expression for the specified name pattern.
|
static boolean |
validChar(int ch,
boolean firstLast)
Checks if the specified character is a valid character for a database name.
|
static boolean |
validName(String name)
Checks if the specified string is a valid database name.
|
static boolean |
validPattern(String pattern)
Checks if the specified string is a valid database pattern.
|
public static final String DBCHARS
,?*
" are used by the glob syntax;
is reserved for separating commands.:*?\"<>\/|
" are used for filenames and pathspublic StringList list()
public static Pattern regex(String pattern)
pattern
- patternpublic StringList backups()
public StringList backups(String db)
db
- databasepublic static String name(String backup)
backup
- Name of the backup file. Valid formats:
[dbname]-yyyy-mm-dd-hh-mm-ss
,
[dbname]
[dbname]
)public static String date(String backup)
backup
- name of the backup file, including the datepublic static boolean validChar(int ch, boolean firstLast)
ch
- the character to be checkedfirstLast
- character is first or lastpublic static boolean validName(String name)
name
- name to be checked (can be null
)public static boolean validPattern(String pattern)
pattern
- pattern to be checked (can be null
)Copyright © 2005–2023 BaseX Team. All rights reserved.