Package java.net

Examples of java.net.URI.resolve()


        } else {
            URI classURI = null;
            try {
                classURI = new URI(annotatedClassName.replace('.', '/'));
            } catch (final URISyntaxException ignore) {}
            final String handlerChainConfigFileResourcePath = classURI.resolve(handlerChainConfigFile).toString();
            final VirtualFile config = resourceRoot.getRoot().getChild(handlerChainConfigFileResourcePath);
            if (config.exists() && config.isFile()) {
                return config.openStream();
            }
View Full Code Here


                    base = baseFile.toURI();
                } else {
                    base = new URI(baseUriStr);
                }
               
                base = base.resolve(relative);
                if (base.isAbsolute() && "file".equalsIgnoreCase(base.getScheme())) {
                    try {
                        // decode space before create a file
                        baseFile = new File(base.getPath().replace("%20", " "));
                        if (baseFile.exists()) {
View Full Code Here

            // computed according to the SCA Web Service binding spec.
            String nsName = component.getName() + "/" + contractName;
            String namespaceURI = null;
            try {
                URI userTNS = new URI(def.getTargetNamespace());
                namespaceURI = userTNS.resolve("/" + nsName).toString();
            } catch (URISyntaxException e1) {
                throw new WSDLGenerationException(e1);
            } catch (IllegalArgumentException e2) {
                throw new WSDLGenerationException(e2);
            }
View Full Code Here

        if (!locURI.isAbsolute()) {
            try {
                String base = URIParserUtil.getAbsoluteURI(bindingFile);
                URI baseURI = new URI(base);
                locURI = baseURI.resolve(locURI);
            } catch (URISyntaxException e) {
                Message msg = new Message("NOT_URI", LOG, new Object[] {bindingFile});
                throw new ToolException(msg, e);
            }
View Full Code Here

     * @tests java.net.URI#resolve(java.net.URI)
     */
    public void test_resolve() throws URISyntaxException {
        URI uri1 = null, uri2 = null;
        uri1 = new URI("file:/D:/one/two/three");
        uri2 = uri1.resolve(new URI(".."));

        assertEquals("Resolved to incorrect URI", "file:/D:/one/", uri2
                .toString());
        assertTrue("Resolved URI is not absolute", uri2.isAbsolute());
        assertFalse("Resolved URI is opaque", uri2.isOpaque());
View Full Code Here

            URL configurationBaseURL,
            ClassLoader classLoader) throws URISyntaxException, MalformedURLException, ResourceException {
        List<String> mappingFileNames = mappingFileNamesUntyped == null? NO_STRINGS: new ArrayList<String>(mappingFileNamesUntyped);
        this.persistenceUnitRoot = persistenceUnitRoot;
        URI configurationBaseURI = new File(configurationBaseURL.getFile()).toURI();
        URL rootURL = configurationBaseURI.resolve(persistenceUnitRoot).normalize().toURL();
        List<URL> jarFileUrls = NO_URLS;
        if (!excludeUnlistedClassesValue) {
            jarFileUrls = new ArrayList<URL>();
            //Per the EJB3.0 Persistence Specification section 6.2, the jar-file should be related to the Persistence Unit Root, which is the jar or directory where the persistence.xml is found            
            URI persistenceUnitBaseURI = configurationBaseURI.resolve(persistenceUnitRoot);
View Full Code Here

        if (!excludeUnlistedClassesValue) {
            jarFileUrls = new ArrayList<URL>();
            //Per the EJB3.0 Persistence Specification section 6.2, the jar-file should be related to the Persistence Unit Root, which is the jar or directory where the persistence.xml is found            
            URI persistenceUnitBaseURI = configurationBaseURI.resolve(persistenceUnitRoot);
            for (String urlString: jarFileUrlsUntyped) {
                URL url = persistenceUnitBaseURI.resolve(urlString).normalize().toURL();
                jarFileUrls.add(url);
            }
        }
        if (managedClassNames == null) {
            managedClassNames = NO_STRINGS;
View Full Code Here

            }
            URL[] urls = new URL[manifestcp.size()];
            int i = 0;
            for (String path : manifestcp) {
                path = path.replaceAll(" ", "%20");
                URL url = moduleBaseURI.resolve(path).toURL();
                urls[i++] = url;
            }
            ResourceFinder finder = new ResourceFinder("", null, urls);
            List<URL> knownPersistenceUrls = (List<URL>) rootGeneralData.get(PersistenceUnitBuilder.class.getName());
            if (knownPersistenceUrls == null) {
View Full Code Here

    }

    static URI invertURI(URI baseUri) {
        URI resolutionUri = URI.create(".");
        for (URI test = baseUri; !test.equals(RELATIVE_MODULE_BASE_URI); test = test.resolve(RELATIVE_MODULE_BASE_URI)) {
            resolutionUri = resolutionUri.resolve(RELATIVE_MODULE_BASE_URI);
        }
        return resolutionUri;
    }

    protected WebAppDocument convertToServletSchema(XmlObject xmlObject) throws XmlException {
View Full Code Here

                        }
                        if (!file.getName().endsWith(".jar")) {
                            log.debug("Only jar files are added to classpath, file [" + file.getAbsolutePath() + "] is ignored");
                            continue;
                        }
                        addToClassPath(moduleBaseUri, resolutionUri, targetUri.resolve(file.getName()), classpath, exclusions, factory, problems);
                    }
                } else {
                    if (!pathUri.getPath().endsWith(".jar")) {
                        if (manifestClassLoaderMode == MFCP_STRICT) {
                            problems.add(new DeploymentException(printInfo(
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.