fileSystem.deleteFile(hibernateSession, Integer.parseInt(fform.getFileId()));
} else if (fform.getAction().equals("mkdir")) {
int parentDirectoryId = Integer.parseInt(fform.getDirectoryId());
fileSystem.createDirectory(hibernateSession, parentDirectoryId, fform.getName());
} else if (fform.getAction().equals("rmdir")) {
Directory directory = fileSystem.getDirectory(hibernateSession, Integer.parseInt(fform.getDirectoryId()));
Directory parent = directory.getParent();
if (parent == null) {
parent = fileSystem.getRootDirectory();
}
fform.setDirectoryId(Integer.toString(parent.getId()));
fileSystem.deleteDirectory(hibernateSession, directory.getId());
}
hibernateSession.flush();
hibernateSession.connection().commit();
if (fform.getDirectoryId() != null) {
Directory directory = fileSystem.getDirectory(hibernateSession, Integer.parseInt(fform.getDirectoryId()));
request.setAttribute("directory", directory);
}
request.setAttribute("root", fileSystem.getRootDirectory());
return mapping.findForward("display");
} catch (ObjectNotFoundException ex) {