Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 144799 Details for
Bug 285804
[Import/Export] File -> Import filesystem w/cyclical symbolic folder links causes OOME
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch v01
ImportFileSystem 01.txt (text/plain), 1.98 KB, created by
Prakash Rangaraj
on 2009-08-18 05:13:15 EDT
(
hide
)
Description:
Patch v01
Filename:
MIME Type:
Creator:
Prakash Rangaraj
Created:
2009-08-18 05:13:15 EDT
Size:
1.98 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.ide >Index: src/org/eclipse/ui/wizards/datatransfer/FileSystemStructureProvider.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/src/org/eclipse/ui/wizards/datatransfer/FileSystemStructureProvider.java,v >retrieving revision 1.6 >diff -u -r1.6 FileSystemStructureProvider.java >--- src/org/eclipse/ui/wizards/datatransfer/FileSystemStructureProvider.java 8 May 2006 20:54:13 -0000 1.6 >+++ src/org/eclipse/ui/wizards/datatransfer/FileSystemStructureProvider.java 18 Aug 2009 09:14:46 -0000 >@@ -13,6 +13,7 @@ > import java.io.File; > import java.io.FileInputStream; > import java.io.FileNotFoundException; >+import java.io.IOException; > import java.io.InputStream; > import java.util.ArrayList; > import java.util.List; >@@ -47,13 +48,43 @@ > List result = new ArrayList(childrenLength); > > for (int i = 0; i < childrenLength; i++) { >- result.add(new File(folder, children[i])); >+ File file = new File(folder, children[i]); >+ if(hasCycles(file)) >+ continue; >+ result.add(file); > } > > return result; > } > >- /* (non-Javadoc) >+ private boolean hasCycles(File file) { >+ >+ boolean hasCycles = false; >+ try { >+ String canonicalPath = file.getCanonicalPath(); >+ String absolutePath = file.getAbsolutePath(); >+ >+ // if its not a symbolic link, then no cycles >+ if(!canonicalPath.equals(absolutePath)){ >+ >+ File parentFile = file.getParentFile(); >+ while(parentFile !=null){ >+ >+ String parentCanonicalPath = parentFile.getCanonicalPath(); >+ if(canonicalPath.equals(parentCanonicalPath)){ >+ hasCycles = true; >+ break; >+ } >+ parentFile = parentFile.getParentFile(); >+ } >+ } >+ } catch (IOException e) { >+ IDEWorkbenchPlugin.log(e.getMessage(), e); >+ } >+ return hasCycles; >+ } >+ >+ /* (non-Javadoc) > * Method declared on IImportStructureProvider > */ > public InputStream getContents(Object element) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 285804
:
144799
|
145000
|
145001
|
145458
|
145674