KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/resourcekind/VersionImpl.java,v 1.6 2004/08/05 14:43:32 dflorey Exp $
3  * $Revision: 1.6 $
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 VersionImpl extends AbstractResourceKind implements Version {
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 VersionImpl();
39         return singleton;
40     }
41     
42     /**
43      * Protected constructor
44      */

45     protected VersionImpl() {
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         if( isSupportedFeature(F_VERSION_CONTROL, excludedFeatures) ) {
60             s.add( P_PREDECESSOR_SET );
61             s.add( P_SUCCESSOR_SET );
62             s.add( P_CHECKOUT_SET );
63             s.add( P_VERSION_NAME );
64         }
65         if( isSupportedFeature(F_CHECKOUT_IN_PLACE, excludedFeatures)
66         || isSupportedFeature(F_WORKING_RESOURCE, excludedFeatures) ) {
67             s.add( P_CHECKOUT_FORK );
68             s.add( P_CHECKIN_FORK );
69         }
70         if( isSupportedFeature(F_VERSION_HISTORY, excludedFeatures) )
71             s.add( P_VERSION_HISTORY );
72         if( isSupportedFeature(F_LABEL, excludedFeatures) )
73             s.add( P_LABEL_NAME_SET );
74         if( isSupportedFeature(F_ACTIVITY, excludedFeatures) )
75             s.add( P_ACTIVITY_SET);
76         return s;
77     }
78
79     /**
80      * Get the set methods supported by this resource kind.
81      */

82     public Set JavaDoc getSupportedMethods() {
83         Set JavaDoc s = super.getSupportedMethods();
84         if( isSupportedFeature(F_LABEL) )
85             s.add( M_LABEL );
86         if( isSupportedFeature(F_WORKING_RESOURCE) )
87             s.add( M_CHECKOUT );
88         return s;
89     }
90
91     /**
92      * Get the set reports supported by this resource kind.
93      */

94     public Set JavaDoc getSupportedReports() {
95         Set JavaDoc s = super.getSupportedReports();
96         if( isSupportedFeature(F_VERSION_CONTROL) )
97             s.add( R_VERSION_TREE );
98         return s;
99     }
100     
101     /**
102      *
103      */

104     public String JavaDoc toString() {
105         return "version";
106     }
107 }
108
109
Popular Tags