Package java.net

Examples of java.net.URI.resolve()


                switch (t.getType()) {
                    case Token.STRING:
                    case Token.URI:
                        try {
                            URI parent = new URI(stylesheet.getURI());
                            info.setUri(parent.resolve(getTokenValue(t)).toString());
                        } catch (URISyntaxException e) {
                            throw new CSSParseException("Invalid URL, " + e.getMessage(), getCurrentLine());
                        }
                        skip_whitespace();
                        t = la();
View Full Code Here


  public static URI resolveBase(String base, File file) {
    try {
      if (base==null) return file.toURI();
      URI b = new URI(base);
      if (file==null) return b;
      if (base.toString().endsWith("/")) return b.resolve(new URI(file.getName()));
    } catch (URISyntaxException e) { // not fatal
    }
    return null;
  }
View Full Code Here

        if (!locURI.isAbsolute()) {
            try {
                String base = URIParserUtil.getAbsoluteURI(bindingFile);
                URI baseURI = new URI(base);
                locURI = baseURI.resolve(locURI);
            } catch (URISyntaxException e) {
                Message msg = new Message("NOT_URI", LOG, new Object[] {bindingFile});
                throw new ToolException(msg, e);
            }
View Full Code Here

    }

    static URI invertURI(URI baseUri) {
        URI resolutionUri = URI.create(".");
        for (URI test = baseUri; !test.equals(RELATIVE_MODULE_BASE_URI); test = test.resolve(RELATIVE_MODULE_BASE_URI)) {
            resolutionUri = resolutionUri.resolve(RELATIVE_MODULE_BASE_URI);
        }
        return resolutionUri;
    }

    protected WebAppDocument convertToServletSchema(XmlObject xmlObject) throws XmlException {
View Full Code Here

            return wsdlURI.toString();
        }

        public InputSource getImportInputSource(String parentLocation, String relativeLocation) {
            URI parentURI = URI.create(parentLocation);
            latestImportURI = parentURI.resolve(relativeLocation);
            InputStream importInputStream;
            try {
                ZipEntry entry = moduleFile.getEntry(latestImportURI.toString());
                importInputStream = moduleFile.getInputStream(entry);
                try {
View Full Code Here

                    }
                    start = path.lastIndexOf(remove);
                }
            }
            path = path.substring(start);
            File target = new File(targetURI.resolve(path));
            if (!target.exists()) {
                if (path.endsWith("/")) {
                    if (!target.mkdirs()) {
                        log.error("Plugin install cannot create directory " + target.getAbsolutePath());
                    }
View Full Code Here

            String newId = systemId;
            if (baseURI != null && systemId != null) {  //add additional systemId null check
                try {
                    URI uri = new URI(baseURI);
                    uri = uri.resolve(systemId);
                    newId = uri.toString();
                    if (newId.equals(systemId)) {
                        URL url = new URL(baseURI);
                        url = new URL(url, systemId);
                        newId = url.toExternalForm();
View Full Code Here

        }

        public InputSource getImportInputSource(String parentLocation,
                                                String relativeLocation) {
            URI parentURI = URI.create(parentLocation);
            latestImportURI = parentURI.resolve(relativeLocation);
            InputStream importInputStream;
            ZipEntry entry = moduleFile.getEntry(latestImportURI.toString());
            if (entry == null) {
                throw new RuntimeException(
                        "File does not exist in the module " + latestImportURI.toString());
View Full Code Here

        this.persistenceUnitRoot = persistenceUnitRoot;
        URI configurationBaseURI = new File(configurationBaseURL.getFile()).toURI();
        URL rootURL = null;
        List<URL> jarFileUrls = null;
        if (!excludeUnlistedClassesValue) {
            rootURL = configurationBaseURI.resolve(persistenceUnitRoot).normalize().toURL();
            jarFileUrls = new ArrayList<URL>();
            for (String urlString: jarFileUrlsUntyped) {
                URL url = configurationBaseURI.resolve(urlString).normalize().toURL();
                jarFileUrls.add(url);
            }
View Full Code Here

        List<URL> jarFileUrls = null;
        if (!excludeUnlistedClassesValue) {
            rootURL = configurationBaseURI.resolve(persistenceUnitRoot).normalize().toURL();
            jarFileUrls = new ArrayList<URL>();
            for (String urlString: jarFileUrlsUntyped) {
                URL url = configurationBaseURI.resolve(urlString).normalize().toURL();
                jarFileUrls.add(url);
            }
        }
        PersistenceUnitTransactionType persistenceUnitTransactionType = persistenceUnitTransactionTypeString == null? PersistenceUnitTransactionType.JTA: PersistenceUnitTransactionType.valueOf(persistenceUnitTransactionTypeString);
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.