Package java.net

Examples of java.net.URI.toURL()


          if (locationURI == null) {
            getLog().info("Invalid repository URL specified : " + location +", will be ignored");
            return null;
          }
         
          return locationURI.toURL();
    }
        catch(MalformedURLException exc) {
        getLog().info("Invalid repository URL specified : " + location +", will be ignored");
        return null;
    }
View Full Code Here


                if (sessionId != null) {
                    // pass the current session id via basic auth and special "password"
                    uriBuilder.userInfo(sessionId + ":session");
                }
                builtUrl = uriBuilder.build();
                return builtUrl.toURL();
            } catch (MalformedURLException e) {
                // TODO handle this properly
                LOG.error("Could not build target URL", e);
                throw new RuntimeException(e);
            }
View Full Code Here

            {
                URL url = ((URLResource) res).getURL();
                uri = URI.create(url.toString()).resolve(IBldProject.PROJECT_FILE);
                try
                {
                    InputStream stream = uri.toURL().openStream(); // check file
                    // exists
                    stream.close();
                }
                catch (IOException e)
                {
View Full Code Here

   */
  public InputStream getInputStream() throws IOException {
      if ( this.dataUri != null ) {
          try {
              final URI uri = new URI(this.dataUri);
              return uri.toURL().openStream();
          } catch (final URISyntaxException use) {
              throw (IOException)new IOException().initCause(use);
          }
      }
      if (this.dataFile != null && this.dataFile.exists() ) {
View Full Code Here

        boolean useResourceUri = resourceUri != null;
        if ( resourceUri != null ) {
            InputStream resourceUriIS = null;
            try {
                final URI uri = new URI(resourceUri);
                resourceUriIS = uri.toURL().openStream();
                // everything fine
            } catch (final Exception use) {
                useResourceUri = false;
            } finally {
                if ( resourceUriIS != null ) {
View Full Code Here

    URI settings = appendPath(this.projectBase, "/" + IDavinciServerConstants.SETTINGS_DIRECTORY_NAME);
    URI dojoConfig = appendPath(settings, "/" + fileName);
   
    Properties props = new OrderedProperties();
    try {
      props.load(dojoConfig.toURL().openStream());
    } catch (IOException e) {
      // TODO Auto-generated catch block
      return null;
    }
    return props;
View Full Code Here

            redirectedUrl = extractRedirectedUrl(url, localContext);

            URI permRedirectUri = (URI)localContext.getAttribute(PERM_REDIRECT_CONTEXT_KEY);
            if (permRedirectUri != null) {
                newBaseUrl = permRedirectUri.toURL().toExternalForm();
            }

            Integer redirects = (Integer)localContext.getAttribute(REDIRECT_COUNT_CONTEXT_KEY);
            if (redirects != null) {
                numRedirects = redirects.intValue();
View Full Code Here

        List<Path> remotePaths = new ArrayList<Path>();
        for (Path path : libraryPaths) {
            URI uri = path.toUri();
            assert uri.getScheme() != null;
            if (uri.getScheme().equals("file")) {
                localUrls.add(uri.toURL());
            }
            Path remote = resolved.get(path);
            if (remote == null) {
                remotePaths.add(path);
            } else {
View Full Code Here

  public static Model loalRDFModel(String uriModel) {
    try {
      Model model = createDefaultRDFModel();

      URI uri = new URI(uriModel);
      InputStream inputStream = uri.toURL().openStream();
      model.read(inputStream, "");
      return model;
    } catch (MalformedURLException e) {
      System.err.println(e);
      return null;
View Full Code Here

                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

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.