/** * Converts the given workspace path URI to an absolute, platform resource URI, with encoding to eliminate any * invalid characters. */ protected URI toPlatformResourceURI(URI uri) { return URI.createPlatformResourceURI(uri.toString(), true); }
private URI createPlatformResourceURI(IPath resourcePath) { URI result = URI.createPlatformResourceURI(resourcePath.toString(), true); return result; }
/** * Determine the URI for this jar entry. */ protected abstract URI getURI(IJarEntryResource jarEntry, TraversalState state);
protected URI internalGetUri(IStorage storage) { if (storage instanceof IFile) { return URI.createPlatformResourceURI(storage.getFullPath().toString(), true); } return null; }
/** * Converts the given workspace path URI to an absolute, platform resource URI, with encoding to eliminate any * invalid characters. */ protected URI toPlatformResourceURI(URI uri) { return URI.createPlatformResourceURI(uri.toString(), true); }
/** * Returns the string representation of platform URL given an IPath * @param IPath path * @return String platformURL */ public static String getPlatformURL(IPath path) { String platformURL; platformURL = URI.createPlatformResourceURI(path.toString()).toString(); // old method: file system representation // platformURL = ResourcesPlugin.getWorkspace().getRoot().getFile(path).getLocation().toString(); return platformURL; }
protected URI normalizeWorkspaceProtocol(URI aWorkspaceURI, String fragment) { URI result; String uriString = aWorkspaceURI.toString(); uriString = uriString.substring(JEMUtilPlugin.WORKSPACE_PROTOCOL.length() + 1); result = URI.createPlatformResourceURI(uriString); if (fragment != null) result = appendFragment(aWorkspaceURI, fragment); return result; }
/** * We cannot use the storage to URI mapper here, as it only works for Xtext based languages * @since 2.3 */ public URI getURI(String fileName, String outputConfiguration) { IFile file = getFile(fileName, outputConfiguration); return URI.createPlatformResourceURI(file.getFullPath().toString(), true); }
/** * We cannot use the storage to URI mapper here, as it only works for Xtext based languages * @since 2.3 */ public URI getURI(String fileName, String outputConfiguration) { IFile file = getFile(fileName, outputConfiguration); return URI.createPlatformResourceURI(file.getFullPath().toString(), true); }
protected URI getURIForStorage(IStorage storage) { final URI uri = storage2uriMapper.getUri(storage); if (uri != null) { return uri; } return URI.createPlatformResourceURI(storage.getFullPath().toString(), true); }
/** * Load model. * * @param file * the source file * @return the Zen model * @throws IOException * Signals that an I/O exception has occurred. */ public static ZenModel loadModel(Injector injector, IFile file) throws IOException { URI modelUri = URI.createPlatformResourceURI(file.getFullPath().toString(), true); return loadModel(injector, modelUri); }
public URI createFileURI(String pathName) { return usePlatformURI() ? URI.createPlatformResourceURI(pathName, true) : URI.createFileURI(pathName); }
public boolean visit(IResource resource) throws CoreException { if (resource.getType() == IResource.FILE) { IPath fullPath = resource.getFullPath(); copy (URI.createPlatformResourceURI(fullPath.toString(), true), URI.createPlatformResourceURI(project.getName() + "/war/WEB-INF/classes/" + fullPath.removeFirstSegments(depth), true)); } return true; } },
public static URI getUriForPackageFragmentRoot(IPackageFragmentRoot root) { IResource underlyingResource = root.getResource(); if (underlyingResource == null) { return URI.createFileURI(root.getPath().toString()); } else { return URI.createPlatformResourceURI(underlyingResource.getFullPath().toString(), true); } }
protected URI resolvePath(IProject project, URI path) { IResource candidate = project.findMember(path.toString()); if (candidate != null && candidate.exists()) return URI.createPlatformResourceURI(project.getFullPath() + "/" + path, true); return path; }
public void setModelFile(IFile file) { if (file != null) { URI modelURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true); setModelLocation(modelURI.toString()); } else { setModelLocation(null); } }
private URI normalizeToWorkspaceURI(IPath path, String fragment) { URI result = null; IFile file = getFile(path); if (file == null || !file.exists()) file = getOutputFile(path); if (file != null) { result = URI.createPlatformResourceURI(file.getFullPath().toString()); result = appendFragment(result, fragment); } return result; }
protected Resource createResourceFor(IStorage storage) throws CoreException { ResourceSet resourceSet = getResourceSet(storage); URI uri = URI.createPlatformResourceURI(storage.getFullPath().toString(), true); configureResourceSet(resourceSet, uri); URI uriForResource = uri; if (!uri.isPlatform()) { uriForResource = resourceSet.getURIConverter().normalize(uri); } XtextResource resource = (XtextResource) resourceFactory.createResource(uriForResource); resourceSet.getResources().add(resource); resource.setValidationDisabled(isValidationDisabled(storage)); return resource; }
protected URI computeTraceURI(URI uri, IJavaProject javaProject) throws JavaModelException { for (IPackageFragmentRoot root : javaProject.getPackageFragmentRoots()) if (root.getKind() == IPackageFragmentRoot.K_SOURCE) { URI prefix = URI.createPlatformResourceURI(root.getResource().getFullPath().addTrailingSeparator().toString(), true); if (isPrefix(prefix, uri)) return uri.deresolve(prefix).trimFragment().trimQuery(); } return super.getURIForTrace(uri); } }
/** * * @return WsddResource from (@link getDeploymentDescriptorResource()) * */ public JaxrpcmapResource getJaxRPCMapXmiResource(String mappingFilePathURI) { URI uri = URI.createPlatformResourceURI(mappingFilePathURI); ResourceSet resSet = getArtifactEditModel().getResourceSet(); WTPResourceFactoryRegistry registry = (WTPResourceFactoryRegistry) resSet.getResourceFactoryRegistry(); registry.registerLastFileSegment(uri.lastSegment(), new JaxrpcmapResourceFactory(RendererFactory.getDefaultRendererFactory())); JaxrpcmapResource jaxrpcmapRes = (JaxrpcmapResource) resSet.getResource(uri, true); return jaxrpcmapRes; }