Package com.github.sardine.model

Examples of com.github.sardine.model.Prop


    @Override
    public List<DavResource> list(String url, int depth, java.util.Set<QName> props) throws IOException
    {
        Propfind body = new Propfind();
        Prop prop = new Prop();
        ObjectFactory objectFactory = new ObjectFactory();
        prop.setGetcontentlength(objectFactory.createGetcontentlength());
        prop.setGetlastmodified(objectFactory.createGetlastmodified());
        prop.setCreationdate(objectFactory.createCreationdate());
        prop.setDisplayname(objectFactory.createDisplayname());
        prop.setGetcontenttype(objectFactory.createGetcontenttype());
        prop.setResourcetype(objectFactory.createResourcetype());
        prop.setGetetag(objectFactory.createGetetag());
        List<Element> any = prop.getAny();
        for (QName entry : props) {
            Element element = SardineUtil.createElement(entry);
            any.add(element);
        }
        body.setProp(prop);
View Full Code Here


    Propertyupdate body = new Propertyupdate();
    // Add properties
    {
      Set set = new Set();
      body.getRemoveOrSet().add(set);
      Prop prop = new Prop();
      // Returns a reference to the live list
      List<Element> any = prop.getAny();
      for (Map.Entry<QName, String> entry : setProps.entrySet())
      {
        Element element = SardineUtil.createElement(entry.getKey());
        element.setTextContent(entry.getValue());
        any.add(element);
      }
      set.setProp(prop);
    }
    // Remove properties
    {
      Remove remove = new Remove();
      body.getRemoveOrSet().add(remove);
      Prop prop = new Prop();
      // Returns a reference to the live list
      List<Element> any = prop.getAny();
      for (QName entry : removeProps)
      {
        Element element = SardineUtil.createElement(entry);
        any.add(element);
      }
View Full Code Here

  public DavAcl getAcl(String url) throws IOException
  {
    HttpPropFind entity = new HttpPropFind(url);
    entity.setDepth("0");
    Propfind body = new Propfind();
    Prop prop = new Prop();
    prop.setOwner(new Owner());
    prop.setGroup(new Group());
    prop.setAcl(new Acl());
    body.setProp(prop);
    entity.setEntity(new StringEntity(SardineUtil.toXml(body), UTF_8));
    Multistatus multistatus = this.execute(entity, new MultiStatusResponseHandler());
    List<Response> responses = multistatus.getResponse();
    if (responses.isEmpty())
View Full Code Here

  public DavQuota getQuota(String url) throws IOException
  {
    HttpPropFind entity = new HttpPropFind(url);
    entity.setDepth("0");
    Propfind body = new Propfind();
    Prop prop = new Prop();
    prop.setQuotaAvailableBytes(new QuotaAvailableBytes());
    prop.setQuotaUsedBytes(new QuotaUsedBytes());
    body.setProp(prop);
    entity.setEntity(new StringEntity(SardineUtil.toXml(body), UTF_8));
    Multistatus multistatus = this.execute(entity, new MultiStatusResponseHandler());
    List<Response> responses = multistatus.getResponse();
    if (responses.isEmpty())
View Full Code Here

  public List<DavPrincipal> getPrincipals(String url) throws IOException
  {
    HttpPropFind entity = new HttpPropFind(url);
    entity.setDepth("1");
    Propfind body = new Propfind();
    Prop prop = new Prop();
    prop.setDisplayname(new Displayname());
    prop.setResourcetype(new Resourcetype());
    prop.setPrincipalURL(new PrincipalURL());
    body.setProp(prop);
    entity.setEntity(new StringEntity(SardineUtil.toXml(body), UTF_8));
    Multistatus multistatus = this.execute(entity, new MultiStatusResponseHandler());
    List<Response> responses = multistatus.getResponse();
    if (responses.isEmpty())
View Full Code Here

  public List<String> getPrincipalCollectionSet(String url) throws IOException
  {
    HttpPropFind entity = new HttpPropFind(url);
    entity.setDepth("0");
    Propfind body = new Propfind();
    Prop prop = new Prop();
    prop.setPrincipalCollectionSet(new PrincipalCollectionSet());
    body.setProp(prop);
    entity.setEntity(new StringEntity(SardineUtil.toXml(body), UTF_8));
    Multistatus multistatus = this.execute(entity, new MultiStatusResponseHandler());
    List<Response> responses = multistatus.getResponse();
    if (responses.isEmpty())
View Full Code Here

   * @throws java.io.IOException When there is a JAXB error
   */
  protected String getToken(InputStream stream)
      throws IOException
  {
    Prop prop = SardineUtil.unmarshal(stream);
    return prop.getLockdiscovery().getActivelock().iterator().next().getLocktoken().getHref().iterator().next();
  }
View Full Code Here

   * count against the DAV:quota-available-bytes.
   */
  private final long quotaUsedBytes;

  public DavQuota(Response response) {
    Prop prop = response.getPropstat().get(0).getProp();
    this.quotaAvailableBytes = Long.valueOf(prop.getQuotaAvailableBytes().getContent().get(0));
    this.quotaUsedBytes = Long.valueOf(prop.getQuotaUsedBytes().getContent().get(0));
  }
View Full Code Here

TOP

Related Classes of com.github.sardine.model.Prop

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.