This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Description
The evaluation does not return true when invalid characters were used.
/*
public static final String LEGAL_CHARACTERS = "abcdefghijklmnopqrstuvwxyz0123456789_$()+-/";
*/
public static final String LEGAL_FILENAME_CHARACTERS = "[^\\w\\d_$()/+-]*$";
private String pathForName(String name) {
/*
if ((name == null) || (name.length() == 0) || Pattern.matches("^" + LEGAL_CHARACTERS, name) || !Character.isLowerCase(name.charAt(0))) {
return null;
}
*/
if ((name == null) || (name.length() == 0) || Pattern.matches(LEGAL_FILENAME_CHARACTERS, name) || !Character.isLowerCase(name.charAt(0))) {
return null;
}
name = name.replace('/', ':');
String result = directory.getPath() + File.separator + name + DATABASE_SUFFIX;
return result;
}