|
Re: Creating an IFolder directly under workspace [message #272021 is a reply to message #272007] |
Mon, 20 September 2004 15:00 |
Eclipse User |
|
|
|
Originally posted by: john.eclipsefaq.org
Folders in the workspace must belong to a project. For storing private
metadata for your plugin, I suggest using the location provided by
Plugin.getStateLocation() on your plugin instance. This will give you a
directory in a private location reserved for your plugin. The end user
will not be able to see it. You need to use plain java.io APIs to read
and write to this location.
--
Joe Hudson wrote:
> Hello, I'm developing a plug-in using Eclipse 3.1 and would like to know
> how to create an IFolder directly in the workspace. I would like to use
> this folder for keeping resources associated with my plug-in.
>
> I know that I can just get the workspace location and do file management
> with java.io.File but I would like to do it the Eclipse way. Could
> someone please correct the code that I am using below? Thanks in advance.
>
> IPath path =
> ResourcesPlugin.getWorkspace().getRoot().getFullPath().appen d( ".foo");
> IFolder folder =
> ResourcesPlugin.getWorkspace().getRoot().getFolder(path);
>
> It seems that I can only use IFolders directly under projects because the
> error I receive is shown below:
> java.lang.IllegalArgumentException: Path must include project and resource
> name: /.foo
>
> Thank you very much for your help.
>
> Joe
>
|
|
|
Powered by
FUDForum. Page generated in 0.03323 seconds