KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > webdav > util > resourcekind > DeltavCompliantImpl


1 /*
2  * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/resourcekind/DeltavCompliantImpl.java,v 1.9 2004/08/05 14:43:32 dflorey Exp $
3  * $Revision: 1.9 $
4  * $Date: 2004/08/05 14:43:32 $
5  *
6  * ====================================================================
7  *
8  * Copyright 1999-2002 The Apache Software Foundation
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */

23
24 package org.apache.slide.webdav.util.resourcekind;
25
26 import java.util.Set JavaDoc;
27
28
29 public class DeltavCompliantImpl extends AbstractResourceKind implements DeltavCompliant {
30     
31     protected static ResourceKind singleton = null;
32     
33     /**
34      * Factory method.
35      */

36     static public ResourceKind getInstance() {
37         if( singleton == null )
38             singleton = new DeltavCompliantImpl();
39         return singleton;
40     }
41     
42     /**
43      * Protected constructor
44      */

45     protected DeltavCompliantImpl() {
46     }
47     
48     /**
49      * Get the set properties supported by this resource kind.
50      * @param filter Q_PROTECTED_ONLY or Q_COMPUTED_ONLY (no filtering if null)
51      * @param excludedFeatures array of F_* constants (no filtering if null or empty)
52      * @see org.apache.slide.webdav.util.WebdavConstants
53      * @see org.apache.slide.webdav.util.DeltavConstants
54      * @see org.apache.slide.webdav.util.AclConstants
55      * @see org.apache.slide.webdav.util.DaslConstants
56      */

57     public Set JavaDoc getSupportedLiveProperties( String JavaDoc[] excludedFeatures ) {
58         Set JavaDoc s = super.getSupportedLiveProperties( excludedFeatures );
59         s.add( P_CREATIONDATE );
60         s.add( P_MODIFICATIONDATE );
61         s.add( P_DISPLAYNAME );
62         s.add( P_GETCONTENTLANGUAGE );
63         s.add( P_GETCONTENTLENGTH );
64         s.add( P_GETCONTENTTYPE );
65         s.add( P_GETETAG );
66         s.add( P_GETLASTMODIFIED );
67         s.add( P_RESOURCETYPE );
68         s.add( P_SOURCE );
69         if( isSupportedFeature(F_LOCKING, excludedFeatures) ) {
70             s.add( P_LOCKDISCOVERY );
71             s.add( P_SUPPORTEDLOCK );
72         }
73         if( isSupportedFeature(F_ACCESS_CONTROL, excludedFeatures) ) {
74             s.add( P_OWNER );
75             s.add( P_CREATIONUSER );
76             s.add( P_MODIFICATIONUSER );
77             s.add( P_SUPPORTED_PRIVILEGE_SET );
78             s.add( P_CURRENT_USER_PRIVILEGE_SET );
79             s.add( P_ACL );
80             s.add( P_ACL_RESTRICTIONS );
81             s.add( P_INHERITED_ACL_SET );
82             s.add( P_PRINCIPAL_COLLECTION_SET );
83             s.add( P_PRIVILEGE_COLLECTION_SET );
84         }
85         if (isSupportedFeature(F_BINDING, excludedFeatures)) {
86             s.add( P_RESOURCE_ID );
87             s.add( P_PARENT_SET );
88         }
89         if( isSupportedFeature(F_VERSION_CONTROL, excludedFeatures) ) {
90             s.add( P_COMMENT );
91             s.add( P_CREATOR_DISPLAYNAME );
92             s.add( P_SUPPORTED_METHOD_SET );
93             s.add( P_SUPPORTED_LIVE_PROPERTY_SET );
94             s.add( P_SUPPORTED_REPORT_SET );
95         }
96         if( isSupportedFeature(F_WORKSPACE, excludedFeatures) )
97             s.add( P_WORKSPACE );
98         if( isSupportedFeature(F_BASELINE, excludedFeatures) )
99             s.add( P_VERSION_CONTROLLED_CONFIGURATION );
100         return s;
101     }
102     
103     /**
104      * Get the set methods supported by this resource kind.
105      */

106     public Set JavaDoc getSupportedMethods() {
107         Set JavaDoc s = super.getSupportedMethods();
108         s.add( M_CONNECT );
109         s.add( M_COPY );
110         s.add( M_DELETE );
111         s.add( M_GET );
112         s.add( M_HEAD );
113         s.add( M_MOVE );
114         s.add( M_OPTIONS );
115         s.add( M_POST );
116         s.add( M_PROPFIND );
117         s.add( M_PROPPATCH );
118         s.add( M_PUT );
119         s.add( M_TRACE );
120         if( isSupportedFeature(F_LOCKING) ) {
121             s.add( M_LOCK );
122             s.add( M_UNLOCK );
123         }
124         if( isSupportedFeature(F_ACCESS_CONTROL) )
125             s.add( M_ACL );
126         if( isSupportedFeature(F_ACCESS_CONTROL) || isSupportedFeature(F_VERSION_CONTROL) )
127             s.add( M_REPORT );
128         if( isSupportedFeature(F_SEARCHING_AND_LOCATING) ) {
129             s.add( M_SEARCH );
130         }
131         return s;
132     }
133     
134     /**
135      * Get the set reports supported by this resource kind.
136      */

137     public Set JavaDoc getSupportedReports() {
138         Set JavaDoc s = super.getSupportedReports();
139         if( isSupportedFeature(F_ACCESS_CONTROL) || isSupportedFeature(F_VERSION_CONTROL) )
140             s.add( R_EXPAND_PROPERTY );
141         return s;
142     }
143 }
144
145
Popular Tags