}
getServletContext().log("Process administrative command: " + cmd.getCmd() + "(" + Arrays.toString(cmd.getParams())+")");
for (String dirPath: cmd.getParams()) {
try {
DirectoryIndexer indexer = new DirectoryIndexer();
if (cmd.getCmd().equals(Configuration.indexCmd)) {
// force indexing
indexer.indexDirectory(dirPath, true, request);
// Complete thumbnails and web images if necessary
indexer.checkAndUpdateThumbnails(dirPath);
indexer.checkAndUpdateWebImg(dirPath);
}
else if (cmd.getCmd().equals(Configuration.resetIndexCmd)) {
// delete directory index
indexer.deleteDirectoryIndex(dirPath, request);
}
else if (cmd.getCmd().equals(Configuration.deleteCmd)) {
// delete directory index and images
indexer.deleteDirectoryIndexAndImages(dirPath, request);
}
} catch (AuthenticationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (AuthorizationException e) {