Examples of URI


Examples of java.net.URI

    @Override
    public File getConfigFile(Context ctx) {
        URL configUrl = ctx.getConfigFile();
        if (configUrl != null) {
            try {
                URI configUri = configUrl.toURI();
                if ("file".equals(configUri.getScheme())) {
                    return new File(configUri.getPath());
                }
            } catch (Exception ex) {
                logger.error("Could not convert URL to URI: " + configUrl, ex);
            }
        }
View Full Code Here

Examples of java.net.URI

    public void writeExternal(ObjectOutput out) throws IOException {
        super.writeExternal(out);
        writeQuery(out);
        _fetchMethod.writeTo(out);

        final URI baseUri = _baseUri;
        final int fetchSize = _fetchSize;
        final float fetchGrow = _fetchGrow;
        final ShippedVariable[] varToShip = _varToShip;
        int frag = 0;
        if(baseUri != null) {
View Full Code Here

Examples of java.net.URI

                buf.append(" descending");
            }
            if(spec.isEmptyGreatest()) {
                buf.append(" empty greatest");
            }
            URI collation = spec.getCollation();
            if(collation != null) {
                buf.append(" collation ");
                buf.append(collation.toString());
            }
        }

        // return
        lineFeed();
View Full Code Here

Examples of java.net.URI

            if (getWorker() == null) {
                throw new IllegalStateException("No worker action specified for this worker process.");
            }

            final DefaultWorkerProcess workerProcess = new DefaultWorkerProcess();
            URI localAddress = server.accept(workerProcess.getConnectAction());

            List<URL> implementationClassPath = ClasspathUtil.getClasspath(getWorker().getClass().getClassLoader());
            Object id = idGenerator.generateId();
            String displayName = String.format("Gradle Worker %s", id);
View Full Code Here

Examples of java.net.URI

     * Returns the class name for use for this script source.  The name is intended to be unique to support mapping
     * class names to source files even if many sources have the same file name (e.g. build.gradle).
     */
    public String getClassName() {
        if (className == null) {
            URI sourceUri = resource.getURI();
            String name = StringUtils.substringAfterLast(sourceUri.getPath(), "/");
            StringBuilder className = new StringBuilder(name.length());
            for (int i = 0; i < name.length(); i++) {
                char ch = name.charAt(i);
                if (Character.isJavaIdentifierPart(ch)) {
                    className.append(ch);
                } else {
                    className.append('_');
                }
            }
            if (!Character.isJavaIdentifierStart(className.charAt(0))) {
                className.insert(0, '_');
            }
            className.append('_');
            String path = sourceUri.toString();
            className.append(HashUtil.createHash(path));

            this.className = className.toString();
        }

View Full Code Here

Examples of java.net.URI

        return resource;
    }

    public String getFileName() {
        File sourceFile = resource.getFile();
        URI sourceUri = resource.getURI();
        return sourceFile != null ? sourceFile.getPath() : sourceUri.toString();
    }
View Full Code Here

Examples of java.net.URI

    private URI createJar() throws URISyntaxException {
        TestFile jarFile = tmpDir.getDir().file("test.jar");
        testDir.file("ignoreme").write("content");
        testDir.zipTo(jarFile);
        return new URI(String.format("jar:%s!/build.script", jarFile.toURI()));
    }
View Full Code Here

Examples of java.net.URI

        assertThat(source.getResource().getFile(), equalTo(scriptFile));
    }

    @Test
    public void canConstructSourceFromJarURI() throws URISyntaxException {
        URI uri = createJar();
        UriScriptSource source = new UriScriptSource("<file-type>", uri);
        assertThat(source.getResource(), instanceOf(UriResource.class));
        assertThat(source.getResource().getURI(), equalTo(uri));
    }
View Full Code Here

Examples of java.net.URI

        assertThat(source.getDisplayName(), equalTo(String.format("<file-type> '%s'", scriptFile.getAbsolutePath())));
    }

    @Test
    public void usesScriptFileNameToBuildDescriptionWhenUsingHttpUri() throws URISyntaxException {
        UriScriptSource source = new UriScriptSource("<file-type>", new URI("http://www.gradle.org/unknown.txt"));
        assertThat(source.getDisplayName(), equalTo(String.format("<file-type> 'http://www.gradle.org/unknown.txt'")));
    }
View Full Code Here

Examples of java.net.URI

        assertThat(source.getFileName(), equalTo(scriptFile.getAbsolutePath()));
    }

    @Test
    public void usesScriptUriForFileNameUsingHttpUri() throws URISyntaxException {
        UriScriptSource source = new UriScriptSource("<file-type>", new URI("http://www.gradle.org/unknown.txt"));
        assertThat(source.getFileName(), equalTo("http://www.gradle.org/unknown.txt"));
    }
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.