Package org.apache.webdav.lib

Examples of org.apache.webdav.lib.Property


     * <code>org.apache.webdav.lib.properties</code> package.
     */
    protected static Property convertElementToProperty(
        Response response, Element element) {

        Property property = null;
        String namespace = DOMUtils.getElementNamespaceURI(element);

        // handle DAV properties specially
        if (namespace != null && namespace.equals("DAV:")) {

View Full Code Here


                out.println();
            }
            ResponseEntity response = (ResponseEntity) responses.nextElement();
            Enumeration properties = response.getProperties();
            while (properties.hasMoreElements()){
                Property property = (Property)properties.nextElement();
                out.println("   " + property.getName() + " : " + property.getPropertyAsString());
            }
        }
        catch (Exception ex) {
            handleException(ex);
        }
View Full Code Here

   public static Property findProperty(PropFindMethod propFind,
                                        PropertyName name,
                                        String path)
   {
      Enumeration e = propFind.getResponseProperties(path);
      Property p = findProperty(e, name);
      // a collection requested as /a/col/path/ may be as
      // /a/col/path in the response
      if (p == null && path.endsWith("/")) {
         e = propFind.getResponseProperties(path.substring(0, path.length()-1));
         p = findProperty(e, name);
View Full Code Here

    * @param name
    * @return the property searched for of <code>null</code> if not found.
    */
   public static Property findProperty(Enumeration e, PropertyName name) {
      while (e.hasMoreElements()) {
         Property p = (Property)e.nextElement();
        
         if (p.getNamespaceURI().equals(name.getNamespaceURI()) &&
             p.getLocalName().equals(name.getLocalName()))
         {
            return p;
         }
      }
      return null;
View Full Code Here

      propFind.setFollowRedirects(true);
      propFind.setPropertyNames(props.elements());
      int status = client.executeMethod(propFind);
      switch (status) {
         case WebdavStatus.SC_MULTI_STATUS:
            Property p = findProperty(propFind, RESOURCETYPE, httpURL.getPath());
            if (p instanceof ResourceTypeProperty) {
               return ((ResourceTypeProperty)p).isCollection();
            } else {
               throw new WebdavException("PROPFFIND does not return resourcetype");
            }
View Full Code Here

      propFind.setFollowRedirects(true);
     
      int status = client.executeMethod(propFind);
      switch (status) {
         case WebdavStatus.SC_MULTI_STATUS:
            Property p = findProperty(propFind, GETLASTMODIFIED, url.getPath());
            if (p != null) {
               try {
                  Date d = GETLASTMODIFIED_FORMAT.parse(p.getPropertyAsString());
                  return d.getTime();
               }
               catch (ParseException e) {
                  throw new HttpException("Invalid lastmodified property: " +
                        p.getPropertyAsString());
               }
            }
            throw new HttpException("PROPFIND does not return lastmodified.");
         default:
            HttpException ex = new HttpException();
View Full Code Here

   public Property getProperty(String uri, PropertyName propertyName)
   {
      List properties = (List)this.resourceMap.get(uri);
      if (properties != null) {
         for(Iterator i = properties.iterator(); i.hasNext();) {
            Property p = (Property)i.next();
            if (p.getLocalName().equals(propertyName.getLocalName()) &&
                p.getNamespaceURI().equals(propertyName.getNamespaceURI()))
            {
               return p;
            }
         }
      }
View Full Code Here

                out.println();
            }
            ResponseEntity response = (ResponseEntity) responses.nextElement();
            Enumeration properties = response.getProperties();
            while (properties.hasMoreElements()){
                Property property = (Property)properties.nextElement();
                out.println("   " + property.getName() + " : " + property.getPropertyAsString());
            }
        }
        catch (Exception ex) {
            handleException(ex);
        }
View Full Code Here

        List values = new ArrayList();
        for ( Enumeration e = searchMethod.getAllResponseURLs(); e.hasMoreElements(); ) {
            Map searchResults = new HashMap();
            String uri = (String)e.nextElement();
            for ( Enumeration pe = searchMethod.getResponseProperties(uri); pe.hasMoreElements(); ) {
              Property property = (Property)pe.nextElement();
        searchResults.put(property.getLocalName(), property.getPropertyAsString());
          }
      if ( uri.indexOf(domain) != -) {
        uri = uri.substring(uri.indexOf(domain)+domain.length());
      }
      searchResults.put("uri", uri);
View Full Code Here

          throw new IOException("Received status code "+state+" when doing PROPPATH on URI="+uri);
        }
    }

    public Value getPropertyAsStringValue(URI uri, String namespace, String name, Credentials credentials) throws IOException {
    Property property = getProperty(uri, namespace, name, credentials);
    if ( property == null ) return null;
        return new StringValue(property.getPropertyAsString());
    }
View Full Code Here

TOP

Related Classes of org.apache.webdav.lib.Property

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.