Package java.net

Examples of java.net.URI.relativize()


        // Both URIs with empty hosts
        b = new URI("file:///~/second");
        assertEquals("Assert 3: URI relativized incorrectly,", new URI(
                "file:///~/second"), a.relativize(b));
        assertEquals("Assert 4: URI relativized incorrectly,", new URI(
                "file:///~/first"), b.relativize(a));
    }

    /**
     * @tests java.net.URI#relativize(java.net.URI)
     */
 
View Full Code Here


        a = new URI("file:///~/dictionary");
        b = new URI("file://tools/~/dictionary");
        assertEquals("relativized incorrectly,", new URI(
                "file://tools/~/dictionary"), a.relativize(b));
        assertEquals("relativized incorrectly,",
                new URI("file:///~/dictionary"), b.relativize(a));

        // two URIs with empty hosts
        b = new URI("file:///~/therasus");
        assertEquals("relativized incorrectly,", new URI("file:///~/therasus"),
                a.relativize(b));
View Full Code Here

        // two URIs with empty hosts
        b = new URI("file:///~/therasus");
        assertEquals("relativized incorrectly,", new URI("file:///~/therasus"),
                a.relativize(b));
        assertEquals("relativized incorrectly,",
                new URI("file:///~/dictionary"), b.relativize(a));

        URI one = new URI("file:/C:/test/ws");
        URI two = new URI("file:/C:/test/ws");

        URI empty = new URI("");
View Full Code Here

        String url;
        // We need to relativize the method url to the host config
        // so that the hostConfiguration is not overriden by the executeMethod call
        try {
            java.net.URI uri = new URI(this.url);
            uri = uri.relativize(new URI(hostConfiguration.getHostURL()));
            url = uri.toString();
        } catch (Exception e1) {
            url = this.url;
        }
        PostMethod method = new PostMethod(url);
View Full Code Here

            URI baseURI = configurationDir.getAbsoluteFile().toURI();
            Collection files = listRecursiveFiles(configurationDir);
            for (Iterator iterator = files.iterator(); iterator.hasNext();) {
                File file = (File) iterator.next();
                String relativePath = baseURI.relativize(file.toURI()).getPath();
                if (!EXCLUDED.contains(relativePath)) {
                    InputStream in = new FileInputStream(file);
                    try {
                        out.putNextEntry(new ZipEntry(relativePath));
                        try {
View Full Code Here

        props.setProperty("file-xfer-root", parent.getPath().replace('\\', '/'));
        URI parentURI = parent.toURI();
        try {
            context.getOutboundPayload().attachFile(
                    "text/xml",
                    parentURI.relativize(localFile.toURI()),
                    "sync-load-balancer-xml",
                    props,
                    tmpLbXmlFile);
        } catch (IOException ex) {
            String msg = LbLogUtil.getStringManager().getString(
View Full Code Here

    String priorLastKey = null;
    do {
      PartialListing listing = store.list(key, S3_MAX_LISTING_LENGTH, priorLastKey, false);
      for (FileMetadata fileMetadata : listing.getFiles()) {
        Path subpath = keyToPath(fileMetadata.getKey());
        String relativePath = pathUri.relativize(subpath.toUri()).getPath();

        if (fileMetadata.getKey().equals(key + "/")) {
          // this is just the directory we have been asked to list
        }
        else if (relativePath.endsWith(FOLDER_SUFFIX)) {
View Full Code Here

          status.add(newFile(fileMetadata, subpath));
        }
      }
      for (String commonPrefix : listing.getCommonPrefixes()) {
        Path subpath = keyToPath(commonPrefix);
        String relativePath = pathUri.relativize(subpath.toUri()).getPath();
        status.add(newDirectory(new Path(absolutePath, relativePath)));
      }
      priorLastKey = listing.getPriorLastKey();
    } while (priorLastKey != null);
   
View Full Code Here

    a = new URI("file:///~/first");
    b = new URI("file://tools/~/first");
    assertEquals("Assert 1: URI relativized incorrectly,",
        new URI("file://tools/~/first"), a.relativize(b));   
    assertEquals("Assert 2: URI relativized incorrectly,",
        new URI("file:///~/first"), b.relativize(a));   

    // Both URIs with empty hosts
    b = new URI("file:///~/second");
    assertEquals("Assert 3: URI relativized incorrectly,",
        new URI("file:///~/second"), a.relativize(b));
View Full Code Here

    // Both URIs with empty hosts
    b = new URI("file:///~/second");
    assertEquals("Assert 3: URI relativized incorrectly,",
        new URI("file:///~/second"), a.relativize(b));
    assertEquals("Assert 4: URI relativized incorrectly,",
        new URI("file:///~/first"), b.relativize(a));
  }
   
    public void test_relativizeBasedOneEclipseCoreResources() throws URISyntaxException {
        URI one = new URI("file:/C:/test/ws");
        URI two = new URI("file:/C:/test/ws");
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.