Package java.net

Examples of java.net.URI.toURL()


                bus.getExtension(ServiceContractResolverRegistry.class);
            if (null != registry) {
                URI uri = registry.getContractLocation(name);
                if (null != uri) {
                    try {
                        url = uri.toURL();
                    } catch (MalformedURLException e) {
                        LOG.log(Level.FINE, "resolve qname failed", name);
                        throw new WebServiceException(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

                    .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

          "http",
          NetUtils.getHostPortString(cluster.getNameNode().getHttpAddress()),
          "/webhdfs/v1/", op.toQueryString(), null);
     
      // non-proxy request
      HttpURLConnection conn = (HttpURLConnection) uri.toURL().openConnection();
      conn.setRequestMethod(op.getType().toString());
      conn.connect();
      assertEquals(200, conn.getResponseCode());
      conn.disconnect();
      assertEquals(1, DummyAuditLogger.logCount);
View Full Code Here

      conn.disconnect();
      assertEquals(1, DummyAuditLogger.logCount);
      assertEquals("127.0.0.1", DummyAuditLogger.remoteAddr);
     
      // non-trusted proxied request
      conn = (HttpURLConnection) uri.toURL().openConnection();
      conn.setRequestMethod(op.getType().toString());
      conn.setRequestProperty("X-Forwarded-For", "1.1.1.1");
      conn.connect();
      assertEquals(200, conn.getResponseCode());
      conn.disconnect();
View Full Code Here

      assertEquals("127.0.0.1", DummyAuditLogger.remoteAddr);
     
      // trusted proxied request
      conf.set(ProxyServers.CONF_HADOOP_PROXYSERVERS, "127.0.0.1");
      ProxyUsers.refreshSuperUserGroupsConfiguration(conf);
      conn = (HttpURLConnection) uri.toURL().openConnection();
      conn.setRequestMethod(op.getType().toString());
      conn.setRequestProperty("X-Forwarded-For", "1.1.1.1");
      conn.connect();
      assertEquals(200, conn.getResponseCode());
      conn.disconnect();
View Full Code Here

    final String scheme = DFSUtil.getHttpClientScheme(conf);
    URI address = DFSUtil.getInfoServerWithDefaultHost(fsName.getHost(), conf,
        scheme);
    LOG.debug("Will connect to NameNode at " + address);
    return address.toURL();
  }

  /**
   * Create a new checkpoint
   * @return if the image is fetched from primary or not
View Full Code Here

        // Translate into a file list
        List<File> fileList = getFileList(uri);
        if (fileList == null) {
            // The first element was not a file:// URI. Assume it was a URL.
        try {
                URLDataFlavorHandler.launchCellFromURL(uri.toURL());
            } catch (MalformedURLException excp) {
                logger.log(Level.WARNING, "Unable to form URL from URI " +
                        uri.toString(), excp);
        }
View Full Code Here

        // Translate into a file list
        List<File> fileList = getFileList(uri);
        if (fileList == null) {
            // The first element was not a file:// URI. Assume it was a URL.
            try {
                URLDataFlavorHandler.importURL(uri.toURL(), listener);
            } catch (MalformedURLException excp) {
                listener.importFailure(excp, "Unable to form URL from URI " +
                                       uri.toString());
            }
View Full Code Here

    }

    public SImage(URI baseURI, String fileName) throws IOException {
        URI fileURI = baseURI.resolve(fileName);
        this.file = new File(fileURI);
        img = ImageIO.read(fileURI.toURL());
        image = Image.create(this.img);
        init();
    }

    public SImage(BufferedImage img, String relativeURL) {
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.