Package java.net

Examples of java.net.URI.toURL()


        if (localRepo == null)
            return false;

        final URI localRepoRootUri = localRepo.getRootURI();
        try {
            final VirtualFile localRepoFile = VfsUtil.findFileByURL(localRepoRootUri.toURL());
            final FileFinder finder = new FileFinder(localRepoFile, pArtifact);
            IDEUtils.runCommand(project, finder);
            return finder.isFound();
        }
        catch (MalformedURLException e) {
View Full Code Here


   private URL getURL(final Method method, final LinkHeaderParam link, ClientRequestContext context)
   {
      URI uri = getURI(method, link, context);
      try
      {
         return uri == null ? null : uri.toURL();
      }
      catch (MalformedURLException e)
      {
         throw new RuntimeException(String.format("Could not create a URL for %s in %s.%s", uri
                 .toASCIIString(), method.getClass().getName(), method.getName()), e);
View Full Code Here

      String uriBase = "http://localhost:" + TestPortProvider.getPort() + "/test/path-param/";
      String expected = "start" + toTest + "end";
      String encoded = "start%" + Integer.toHexString(toTest).toUpperCase() + "end";
      URI uri = URI.create(uriBase + encoded);

      HttpURLConnection connection = (HttpURLConnection) uri.toURL().openConnection();
      connection.setRequestMethod("GET");
      connection.setRequestProperty("accept", "text/plain");
      InputStream is = connection.getInputStream();
      Reader r = new InputStreamReader(is, "UTF-8");
      StringBuffer buf = new StringBuffer();
View Full Code Here

            if (getAutoRedirects()){
                HttpUriRequest req = (HttpUriRequest) localContext.getAttribute(ExecutionContext.HTTP_REQUEST);
                HttpHost target = (HttpHost) localContext.getAttribute(ExecutionContext.HTTP_TARGET_HOST);
                URI redirectURI = req.getURI();
                if (redirectURI.isAbsolute()){
                    res.setURL(redirectURI.toURL());
                } else {
                    res.setURL(new URL(new URL(target.toURI()),redirectURI.toString()));
                }
            }
View Full Code Here

        long timestamp = 0;
        if ("file".equals(wsdlURI.getScheme())) {
            timestamp = new File(wsdlURI).lastModified();
        } else {
            try {
                timestamp = wsdlURI.toURL().openConnection().getDate();
            } catch (Exception e) {
                //ignore
            }
        }
       
View Full Code Here

            }
            if (url == null) {
                try {
                    URI propResourceUri = URI.create(propResourceName);
                    if (propResourceUri.getScheme() != null) {
                        url = propResourceUri.toURL();
                    } else {
                        File f = new File(propResourceUri.toString());
                        if (f.exists()) {
                            url = f.toURI().toURL();
                        }
View Full Code Here

       
        String name = ATT_UUID + "-" + String.valueOf(++counter);
        if (ns != null && (ns.length() > 0)) {
            try {
                URI uri = new URI(ns);
                String host = uri.toURL().getHost();
                cid = host;
            } catch (Exception e) {
                cid = ns;
            }
        }
View Full Code Here

    public Document getDocument(String wsdl) throws ToolException {
        try {
            URI wsdlURI = new URI(URIParserUtil.getAbsoluteURI(wsdl));
            if (wsdlURI.toString().startsWith("http")) {
                return getDocument(wsdlURI.toURL());
            }
            return getDocument(wsdlURI.toURL());
        } catch (ToolException e) {
            throw e;
        } catch (Exception e) {
View Full Code Here

        try {
            URI wsdlURI = new URI(URIParserUtil.getAbsoluteURI(wsdl));
            if (wsdlURI.toString().startsWith("http")) {
                return getDocument(wsdlURI.toURL());
            }
            return getDocument(wsdlURI.toURL());
        } catch (ToolException e) {
            throw e;
        } catch (Exception e) {
            throw new ToolException(e);
        }
View Full Code Here

                    .getExtension(ServiceContractResolverRegistry.class);
                if (null != registry) {
                    URI uri = registry.getContractLocation(this.getServiceQName());
                    if (null != uri) {
                        try {
                            wsdlURL = uri.toURL().toString();
                        } catch (MalformedURLException e) {
                            LOG.log(Level.FINE, "resolve qname failed", this.getServiceQName());
                        }
                    }
                }
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.