protected DataObject handleCopy (DataFolder f) throws IOException { if (getOriginal() instanceof DataFolder) { DataFolder.testNesting(((DataFolder)getOriginal()), f); } return super.handleCopy(f); }
protected DataShadow handleCreateShadow (DataFolder f) throws IOException { if (getOriginal() instanceof DataFolder) { DataFolder.testNesting(((DataFolder)getOriginal()), f); } return original.handleCreateShadow (f); }
protected FileObject handleMove (DataFolder f) throws IOException { if (getOriginal() instanceof DataFolder) { DataFolder.testNesting(((DataFolder)getOriginal()), f); } return super.handleMove(f); }
protected DataObject handleCopy (DataFolder f) throws IOException { testNesting(this, f); Enumeration en = children (); DataFolder newFolder = (DataFolder)super.handleCopy (f); while (en.hasMoreElements ()) { try { DataObject obj = (DataObject)en.nextElement (); if (obj.isCopyAllowed()) { obj.copy (newFolder); } else { // data object can not be copied, inform user ErrorManager.getDefault().log(ErrorManager.USER, NbBundle.getMessage(DataFolder.class, "FMT_CannotCopyDo", obj.getName() ) ); } } catch (IOException ex) { ErrorManager.getDefault().notify(ex); } } return newFolder; }
/** Creates shadow for this object in specified folder (overridable in subclasses). * <p>The default * implementation creates a reference data shadow and pastes it into * the specified folder. * * @param f the folder to create a shortcut in * @return the shadow */ protected DataShadow handleCreateShadow (DataFolder f) throws IOException { // #33871 - prevent creation of recursive folder structure testNesting(this, f); String name; if (getPrimaryFile ().isRoot ()) { name = FileUtil.findFreeFileName ( f.getPrimaryFile (), ROOT_SHADOW_NAME, DataShadow.SHADOW_EXTENSION ); } else { name = null; } return DataShadow.create (f, name, this); }