com.jalios.jcms.webdav.cat
Class CatWebdavUtil

java.lang.Object
  extended by com.jalios.jcms.webdav.cat.CatWebdavUtil

public class CatWebdavUtil
extends Object


Field Summary
static String REVISION
           
 
Constructor Summary
CatWebdavUtil()
           
 
Method Summary
static String encodeWebDavUrl(String s)
          Convenient method to encode a WebDav URL using webdav encoding.
static String getCustomProtocolScheme()
          Retrieve the custom protocol scheme (default is "jcmsoffice").
static String getDataName(Data data, boolean urlEncode)
          Retrieve the name of the Data as it should be used in WebDav.
static String getParentPath(FileDocument doc, boolean urlEncode)
          Retrieve the WebDav path of the first valid parent folder of the specified FileDocument.
static String getPath(Category cat, Workspace ws, boolean urlEncode)
          Retrieve the WebDav path of the specified category in the specified workspace.
static String getPath(FileDocument doc, boolean urlEncode)
          Retrieve the WebDav path of the specified FileDocument.
static String getPath(Workspace ws, boolean urlEncode)
          Retrieve the WebDav path of the specified Workspace.
static Category getRootCategory()
          Retrieve the global root category to be used for webdav
static boolean isCustomProtocolEnabled()
          Check if the use of the custom protocol for WebDav edition link is enabled
static boolean isWebdavEditable(FileDocument doc)
          Check if the specified document can be edited through WebDAV.
static boolean isWebdavEditable(FileDocument doc, Member mbr)
          Check if the specified document can be edited through WebDAV by the specified member.
static boolean isWin32LnkEnabled()
          Check if the use of Win32 lnk for webdav edition is enabled.
static boolean useDigestAuthentication()
          Check if HTTP Digest authentification should be used in WebDav.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values
Constructor Detail

CatWebdavUtil

public CatWebdavUtil()
Method Detail

isWin32LnkEnabled

public static boolean isWin32LnkEnabled()
Check if the use of Win32 lnk for webdav edition is enabled.

Returns:
true if it is enabled, false otherwise
Since:
jcms-6.1

isCustomProtocolEnabled

public static boolean isCustomProtocolEnabled()
Check if the use of the custom protocol for WebDav edition link is enabled

Returns:
true if it is enabled, false otherwise
Since:
jcms-6.1

getCustomProtocolScheme

public static String getCustomProtocolScheme()
Retrieve the custom protocol scheme (default is "jcmsoffice").

Returns:
an URI scheme.
Since:
jcms-6.1

isWebdavEditable

public static boolean isWebdavEditable(FileDocument doc)
Check if the specified document can be edited through WebDAV.

Parameters:
doc - the FileDocument to check
Returns:
true if can be edited, false otherwise
Since:
jcms-6.1

isWebdavEditable

public static boolean isWebdavEditable(FileDocument doc,
                                       Member mbr)
Check if the specified document can be edited through WebDAV by the specified member.

Parameters:
doc - the FileDocument to check.
mbr - the Member to check
Returns:
true if ca be edited, false otherwise.
Since:
jcms-6.1.0

useDigestAuthentication

public static boolean useDigestAuthentication()
Check if HTTP Digest authentification should be used in WebDav.

Returns:
true if HTTP Digest authentification should be used, false otherwise.
Since:
jcms-6.1

getDataName

public static String getDataName(Data data,
                                 boolean urlEncode)
Retrieve the name of the Data as it should be used in WebDav.

Parameters:
data - the Data for which url should be retrieved, must be a Workspace, Category or FileDocument (otherwise null is returned)
urlEncode - true to return the computed data name encoded for use in URL, false to retrieve the name as is.
Returns:
a name suitable for use in WebDAV url (return null if data was not a Data browsable through WebDAV)
Since:
jcms-6.1

getPath

public static String getPath(Workspace ws,
                             boolean urlEncode)
Retrieve the WebDav path of the specified Workspace.

Parameters:
ws - the Workspace for which the path is retrieved, must not be null.
urlEncode - true to return a path with each part encoded correctly for use in URL, false to retrieve the path which it part as is.
Returns:
a relative path suitable for use in WebDav url, with a trailing slash, e.g "Default%20Workspace/"
Since:
jcms-6.1

getPath

public static String getPath(Category cat,
                             Workspace ws,
                             boolean urlEncode)
Retrieve the WebDav path of the specified category in the specified workspace.

Return null if the category cannot be displayed using WebDAV in this workspace.

Parameters:
cat - the category for which the path is retrieved, must not be null.
ws - the workspace in which the category is to be displayed.
urlEncode - true to return a path with each part encoded correctly for use in URL, false to retrieve the path which it part as is.
Returns:
a relative path suitable for use in WebDav url, with a trailing slash, e.g "Default%20Workspace/Parent%20Category/Other%20Category/My%20Category/"
Since:
jcms-6.1

getPath

public static String getPath(FileDocument doc,
                             boolean urlEncode)
Retrieve the WebDav path of the specified FileDocument.

Parameters:
doc - the FileDocument for which the path is retrieved, must not be null.
urlEncode - true to return a path with each part encoded correctly for use in URL, false to retrieve the path which it part as is.
Returns:
a relative path suitable for use in WebDav url, e.g "Default%20Workspace/Parent%20Category/Other%20Category/My%20Category/My%20Document.doc"
Since:
jcms-6.1

getParentPath

public static String getParentPath(FileDocument doc,
                                   boolean urlEncode)
Retrieve the WebDav path of the first valid parent folder of the specified FileDocument.

Parameters:
doc - the FileDocument for which the path is retrieved, must not be null.
urlEncode - true to return a path with each part encoded correctly for use in URL, false to retrieve the path which it part as is.
Returns:
a relative path suitable for use in WebDav url, e.g "Default%20Workspace/Parent%20Category/Other%20Category/My%20Category/"
Since:
jcms-6.1

getRootCategory

public static Category getRootCategory()
Retrieve the global root category to be used for webdav

Returns:
as of current implement, always return the channel's root Category
Since:
jcms-6.1

encodeWebDavUrl

public static String encodeWebDavUrl(String s)
Convenient method to encode a WebDav URL using webdav encoding.
Same implementation as URLEncoder.encode(String, String), but space is encoded with %20 and '/' is not encoded.

Parameters:
s - String to be translated.
Returns:
the translated String.
Since:
jcms-6.1
See Also:
Util.encodeUrl(String, String)


Copyright © 2001-2007 Jalios SA. All Rights Reserved.