This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 248880 - Recursing children when copy-pasting a DataFolder disallows file-system level optimizations
Summary: Recursing children when copy-pasting a DataFolder disallows file-system level...
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-25 10:34 UTC by Vladimir Kvashin
Modified: 2014-11-25 12:05 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Kvashin 2014-11-25 10:34:25 UTC
I faced this issue when developing a remote file system. Users complained that copy-pasting is very slow. I optimized copy-pasting of files, but I realized that copy is *never* called on folder file objects. DataFolder recurses its children instead, see the stack below.

This disallows remote file system level optimizations. I could make copy-pasting on remote file system 10x faster if it was a possibility to do this on filesystem level.

Here is the stack

"Pasting"
org.netbeans.modules.remote.impl.fs.RemoteFileObject.copy(RemoteFileObject.java:267)
org.openide.loaders.FileEntry.copy(FileEntry.java:77)
org.openide.loaders.MultiDataObject.handleCopy(MultiDataObject.java:511)
org.openide.loaders.DataObject$2.run(DataObject.java:697)
org.openide.loaders.DataObjectPool$1WrapAtomicAction.run(DataObjectPool.java:261)
org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:127)
org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:499)
org.openide.loaders.DataObjectPool.runAtomicAction(DataObjectPool.java:286)
org.openide.loaders.DataObject.invokeAtomicAction(DataObject.java:1051)
org.openide.loaders.DataObject.copy(DataObject.java:695)
org.openide.loaders.DataFolder.handleCopy(DataFolder.java:598)
org.openide.loaders.DataObject$2.run(DataObject.java:697)
org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:127)
org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:499)
org.openide.loaders.DataObjectPool.runAtomicActionSimple(DataObjectPool.java:229)
org.openide.loaders.DataObject.invokeAtomicAction(DataObject.java:1048)
org.openide.loaders.DataObject.copy(DataObject.java:695)
org.openide.loaders.DataFolder$Paste$2.handlePaste(DataFolder.java:1719)
org.openide.loaders.DataTransferSupport$PasteTypeExt.doPaste(DataTransferSupport.java:180)
org.openide.loaders.DataTransferSupport$PasteTypeExt.paste(DataTransferSupport.java:169)
org.openide.actions.PasteAction$ActionPT.actionPerformed(PasteAction.java:801)
org.netbeans.core.ModuleActions.invokeAction(ModuleActions.java:109)
org.openide.actions.PasteAction$ActionPT.run(PasteAction.java:825)
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1425)
org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:59)
org.openide.util.lookup.Lookups.executeWith(Lookups.java:294)
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2038)


There is a similar issue 50994, but I'm not sure this one is quite the same. Of you think it is, please feel free to mark as a dup.
Comment 1 Jaroslav Havlin 2014-11-25 12:05:19 UTC
> I optimized copy-pasting of files, but I realized that copy is *never* called 
> on folder file objects. DataFolder recurses its children instead, see the stack
> below.
It is probably implemented this way because of refactoring. I'll check if FileObjects can be copied directly if no refactoring is needed. Thank you for reporting.