1 23 24 package org.apache.slide.webdav.util.resourcekind; 25 26 import java.util.Set ; 27 28 29 public class VersionImpl extends AbstractResourceKind implements Version { 30 31 protected static ResourceKind singleton = null; 32 33 36 static public ResourceKind getInstance() { 37 if( singleton == null ) 38 singleton = new VersionImpl(); 39 return singleton; 40 } 41 42 45 protected VersionImpl() { 46 } 47 48 57 public Set getSupportedLiveProperties( String [] excludedFeatures ) { 58 Set 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 82 public Set getSupportedMethods() { 83 Set 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 94 public Set getSupportedReports() { 95 Set s = super.getSupportedReports(); 96 if( isSupportedFeature(F_VERSION_CONTROL) ) 97 s.add( R_VERSION_TREE ); 98 return s; 99 } 100 101 104 public String toString() { 105 return "version"; 106 } 107 } 108 109 | Popular Tags |