Package java.net

Examples of java.net.URI.toURL()


            tryArchive(archiveBase + u.toString());

            if (is != null) {
                if (u.isAbsolute()) {
                    url = u.toURL();
                }
                return;
            }
        } catch (URISyntaxException e) {
            // do nothing
View Full Code Here


                relative = new URI(uriStr.replaceAll(" ", "%20"));
            }
           
            if (relative.isAbsolute()) {
                uri = relative;
                url = relative.toURL();

                try {
                    HttpURLConnection huc = (HttpURLConnection)url.openConnection();

                    String host = System.getProperty("http.proxyHost");
View Full Code Here

                base = base.resolve(relative);
                if (base.isAbsolute()) {
                    try {
                        baseFile = new File(base);
                        if (baseFile.exists()) {
                            is = base.toURL().openStream();
                            uri = base;
                        } else {
                            tryClasspath(base.toString().startsWith("file:")
                                         ? base.toString().substring(5) : base.toString());
                        }
View Full Code Here

        }

        if (is == null) {
            try {
                pathURI = new URI(uri);
                streamURL = pathURI.toURL();
                is = streamURL.openStream();
            } catch (Throwable t) {
                //Exception handling not needed
            }
        }
View Full Code Here

                // Can't use URI.resolve() because "jar:..." URLs are not valid
                // hierarchical URIs so resolve() does not work. new URL()
                // delegates to the jar: stream handler and it manages to figure
                // it out.
                URI baseUri = new URI(base);
                systemUri = new URL(baseUri.toURL(), systemId).toURI();
            }
            systemUri = systemUri.normalize();
        } catch (URISyntaxException e) {
            // May be caused by a | being used instead of a : in an absolute
            // file URI on Windows.
View Full Code Here

            entryMap = new TreeMap<String,ZipTreeNode>();
            final URI uri = URIHelper.retrieveFileURI((IEditorInput) newInput);
            if (uri != null) {
                ZipInputStream zis = null;
                try {
                    zis = new ZipInputStream(uri.toURL().openStream());
                    ZipEntry entry;
                    while ( (entry = zis.getNextEntry()) != null) {
                        ZipTreeNode.addEntry(entryMap, entry);
                    }
                    zis.close();
View Full Code Here

        URL[] urls = new URL[webClassPath.length];
        for (int i = 0; i < webClassPath.length; i++) {
            URI classPathEntry = webClassPath[i];
            classPathEntry = root.resolve(classPathEntry);
            urls[i] = classPathEntry.toURL();
        }
        this.webClassLoader = new JettyClassLoader(urls, webAppRootURL, classLoader, contextPriorityClassLoader);
        setClassLoader(this.webClassLoader);

        setHosts(virtualHosts);
View Full Code Here

        InputStream inputStream = null;
        URI resolvedSystemIDURI;
        try {
            resolvedSystemIDURI = localRepositoryURI.resolve(fileName);
            inputStream = resolvedSystemIDURI.toURL().openStream();
        } catch (IOException e) {
            return null;
        } catch (IllegalArgumentException e) {
            //typically "uri is not absolute"
            return null;
View Full Code Here

        }
        URL[] webClassPathURLs = new URL[webClassPath.length];
        for (int i = 0; i < webClassPath.length; i++) {
            URI path = baseUri.resolve(webClassPath[i]);
            try {
                webClassPathURLs[i] = path.toURL();
            } catch (MalformedURLException e) {
                throw new DeploymentException("Invalid web class path element: path=" + path + ", baseUri=" + baseUri);
            }
        }
View Full Code Here

        if (ct.equalsIgnoreCase("application/x-www-form-urlencoded")) {
            parseQueryString(qs, new String(request.getContent().array(), "UTF-8"));
        }

        String u = requestUri.toURL().toString();
        int last = u.indexOf("?") == -1 ? u.length() : u.indexOf("?");
        String url = u.substring(0, last);
        int l;

        if (url.contains(config.mappingPath())) {
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.