}
FileSystemPathUtil.checkFormat(folderPath);
if (!isFolder(folderPath)) {
throw new FileSystemException("no such folder: " + folderPath);
}
synchronized (selectFileAndFolderNamesSQL) {
ResultSet rs = null;
try {
Statement stmt = executeStmt(
selectFileAndFolderNamesSQL, new Object[]{folderPath});
rs = stmt.getResultSet();
ArrayList names = new ArrayList();
while (rs.next()) {
String name = rs.getString(1);
if (name.length() == 0
&& FileSystemPathUtil.denotesRoot(folderPath)) {
// this is the file system root entry, skip...
continue;
}
names.add(name);
}
return (String[]) names.toArray(new String[names.size()]);
} catch (SQLException e) {
String msg = "failed to list child entries of folder: " + folderPath;
log.error(msg, e);
throw new FileSystemException(msg, e);
} finally {
closeResultSet(rs);
}
}
}