1 23 24 package org.apache.webdav.lib; 25 26 27 28 33 public class Privilege { 34 35 36 38 39 public static final Privilege ALL = 41 new Privilege(Constants.DAV, "all", null); 42 public static final Privilege READ = 43 new Privilege(Constants.DAV, "read", null); 44 public static final Privilege WRITE = 45 new Privilege(Constants.DAV, "write", null); 46 public static final Privilege READ_ACL = 47 new Privilege(Constants.DAV, "read-acl", null); 48 public static final Privilege WRITE_ACL = 49 new Privilege(Constants.DAV, "write-acl", null); 50 51 53 54 56 57 public Privilege(String namespace, String name, String parameter) { 58 this.namespace = namespace; 59 this.name = name; 60 this.parameter = parameter; 61 } 62 63 64 66 67 70 protected String namespace; 71 72 73 76 protected String name; 77 78 79 82 protected String parameter; 83 84 85 87 88 91 public String getNamespace() { 92 return namespace; 93 } 94 95 96 99 public String getName() { 100 return name; 101 } 102 103 104 107 public String getParameter() { 108 return parameter; 109 } 110 111 112 114 115 118 public boolean equals(Object obj) { 119 if ((obj == null) || !(obj instanceof Privilege)) { 120 return false; 121 } else { 122 if (this == obj) 123 return true; 124 Privilege privilege = (Privilege) obj; 125 if ((namespace.equals(privilege.getNamespace())) 126 && (name.equals(privilege.getName()))) { 127 if (parameter == null) { 128 if (privilege.getParameter() == null) 129 return true; 130 } else { 131 if (privilege.getParameter() != null) 132 return (parameter.equals(privilege.getParameter())); 133 } 134 } 135 } 136 return false; 137 } 138 139 140 } 141 | Popular Tags |