Package java.net

Examples of java.net.URI.toURL()


            return file.toURI().toURL();
        } else if (scheme.equals("file")) {
            File file = new File(location.substring(5));
            return file.toURI().toURL();
        } else {
            return uri.toURL();
        }
    }

    /**
     * Returns a link to a deployable composite.
View Full Code Here


            }
           
            // check whether node uri is an absolute url, 
            try {
                URI tmpURI = new URI(nodeURI);
                nodeURL = tmpURI.toURL();
            } catch(Exception ex) {
                throw new NodeException("node uri " +
                                        nodeURI +
                                        " must be a valid url");
            }
View Full Code Here

                // hosting the file
                response.sendRedirect(path);
            }
           
            // Read the file and write to response
            URLConnection connection = uri.toURL().openConnection();
            connection.setUseCaches(false);
            connection.connect();
            InputStream is = connection.getInputStream();
            ServletOutputStream os = response.getOutputStream();
            byte[] buffer = new byte[4096];
View Full Code Here

                        String location = imp.getLocationURI();
                        URI uri = URI.create(location);
                        if (uri.isAbsolute()) {
                            WSDLDefinition resolved;
                            try {
                                resolved = read(null, uri, uri.toURL());
                                imp.setDefinition(resolved.getDefinition());
                            } catch (Exception e) {
                                throw new ContributionResolveException(e);
                            }
                        } else {
View Full Code Here

                                // This is a relative URI against the WSDL document
                                URI baseURI = URI.create(model.getDefinition().getDocumentBaseURI());
                                URI locationURI = baseURI.resolve(location);
                                WSDLDefinition resolved;
                                try {
                                    resolved = read(null, locationURI, locationURI.toURL());
                                    imp.setDefinition(resolved.getDefinition());
                                } catch (Exception e) {
                                    throw new ContributionResolveException(e);
                                }
                            }
View Full Code Here

        try {
            // check whether domain uri is a url
            URI tmpURI;
            try {
                tmpURI = new URI(domainModel.getDomainURI());
                domainModel.setDomainURL(tmpURI.toURL().toExternalForm());
            } catch(Exception ex) {
                throw new ActivationException("domain uri " +
                                              domainModel.getDomainURI() +
                                              " must be a valid url");
            }
View Full Code Here

            // check where domain uris are urls, they will be used to configure various
            // endpoints if they are
            URI tmpURI;
            try {
                tmpURI = new URI(domainModel.getDomainURI());
                domainModel.setDomainURL(tmpURI.toURL().toExternalForm());
            } catch(Exception ex) {
                domainModel.setDomainURL(null);
            }           
         
            // Check if node has been given a valid domain name to connect to
View Full Code Here

   
    static private Document loadFromFile(String file) throws MalformedURLException, IOException,
        TransformerException, ParserConfigurationException {
        URI uri = URI.create(file);
        // URI resolution for relative uris is done when the composite is resolved.
        URL url = uri.toURL();
        URLConnection connection = url.openConnection();
        connection.setUseCaches(false);
        InputStream is = null;
        try {
            is = connection.getInputStream();
View Full Code Here

                        try
                        {                   
                            URI aLocationURI = URI.create(sLocation + "/" + "reportbuilderwizard.jar");

                            URL[] aURLs = new URL[1];
                            aURLs[0] = aLocationURI.toURL();
                            URLClassLoader aClassLoader = new URLClassLoader(aURLs, this.getClass().getClassLoader());
                            Class a = aClassLoader.loadClass("com.sun.star.wizards.reportbuilder.ReportBuilderImplementation");
                            Method aMethod = a.getMethod("create", new Class[]{XMultiServiceFactory.class, Resource.class});
                            CurReportDocument = (IReportDocument) aMethod.invoke(a, new Object[]{xMSF, m_oResource});
                        }
View Full Code Here

            if (!loc.isAbsolute()) {
                throw new IllegalArgumentException("Location '" + loc.toString() + "' is not absolute and no baseUri specified");
            }
        }
        InputSource inputSource = new InputSource();
        inputSource.setByteStream(loc.toURL().openStream());
        inputSource.setSystemId(loc.toString());
        read(inputSource);
    }
   
    public void read(InputSource inputSource) throws Exception {
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.