Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Wtp-wst-dev] Reading directory from a Plugin

Figured it out.  The following works perfectly.

       URL url = Platform.getBundle(pluginName).getEntry(
               "/" + xsdRepositoryPath + "STAR/Rev4.1.4");
       xsdDir = new File(FileLocator.toFileURL(url).toURI());

David Carver wrote:
Forgot to mention.

pluginPath = "platform:/plugin/org.eclipse.wst.tests.schemas/"
xsdRepository = "cache/"

The plugin is created and the appropriate directories setup.

David Carver wrote:
I'm working on a unit test, in where I have a set of schemas in a plugin specified in a directory like the following:


Where the above is the root directory for the schemas. I'm trying to set this up for reading as a File, using the following code:

IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
     IURIFactory  factory     = environment.getURIFactory();
IURI uri1 = factory.newURI(pluginPath + xsdRepositoryPath + "OAGI/OAGIS8.0");

The assertion for isAvailableAsURL passes, the check for isAvailableAsFile fails. Is there anything special that needs to be done to make this so that it can work with the File object?


wtp-wst-dev mailing list

Back to the top