1 package com.ibm.webdav; 2 3 15 16 25 public class CollectionMember implements java.io.Serializable 26 { 27 private Collection parent = null; 28 private Resource resource = null; 29 private MultiStatus properties = null; 30 private String name = null; 37 public CollectionMember(Collection parent, Resource resource, MultiStatus initialProperties) throws WebDAVException { 38 this.parent = parent; 39 this.resource = resource; 40 this.properties = initialProperties; 41 String parentURI = parent.getURL().getFile(); 42 String memberURI = resource.getURL().getFile(); 43 name = memberURI.substring(parentURI.length()); 44 if (name.startsWith("/")) { 46 name = name.substring(1); 47 } 48 } 49 53 public CollectionMember(Resource resource) throws WebDAVException { 54 this.parent = null; 55 this.properties = null; 56 this.resource = resource; 57 name = resource.getURL().toString(); 58 } 59 63 public String getName() { 64 return name; 65 } 66 70 public Collection getParent() { 71 return parent; 72 } 73 79 public PropertyResponse getProperties() { 80 PropertyResponse response = (PropertyResponse) properties.getResponses().nextElement(); 81 return response; 82 } 83 86 public Resource getResource() { 87 return resource; 88 } 89 93 public String toString() { 94 return getName(); 95 } 96 } 97 | Popular Tags |