Package java.net

Examples of java.net.URI


      URL url = Thread.currentThread().getContextClassLoader().getResource(CoreConstants.SYSTEM_VDB);
      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


                    //header.
                    //If the new URI is again referring to a resource in the server to which the original request
                    //is sent, then replace the hostname and port of the URI with the hostname and port of synapse
                    //We are not changing the request url here, only the host name and the port.
                    try {
                        URI serviceURI = new URI(servicePrefix);
                        URI endpointURI = new URI(endpointURLPrefix);
                        URI locationURI = new URI(header.getValue());

                        if (locationURI.getHost().equalsIgnoreCase(endpointURI.getHost())) {
                            URI newURI = new URI(locationURI.getScheme(), locationURI.getUserInfo(),
                                    serviceURI.getHost(), serviceURI.getPort(), locationURI.getPath(),
                                    locationURI.getQuery(), locationURI.getFragment());
                            headerMap.put(header.getName(), newURI.toString());
                            responseMsgCtx.setProperty(NhttpConstants.SERVICE_PREFIX,
                                    outMsgCtx.getProperty(NhttpConstants.SERVICE_PREFIX));
                        }
                    } catch (URISyntaxException e) {
                        log.error(e.getMessage(), e);
View Full Code Here

      tempCacheString = tempCacheString.replace('\\', '/');
      if (tempCacheString.startsWith("file://") && !tempCacheString.startsWith("file:///")) {
        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

                return false;
            }
        } catch (XQException e) {
        }
        // getSchemaURI() is equal
        final URI uri = getSchemaURI(), thatUri = objtype.getSchemaURI();
        if(uri == null) {
            if(thatUri != null) {
                return false;
            }
        } else if(!uri.equals(thatUri)) {
            return false;
        }
        // if getTypeName() is supported for the item kind, it must be equal
        try {
            final QName typeName = getTypeName(), thatTypeName = objtype.getTypeName();
View Full Code Here

    }

    @Override
    public int hashCode() {
        int hashCode = getItemKind();
        final URI schemaUri = getSchemaURI();
        if(schemaUri != null) {
            hashCode = 31 * hashCode + schemaUri.hashCode();
        }
        //if getBaseType() is supported for the item kind
        try {
            hashCode = 31 * hashCode + getBaseType();
        } catch (XQException e) {
View Full Code Here

                break;
              }
            }
            else {
              try {
                URI uri = new URI(name);
                addPluginFile(new File(uri), files);
              } catch (URISyntaxException e) { // ignore
              }
              if (!files.isEmpty()) {
                break;
View Full Code Here

            }
            return col;
        } else {
            final Collator col;
            try {
                URI baseuri = statEnv.getBaseURI();
                final URI targetUri;
                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 URI getBaseUri() {
        final URI baseuri;
        if(_baseUri != null) {
            baseuri = ResourceUtils.buildURI(_baseUri);
        } else {
            if(_queryFile != null) {
                baseuri = _queryFile.toURI();
View Full Code Here

        ci.out.println("> Command 'hack': Not enough parameters for subcommand parameter 'port'.");
        return false;
      }
      TRTrackerAnnouncer client = dm.getTrackerClient();
      try {
        URI uold = new URI(client.getTrackerURL().toString());
        String portStr = (String) args.get(0);
        URI unew = new URI(uold.getScheme(), uold.getUserInfo(), uold.getHost(), Integer.parseInt(portStr), uold.getPath(), uold.getQuery(), uold.getFragment());
        client.setTrackerURL(new URL(unew.toString()));
        ci.out.println("> Set Tracker URL for '"+dm.getSaveLocation()+"' to '"+unew.toString()+"'");
      } catch (Exception e) {
        ci.out.println("> Command 'hack': Assembling new tracker url failed: "+e.getMessage());
        return false;
      }
      return true;
View Full Code Here

        ci.out.println("> Command 'hack': Not enough parameters for subcommand parameter 'host'.");
        return false;
      }
      TRTrackerAnnouncer client = dm.getTrackerClient();
      try {
        URI uold = new URI(client.getTrackerURL().toString());
        URI unew = new URI(uold.getScheme(), uold.getUserInfo(), (String)args.get(0), uold.getPort(), uold.getPath(), uold.getQuery(), uold.getFragment());
        client.setTrackerURL(new URL(unew.toString()));
        ci.out.println("> Set Tracker URL for '"+dm.getSaveLocation()+"' to '"+unew.toString()+"'");
      } catch (Exception e) {
        ci.out.println("> Command 'hack': Assembling new tracker url failed: "+e.getMessage());
        return false;
      }
      return true;
View Full Code Here

TOP

Related Classes of java.net.URI

Copyright © 2018 www.massapicom. 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.