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 225991

Summary: Recursive symlinks & copy? FileNotFoundException: Can't read Baixades/jpgraph-3.5.0b1/src/Examples/.../Examples/jpgraph
Product: platform Reporter: Exceptions Reporter <exceptions_reporter>
Component: FilesystemsAssignee: Jaroslav Havlin <jhavlin>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: P3    
Version: 7.3   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 198502
Bug Depends on: 237882    
Bug Blocks:    
Attachments: stacktrace
Proposed Patch

Description Exceptions Reporter 2013-02-11 17:29:24 UTC
This bug was originally marked as duplicate of bug 198082, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 7.3 Beta 2 (Build 201211062253)
VM: OpenJDK Client VM, 20.0-b12, OpenJDK Runtime Environment, 1.6.0_24-b24
OS: Linux

Stacktrace: 
java.io.FileNotFoundException: Can't read /home/joan/Baixades/jpgraph-3.5.0b1/src/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph/Examples/jpgraph
   at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.getInputStream(FileObj.java:171)
   at org.openide.filesystems.FileUtil.copyFileImpl(FileUtil.java:763)
   at org.openide.filesystems.FileObject.copy(FileObject.java:154)
   at org.netbeans.modules.masterfs.filebasedfs.fileobjects.BaseFileObj.copy(BaseFileObj.java:255)
   at org.openide.loaders.FileEntry.copy(FileEntry.java:76)
   at org.openide.loaders.MultiDataObject.handleCopy(MultiDataObject.java:515)
Comment 1 Exceptions Reporter 2013-02-11 17:29:26 UTC
Created attachment 131257 [details]
stacktrace
Comment 2 Jaroslav Tulach 2013-07-08 13:37:07 UTC
It might help if the copy operation could detected symlinks and instead of copying it, rather recreated it somehow.
Comment 3 Jaroslav Havlin 2013-11-04 15:06:45 UTC
Created attachment 141838 [details]
Proposed Patch

> It might help if the copy operation could detected symlinks and instead of
> copying it, rather recreated it somehow.
It is not clear how the symlinks should be recreated (use the same 
relative/absolute target path, or create link to source link?).

We also cannot always assume that symbolic links should not be followed.

The proposed patch simply tries to detect problematic recursive symbolic links
and skips them.
Comment 4 Jaroslav Havlin 2013-11-04 15:13:39 UTC
Please note that the attached patch doesn't work with Windows junctions,
Files.isSymbolicLink(pathToJunction) returns false. Symlinks created e.g. with
command "mklink" work correctly.
Comment 5 Quality Engineering 2015-02-04 03:32:37 UTC
Reported for 7.3.x or earlier, no new info since then -> closing as worksforme, please reopen in case you see it.