Package java.net

Examples of java.net.URI.relativize()


          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


            List<org.opensaml.saml1.core.Attribute> attributes = statement.getAttributes();
            for (org.opensaml.saml1.core.Attribute attribute : attributes) {

                URI attributeNamespace = URI.create(attribute.getAttributeNamespace());
                String desiredRole = attributeNamespace.relativize(claimURI).toString();
                if (attribute.getAttributeName().equals(desiredRole)
                        && attribute.getAttributeValues() != null && !attribute.getAttributeValues().isEmpty()) {
                    return null;
                }
            }
View Full Code Here

      dest.send(constructor.createDocument(baseURI));
      dest.send(constructor.createElement(SERVER));
      dest.send(constructor.createCharacters("\n"));
     
      Element keystoreE = constructor.createElement(KEYSTORE);
      keystoreE.setAttributeValue("href",baseDir.relativize(keyStorePath.toURI()).toString());
      keystoreE.setAttributeValue("password",keyStorePassword);
      if (!keyStorePassword.equals(keyPassword)) {
         keystoreE.setAttributeValue("key-password",keyPassword);
      }
      dest.send(keystoreE);
View Full Code Here

      }
      dest.send(top);
      dest.send(constructor.createCharacters("\n"));
     
      Element keystoreE = constructor.createElement(AdminXML.NM_KEYSTORE);
      keystoreE.setAttributeValue("href",baseDir.relativize(keystoreFile.toURI()).toString());
      keystoreE.setAttributeValue("password",keystorePassword);
      if (!keystorePassword.equals(keyPassword)) {
         keystoreE.setAttributeValue("key-password",keyPassword);
      }
      dest.send(keystoreE);
View Full Code Here

      return term.resolve(".");
   }
  
   public String getName() {
      URI parent = getScheme();
      return parent.relativize(term).toString();
   }
  
   public static String getValue(Element category) {
     
      String value = category.getText();
View Full Code Here

      URI base = entryE.getBaseURI();
      for (String rel : linkset.keySet()) {
         List<Link> relLinks = linkset.get(rel);
         for (Link link : relLinks) {
            Element linkE = idPos<0 ? entryE.addElement(XML.LINK_NAME) : entryE.addElement(idPos,XML.LINK_NAME);
            linkE.setAttributeValue("href",base==null ? link.getLink().toString() : base.relativize(link.getLink()).toString());
            if (link.getType()!=null) {
               linkE.setAttributeValue("type",link.getType().toString());
            }
            linkE.setAttributeValue("rel",link.getRelation());
         }
View Full Code Here

         Reference ref = getRequest().getRootRef().clone().addSegment("R/");
         User user = (User)getRequest().getAttributes().get(App.USER_ATTR);
         URI root = URI.create(ref.toString());
         String path = null;
         try {
            path = root.relativize(new URI(dest)).toString();
            String [] segments = path.split("/");
            Feed targetParent = feed.getDB().findFeedByPath(segments, 0, segments.length-1);
            if (targetParent==null) {
               getResponse().setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
               return new StringRepresentation("Cannot find parent of destination "+dest);
View Full Code Here

            List<org.opensaml.saml1.core.Attribute> attributes = statement.getAttributes();
            for (org.opensaml.saml1.core.Attribute attribute : attributes) {

                URI attributeNamespace = URI.create(attribute.getAttributeNamespace());
                String desiredRole = attributeNamespace.relativize(claimURI).toString();
                if (attribute.getAttributeName().equals(desiredRole)
                        && attribute.getAttributeValues() != null && !attribute.getAttributeValues().isEmpty()) {
                    return null;
                }
            }
View Full Code Here

        return refragUri(rel, uri.getFragment()).toString();
      }

      // allow bare fragments
      URI self = u.getReferencePosition().source().getUri();
      String uristr = self.relativize(uri).toString();
      if (uristr.startsWith("#")) { return uristr; }
    } catch (URISyntaxException e) {
      // return null below
    }
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

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.