Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Get co
Get co [message #532011] Thu, 06 May 2010 18:32 Go to next message
Mikael Petterson is currently offline Mikael PettersonFriend
Messages: 153
Registered: July 2009
Senior Member
My resource is show ( when I debug) like this:

F/mypackage/directory1/directory2/file.java

When I do recursive getParent() I finally end up with
F/

Is it possible to get the absolute path for this, F/ and make a resource out of it?

What is /F a representation of?

br,

//mike
Re: Get co [message #532020 is a reply to message #532011] Thu, 06 May 2010 19:05 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

It's usually L/my.project/folder/folder/file.java

The top, the directory that contains my.project, is call the workspace
root. ResourcePlugin.getWorkspace().getRoot() will return the
IWorkspaceRoot that points to the top level location.

Why do you want the absolute path to the root? You should never write
to this location. You can use the IResources API to create projects and
under them files and folders.

You can use OSGi org.eclipse.osgi.service.datalocation.Location or
org.eclipse.core.runtime.Plugin.getStateLocation() to get a
plugin-specific area you can write to using simple java I/O APIs

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Previous Topic:eclipse v3.4 API to Get List of Installed features
Next Topic:Handling Cut/Copy/Paste
Goto Forum:
  


Current Time: Fri Dec 19 09:25:34 GMT 2014

Powered by FUDForum. Page generated in 0.12903 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software