org.jboss.portal.core.portlet.cms
Class WebDAVUtil

java.lang.Object
  extended by org.apache.webdav.lib.WebdavSession
      extended by org.apache.webdav.lib.WebdavResource
          extended by org.jboss.portal.core.portlet.cms.WebDAVUtil

public class WebDAVUtil
extends org.apache.webdav.lib.WebdavResource

Helper class for dealing with the webdav server. This class handles file path, connection, and all issues related to the webdav resource obj.


Field Summary
static java.util.regex.Pattern RELATIVE_URI_PATTERN
           
 
Fields inherited from class org.apache.webdav.lib.WebdavResource
ALL, allowedMethods, BASIC, childResources, creationDate, CREATIONDATE, davCapabilities, DEFAULT, defaultAction, defaultDepth, defaultOwner, displayName, DISPLAYNAME, exists, FALSE, followRedirects, formats, GETCONTENTLANGUAGE, getContentLength, GETCONTENTLENGTH, getContentType, GETCONTENTTYPE, getEtag, GETETAG, getLastModified, GETLASTMODIFIED, gmtZone, httpURL, isCollection, ISCOLLECTION, isHidden, ISHIDDEN, LABEL_ADD, LABEL_REMOVE, LABEL_SET, latestStatusCode, latestStatusMessage, lockDiscovery, LOCKDISCOVERY, NAME, NOACTION, OPTIONS_VERSION_HISTORY, OPTIONS_WORKSPACE, overwrite, owner, resourceType, RESOURCETYPE, SOURCE, supportedLock, SUPPORTEDLOCK, tempDirForGet, thisResource, TRUE, useDiskForGet
 
Fields inherited from class org.apache.webdav.lib.WebdavSession
client, debug, hostCredentials, proxyCredentials, proxyHost, proxyPort
 
Constructor Summary
WebDAVUtil()
           
 
Method Summary
 java.lang.String cleanDoubleSlashes(java.lang.String sPath)
          Helper method, cleans up double slashes if they exist.
 void connectInit(java.lang.String sURI, java.lang.String sUname, java.lang.String sPW)
          Connects to webdav server from the coreservlet on binary content-type calls.
 void connectInit(org.apache.webdav.lib.WebdavResource wdResource, CMSPortlet cmsPortlet)
          Deprecated. Init() in cmsportlet has made this obsolete.
 void createDefaultData(java.lang.String sSlideRoot)
          Creates default data (homepage, support page, and images dir) if doesnt exist.
 java.lang.String fetchParentPath(java.lang.String sPath)
          Helper method, returns the path to the parent from the given path.
 java.lang.String getCreateDate(org.apache.webdav.lib.WebdavResource wdResource)
          Gets creation date, as the slide getCreationDate() method is broken.
 org.apache.webdav.lib.WebdavResource getResource()
          Returns the initialized webdav resource.
 java.lang.String getSecuredRoot(java.lang.String sPath, java.lang.String sRootPath)
          Used in permissions function to obtain the root directory an admin *may* be allowed to edit in.
 java.lang.String killTrailingSlash(java.lang.String sPath)
           
 void setCurrentPath(org.apache.webdav.lib.WebdavResource wdResource, java.lang.String sPath)
          Sets the path to the collection in the webdavresource obj.
 
Methods inherited from class org.apache.webdav.lib.WebdavResource
abortTransaction, aclfindMethod, aclfindMethod, aclMethod, aclReportMethod, bindMethod, bindMethod, checkinMethod, checkinMethod, checkoutMethod, checkoutMethod, close, commitTransaction, compareTo, compareToWebdavResource, copyMethod, copyMethod, createWebdavResource, deleteMethod, deleteMethod, discoverLock, discoverOwnLocks, discoverOwnLocks, endTransaction, equals, executeHttpRequestMethod, exists, generateIfHeader, generateTransactionHeader, getActiveLockOwners, getAllowedMethods, getChildResources, getCreationDate, getDavCapabilities, getDefaultAction, getDefaultDepth, getDisplayName, getExistence, getFollowRedirects, getGetContentLength, getGetContentType, getGetEtag, getGetLastModified, getGetTempDir, getGetUseDisk, getHost, getHttpURL, getHttpURLExceptForUserInfo, getIsCollection, getIsHidden, getLockDiscovery, getMethod, getMethod, getMethodData, getMethodData, getMethodDataAsString, getMethodDataAsString, getName, getOverwrite, getOwner, getPath, getResourceType, getStatusCode, getStatusMessage, getSupportedLock, getTransactionHandle, headMethod, headMethod, isCollection, isLocked, isTheClient, labelMethod, labelMethod, list, listBasic, listWebdavResources, lockDiscoveryPropertyFindMethod, lockDiscoveryPropertyFindMethod, lockMethod, lockMethod, lockMethod, lockMethod, lockMethod, lockMethod, lockMethod, lockMethod, mkcolMethod, mkcolMethod, mkWorkspaceMethod, mkWorkspaceMethod, moveMethod, moveMethod, optionsMethod, optionsMethod, optionsMethod, optionsMethod, optionsMethod, optionsMethod, parseDate, pollMethod, pollMethod, principalCollectionSetFindMethod, principalCollectionSetFindMethod, processProperty, propfindMethod, propfindMethod, propfindMethod, propfindMethod, propfindMethod, propfindMethod, propfindMethod, propfindMethod, proppatchMethod, proppatchMethod, proppatchMethod, proppatchMethod, proppatchMethod, proppatchMethod, proppatchMethod, proppatchMethod, proppatchMethod, proppatchMethod, proppatchMethod, proppatchMethod, putMethod, putMethod, putMethod, putMethod, putMethod, putMethod, putMethod, putMethod, putMethod, putMethod, rebindMethod, rebindMethod, refresh, reportMethod, reportMethod, reportMethod, reportMethod, reportMethod, retrieveSessionInstance, setAllProp, setBasicProperties, setClient, setClient, setContentType, setCreationDate, setCreationDate, setDefaultAction, setDefaultDepth, setDefaultProperties, setDisplayName, setEncodeURLs, setExistence, setFollowRedirects, setGetContentLength, setGetContentLength, setGetContentType, setGetEtag, setGetLastModified, setGetLastModified, setGetTempDir, setGetUseDisk, setHttpURL, setHttpURL, setHttpURL, setHttpURL, setHttpURL, setHttpURL, setHttpURL, setIsCollection, setIsCollection, setIsHidden, setIsHidden, setLockDiscovery, setNamedProp, setNameProperties, setOverwrite, setPath, setProperties, setProperties, setResourceType, setStatusCode, setStatusCode, setSupportedLock, setUserInfo, setWebdavProperties, startTransaction, subscribeMethod, subscribeMethod, subscribeMethod, toString, unbindMethod, unbindMethod, uncheckoutMethod, uncheckoutMethod, unlockMethod, unlockMethod, unlockMethod, unsubscribeMethod, unsubscribeMethod, updateMethod, updateMethod, versionControlMethod, versionControlMethod
 
Methods inherited from class org.apache.webdav.lib.WebdavSession
closeSession, closeSession, getSessionInstance, getSessionInstance, setCredentials, setDebug, setProxy, setProxyCredentials
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RELATIVE_URI_PATTERN

public static final java.util.regex.Pattern RELATIVE_URI_PATTERN
Constructor Detail

WebDAVUtil

public WebDAVUtil()
Method Detail

connectInit

public void connectInit(java.lang.String sURI,
                        java.lang.String sUname,
                        java.lang.String sPW)
                 throws java.io.IOException,
                        org.apache.commons.httpclient.HttpException,
                        java.net.MalformedURLException
Connects to webdav server from the coreservlet on binary content-type calls.

Parameters:
sURI -
sUname -
sPW -
Throws:
java.io.IOException
org.apache.commons.httpclient.HttpException
java.net.MalformedURLException

setCurrentPath

public void setCurrentPath(org.apache.webdav.lib.WebdavResource wdResource,
                           java.lang.String sPath)
                    throws java.io.IOException,
                           org.apache.commons.httpclient.HttpException
Sets the path to the collection in the webdavresource obj.

Parameters:
wdResource -
sPath -
Throws:
java.io.IOException
org.apache.commons.httpclient.HttpException

fetchParentPath

public java.lang.String fetchParentPath(java.lang.String sPath)
Helper method, returns the path to the parent from the given path.

Parameters:
sPath -
Returns:

killTrailingSlash

public java.lang.String killTrailingSlash(java.lang.String sPath)

cleanDoubleSlashes

public java.lang.String cleanDoubleSlashes(java.lang.String sPath)
Helper method, cleans up double slashes if they exist.

Parameters:
sPath -
Returns:

connectInit

public void connectInit(org.apache.webdav.lib.WebdavResource wdResource,
                        CMSPortlet cmsPortlet)
                 throws PortletException,
                        java.io.IOException,
                        UnavailableException
Deprecated. Init() in cmsportlet has made this obsolete.

Instantiates a connection to the webdav server if one does not already exist.

Parameters:
cmsPortlet -
Throws:
PortletException
java.io.IOException
UnavailableException

createDefaultData

public void createDefaultData(java.lang.String sSlideRoot)
Creates default data (homepage, support page, and images dir) if doesnt exist.


getResource

public org.apache.webdav.lib.WebdavResource getResource()
Returns the initialized webdav resource.

Returns:

getCreateDate

public java.lang.String getCreateDate(org.apache.webdav.lib.WebdavResource wdResource)
Gets creation date, as the slide getCreationDate() method is broken.

Returns:

getSecuredRoot

public java.lang.String getSecuredRoot(java.lang.String sPath,
                                       java.lang.String sRootPath)
Used in permissions function to obtain the root directory an admin *may* be allowed to edit in.

Parameters:
sPath -
Returns: