Java Code Examples for org.eclipse.core.resources.IResource.getLocationURI()

The following are Jave code examples for showing how to use getLocationURI() of the org.eclipse.core.resources.IResource class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: java-debug   File:   Source Code and License Vote up 5 votes
private static String getFileURI(IResource resource) {
    URI uri = resource.getLocationURI();
    if (uri != null) {
        String uriString = uri.toString();
        // Fix uris by adding missing // to single file:/ prefix.
        return uriString.replaceFirst("file:/([^/])", "file:///$1");
    return null;
Example 2
Project: gemoc-studio   File:   Source Code and License Vote up 4 votes
static public URL IResourceToURL(IResource resource) throws MalformedURLException {
	URI locationURI = resource.getLocationURI();
	return locationURI.toURL();