}
}
return "";
}
public String paste() throws ObjectLockedException, ObjectExistsException {
StoredFileDao storedFileDao = StoredFileDao.createInstance();
FolderBean folderBean = (FolderBean) FacesContext.getCurrentInstance().getApplication().createValueBinding(FolderBean.BEAN_REF).getValue(FacesContext.getCurrentInstance());
Folder destinationFolder = folderBean.getSelectedFolder();
if (this.selectedStoredFiles != null) {
if (this.cutRequested && this.copyRequested) {
throw new IllegalStateException("The object cannot request cut and copy operations all at once.");
}
if (this.cutRequested) {
for (Iterator it = this.selectedStoredFiles.iterator(); it.hasNext(); ){
ViewStoredFile viewStoredFile = (ViewStoredFile) it.next();
StoredFile cutStoredFile = viewStoredFile.getStoredFile();
storedFileDao.cutTo(cutStoredFile, destinationFolder);
this.cutRequested = false;
}
} else if (this.copyRequested) {
for (Iterator it = this.selectedStoredFiles.iterator(); it.hasNext(); ){
ViewStoredFile viewStoredFile = (ViewStoredFile) it.next();
StoredFile cutStoredFile = viewStoredFile.getStoredFile();
storedFileDao.copyTo(cutStoredFile, destinationFolder);
this.copyRequested = false;
}
} else {
//All false: nothing to do
}