Package java.net

Examples of java.net.URI.toURL()


      if (url == null) {
        throw new TeiidRuntimeException(RuntimeMetadataPlugin.Util.getString("system_vdb_not_found")); //$NON-NLS-1$
      }
      // uri conversion is only to remove the spaces in URL, note this only with above kind situation 
      URI uri = new URI(url.getProtocol(), url.getPath(), null);
      this.vdbRepository.setSystemStore(new IndexMetadataFactory(uri.toURL()).getMetadataStore(null));
    } catch (URISyntaxException e) {
      throw new TeiidRuntimeException(e, RuntimePlugin.Util.getString("system_vdb_load_error")); //$NON-NLS-1$
    } catch (IOException e) {
      throw new TeiidRuntimeException(e, RuntimePlugin.Util.getString("system_vdb_load_error")); //$NON-NLS-1$
    }
View Full Code Here


        tempCacheString = tempCacheString.substring(7);
        tempCacheString = "file:///" + tempCacheString;
      }
      URI tempURI = new URI(tempCacheString);
//      System.err.println(" -- " + tempURI.toString());
      CACHE_URL = tempURI.toURL();
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    if (!cacheDir.exists()) {
View Full Code Here

                if(baseuri == null) {
                    targetUri = URI.create(uri);
                } else {
                    targetUri = baseuri.resolve(uri);
                }
                URL targetUrl = targetUri.toURL();
                InputStream is = targetUrl.openStream();
                String rules = IOUtils.toString(is);
                col = new RuleBasedCollator(rules);
            } catch (Exception e) {
                return null;
View Full Code Here

    private static Reader readQuery(String viewloc, StaticContext staticEnv) throws XQueryException {
        URI resolved = ResolveUri.resolveURI(viewloc, staticEnv);
        final URL queryUrl;
        try {
            queryUrl = resolved.toURL();
        } catch (MalformedURLException e) {
            throw new DynamicError("Invalid URL form: " + viewloc);
        }
        final InputStream is;
        try {
View Full Code Here

    }

    // Create the CatalogGen with the config doc InputStream
    try
    {
      me = new CatalogGen( configDocIs, configDocUri.toURL());
    }
    catch ( MalformedURLException e )
    {
      String tmpMsg = "MalformedURLException thrown creating URL w/ resource URI <" + configDocUri.toString() + ">: " + e.getMessage();
      log.debug( "expandConfigDoc(): " + tmpMsg, e);
View Full Code Here

    IPersonalAttachment pPAttachment = pDownload.getAttachment();

    URI lLink = pPAttachment.getLink();
    URL lUrl;
    try {
      lUrl = lLink.toURL();
    } catch (MalformedURLException e) {
      // mmmhh bad link. let's exist.
      throw new NetworkException(e.getMessage());
    }
View Full Code Here

        link = (URI) object;

      if (link != null) {
        IWorkbenchBrowserSupport browser = PlatformUI.getWorkbench().getBrowserSupport();
        try {
          browser.createBrowser(WebBrowserView.EDITOR_ID).openURL(link.toURL());
        } catch (PartInitException e) {
          Activator.getDefault().getLog().log(e.getStatus());
        } catch (MalformedURLException e) {
          Activator.getDefault().getLog().log(Activator.getDefault().createErrorStatus(e.getMessage(), e));
        }
View Full Code Here

              ((EmbeddedWebBrowser) browser).setContext(fContext);
            else
              ((EmbeddedWebBrowser) browser).setContext(WebBrowserContext.createFrom(title));

            try {
              browser.openURL(link.toURL());
            } catch (MalformedURLException e) { //see Bug 1441
              ((EmbeddedWebBrowser) browser).openURL(link);
            }
          }
View Full Code Here

            }
          }

          /* Any other Web Browser Support */
          else
            browser.openURL(link.toURL());
        } catch (PartInitException e) {
          Activator.getDefault().getLog().log(e.getStatus());
        } catch (MalformedURLException e) {
          Activator.getDefault().getLog().log(Activator.getDefault().createErrorStatus(e.getMessage(), e));
        }
View Full Code Here

        if (localRepo == null)
            return null;

        final URI localRepoRootUri = localRepo.getRootURI();
        try {
            return VfsUtil.findFileByURL(localRepoRootUri.toURL());
        }
        catch (MalformedURLException e) {
            LOG.error(e.getMessage(), e);
            return null;
        }
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.