pnever      2002/07/17 05:24:38

  Modified:    src/webdav/server/org/apache/slide/webdav/method
                        OptionsMethod.java
  Log:
  Adapted to parameterized history and workspace paths (DeltaV)
  
  Revision  Changes    Path
  1.29      +30 -24    
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/OptionsMethod.java
  
  Index: OptionsMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/OptionsMethod.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- OptionsMethod.java        27 Jun 2002 10:49:58 -0000      1.28
  +++ OptionsMethod.java        17 Jul 2002 12:24:38 -0000      1.29
  @@ -100,12 +100,12 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Remy Maucherat</a>
    */
   public class OptionsMethod extends AbstractWebdavMethod
  -implements DeltavConstants, AclConstants {
  +    implements DeltavConstants, AclConstants {
       
       // An XML outputter
       private XMLOutputter xmlOut = new XMLOutputter(XML_REPONSE_INDENT, true, 
"UTF-8" );
       private Namespace xmlNs = NamespaceCache.DEFAULT_NAMESPACE;
  -//  private Namespace xmlNs = Namespace.getNamespace(DEFAULT_NAMESPACE);
  +    //  private Namespace xmlNs = Namespace.getNamespace(DEFAULT_NAMESPACE);
       
       // the collections which may contain VH or workspace resources are requested
       private boolean versionHistoryCollectionSetRequested = false;
  @@ -117,7 +117,7 @@
       
       /**
        * Constructor.
  -     * 
  +     *
        * @param token     the token for accessing the namespace
        * @param config    configuration of the WebDAV servlet
        */
  @@ -161,15 +161,15 @@
       }
       
       protected void executeRequest() throws WebdavException {
  -            
  -        /*
  -        We have been experiencing a strange behaviour with the *creation* of a
  -        Microsoft webfolder. When the DAV: header of an OPTIONS response
  -        becomes too long, an <The folder you entered does not appear to be
  -        valid. Please choose another.> error occurs.
           
  -        As a workaround we break-up the DAV: header into multiple DAV: header
  -        lines.
  +        /*
  +         We have been experiencing a strange behaviour with the *creation* of a
  +         Microsoft webfolder. When the DAV: header of an OPTIONS response
  +         becomes too long, an <The folder you entered does not appear to be
  +         valid. Please choose another.> error occurs.
  +         
  +         As a workaround we break-up the DAV: header into multiple DAV: header
  +         lines.
            */
           
           StringBuffer davHeader = new StringBuffer();
  @@ -250,14 +250,14 @@
                   methodsAllowed.append( ", VERSION-CONTROL, MKWORKSPACE, CHECKOUT, 
CHECKIN, UNCHECKOUT, LABEL, UPDATE" );
               if (Configuration.useSearch () && languages != null)
                   methodsAllowed.append( ", SEARCH" );
  -
  +            
           }
           else {
               methodsAllowed.append( "OPTIONS, MKCOL, PUT" );
               if( Configuration.useIntegratedLocking() )
                   methodsAllowed.append( ", LOCK" );
           }
  -                
  +        
           resp.addHeader("Allow", methodsAllowed.toString());
           
           if (Configuration.useSearch () && languages != null && resourceExists)
  @@ -277,19 +277,25 @@
               if( versionHistoryCollectionSetRequested ) {
                   Element vhcse =
                       new Element( E_VERSION_HISTORY_COLLECTION_SET, xmlNs );
  -                Element hre =
  -                    new Element( E_HREF,xmlNs );
  -                hre.addContent( getFullPath(hpath.toString()) );
  -                vhcse.addContent( hre );
  +                Iterator i = 
((HistoryPathHandler)hpath).getResolvedHistoryPaths().iterator();
  +                while( i.hasNext() ) {
  +                    Element hre =
  +                        new Element( E_HREF,xmlNs );
  +                    hre.addContent( getFullPath(String.valueOf(i.next())) );
  +                    vhcse.addContent( hre );
  +                }
                   ore.addContent( vhcse );
               }
               if( workspaceCollectionSetRequested ) {
                   Element wscse =
                       new Element( E_WORKSPACE_COLLECTION_SET, xmlNs );
  -                Element hre =
  -                    new Element( E_HREF, xmlNs );
  -                hre.addContent( getFullPath(wspath.toString()) );
  -                wscse.addContent( hre );
  +                Iterator i = 
((WorkspacePathHandler)wspath).getResolvedWorkspacePaths().iterator();
  +                while( i.hasNext() ) {
  +                    Element hre =
  +                        new Element( E_HREF, xmlNs );
  +                    hre.addContent( getFullPath(String.valueOf(i.next())) );
  +                    wscse.addContent( hre );
  +                }
                   ore.addContent( wscse );
               }
               try {
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to