Package java.net

Examples of java.net.URI.resolve()


            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

                    }
                    start = path.lastIndexOf(remove);
                }
            }
            path = path.substring(start);
            File target = new File(targetURI.resolve(path));
            if (!target.exists()) {
                if (path.endsWith("/")) {
                    if (!target.mkdirs()) {
                        log.error("Plugin install cannot create directory " + target.getAbsolutePath());
                    }
View Full Code Here

            // add base URI for relative links
            URI base = uriInfo.getAbsolutePath();
            if (synd.getBase() != null) {
                base = URI.create(synd.getBase());
            }
            return base.resolve(uri).getRawPath(); // keep the path escaped
        } else {
            return uri.getRawPath(); // keep the path escaped
        }
    }
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

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

                    }
                    start = path.lastIndexOf(remove);
                }
            }
            path = path.substring(start);
            File target = new File(targetURI.resolve(path));
            if (!target.exists()) {
                if (path.endsWith("/")) {
                    if (!target.mkdirs()) {
                        log.error("Plugin install cannot create directory " + target.getAbsolutePath());
                    }
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

        }

        public InputSource getImportInputSource(String parentLocation,
                                                String relativeLocation) {
            URI parentURI = URI.create(parentLocation);
            latestImportURI = parentURI.resolve(relativeLocation);
            InputStream importInputStream;
            ZipEntry entry = moduleFile.getEntry(latestImportURI.toString());
            if (entry == null) {
                throw new RuntimeException(
                        "File does not exist in the module " + latestImportURI.toString());
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

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.