}
public Controller execute(FolderComponent folderComponent, UserRequest ureq, WindowControl wContr, Translator trans) {
this.translator = trans;
FileSelection selection = new FileSelection(ureq, folderComponent.getCurrentContainerPath());
VFSContainer currentContainer = folderComponent.getCurrentContainer();
if (!(currentContainer.canWrite() == VFSConstants.YES))
throw new AssertException("Cannot unzip to folder. Writing denied.");
//check if command is executed on a file containing invalid filenames or paths - checks if the resulting folder has a valid name
if(selection.getInvalidFileNames().size()>0) {
status = FolderCommandStatus.STATUS_INVALID_NAME;
return null;
}
List<String> lockedFiles = new ArrayList<String>();
for (String sItem:selection.getFiles()) {
VFSItem vfsItem = currentContainer.resolve(sItem);
if (vfsItem instanceof VFSLeaf) {
boolean isAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
lockedFiles.addAll(checkLockedFiles((VFSLeaf)vfsItem, currentContainer, ureq.getIdentity(), isAdmin));
}
}
if(!lockedFiles.isEmpty()) {
String msg = MetaInfoHelper.renderLockedMessageAsHtml(trans, null, lockedFiles);
List<String> buttonLabels = Collections.singletonList(trans.translate("ok"));
lockedFiledCtr = activateGenericDialog(ureq, trans.translate("lock.title"), msg, buttonLabels, lockedFiledCtr);
return null;
}
boolean fileNotExist = false;
for (String sItem:selection.getFiles()) {
VFSItem vfsItem = currentContainer.resolve(sItem);
if (vfsItem != null && (vfsItem instanceof VFSLeaf)) {
if (!doUnzip((VFSLeaf)vfsItem, currentContainer, ureq, wContr)) {
status = FolderCommandStatus.STATUS_FAILED;
break;