info.magnolia.cms.core
Class Path

java.lang.Object
  extended by info.magnolia.cms.core.Path

public final class Path
extends java.lang.Object

Utility class to retrieve files or directory used by Magnolia. Examples: cache directory, tmp files, ..

Version:
2.0 $Id: Path.java 41137 2011-01-06 18:19:25Z gjoseph $
Author:
Sameer Charles

Method Summary
static java.lang.String getAbsoluteFileSystemPath(java.lang.String path)
          Gets absolute filesystem path, adds application root if path is not absolute.
static java.lang.String getAbsolutePath(java.lang.String path)
           
static java.lang.String getAbsolutePath(java.lang.String path, java.lang.String label)
           
static java.io.File getAppRootDir()
          Gets the root directory for the magnolia web application.
static java.io.File getCacheDirectory()
           
static java.lang.String getCacheDirectoryPath()
          Gets the cache directory path (cms.cache.startdir) as set with Java options while startup or in web.xml.
static java.io.File getHistoryFile()
           
static java.lang.String getHistoryFilePath()
          Gets cms.exchange.history file location as set with Java options while startup or in web.xml.
static java.lang.String getNodePath(java.lang.String path)
          Deprecated. since 4.0 - untested and unused
static java.lang.String getNodePath(java.lang.String path, java.lang.String label)
          Deprecated. since 4.0 - untested and unused
static java.lang.String getParentPath(java.lang.String path)
          Deprecated. since 4.0 - untested and unused
static java.io.File getRepositoriesConfigFile()
           
static java.lang.String getRepositoriesConfigFilePath()
          Gets repositories file location as set with Java options while startup or in web.xml.
static java.io.File getTempDirectory()
           
static java.lang.String getTempDirectoryPath()
          Gets the temporary directory path (cms.upload.tmpdir) as set with Java options while startup or in web.xml.
static java.lang.String getUniqueLabel(Content parent, java.lang.String label)
           
static java.lang.String getUniqueLabel(HierarchyManager hierarchyManager, java.lang.String parent, java.lang.String label)
           
static java.lang.String getValidatedLabel(java.lang.String label)
          Replace illegal characters based on system property magnolia.ut8.enabled.
static java.lang.String getValidatedLabel(java.lang.String label, java.lang.String charset)
          If charset eq to UTF-8 replaces these characters: jackrabbit not allowed 32: [ ] 91: [[] 93: []] 42: [*] 34: ["] 46: [.] 58 [:] 92: [\] 39 :['] url not valid 59: [;] 47: [/] 63: [?] 43: [+] 37: [%] 33: [!] 35:[#] 94: [^] else replace illegal characters except [_] [0-9], [A-Z], [a-z], [-], [_].
static boolean isAbsolute(java.lang.String path)
           
static boolean isCharValid(int charCode, java.lang.String charset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCacheDirectoryPath

public static java.lang.String getCacheDirectoryPath()
Gets the cache directory path (cms.cache.startdir) as set with Java options while startup or in web.xml.

Returns:
Cache directory path

getCacheDirectory

public static java.io.File getCacheDirectory()

getTempDirectoryPath

public static java.lang.String getTempDirectoryPath()
Gets the temporary directory path (cms.upload.tmpdir) as set with Java options while startup or in web.xml.

Returns:
Temporary directory path

getTempDirectory

public static java.io.File getTempDirectory()

getHistoryFilePath

public static java.lang.String getHistoryFilePath()
Gets cms.exchange.history file location as set with Java options while startup or in web.xml.

Returns:
exchange history file location

getHistoryFile

public static java.io.File getHistoryFile()

getRepositoriesConfigFilePath

public static java.lang.String getRepositoriesConfigFilePath()
Gets repositories file location as set with Java options while startup or in web.xml.

Returns:
file location

getRepositoriesConfigFile

public static java.io.File getRepositoriesConfigFile()

getAppRootDir

public static java.io.File getAppRootDir()
Gets the root directory for the magnolia web application.

Returns:
magnolia root dir

getAbsoluteFileSystemPath

public static java.lang.String getAbsoluteFileSystemPath(java.lang.String path)
Gets absolute filesystem path, adds application root if path is not absolute.


getUniqueLabel

public static java.lang.String getUniqueLabel(HierarchyManager hierarchyManager,
                                              java.lang.String parent,
                                              java.lang.String label)

getUniqueLabel

public static java.lang.String getUniqueLabel(Content parent,
                                              java.lang.String label)

isAbsolute

public static boolean isAbsolute(java.lang.String path)

getValidatedLabel

public static java.lang.String getValidatedLabel(java.lang.String label)
Replace illegal characters based on system property magnolia.ut8.enabled.

Parameters:
label - label to validate
Returns:
validated label

getValidatedLabel

public static java.lang.String getValidatedLabel(java.lang.String label,
                                                 java.lang.String charset)
If charset eq to UTF-8 replaces these characters: jackrabbit not allowed 32: [ ] 91: [[] 93: []] 42: [*] 34: ["] 46: [.] 58 [:] 92: [\] 39 :['] url not valid 59: [;] 47: [/] 63: [?] 43: [+] 37: [%] 33: [!] 35:[#] 94: [^] else replace illegal characters except [_] [0-9], [A-Z], [a-z], [-], [_].

Parameters:
label - label to validate
Returns:
validated label

isCharValid

public static boolean isCharValid(int charCode,
                                  java.lang.String charset)
Parameters:
charCode - char code
charset - charset (ex. UTF-8)
Returns:
true if char can be used as a content name

getAbsolutePath

public static java.lang.String getAbsolutePath(java.lang.String path,
                                               java.lang.String label)

getAbsolutePath

public static java.lang.String getAbsolutePath(java.lang.String path)

getNodePath

public static java.lang.String getNodePath(java.lang.String path,
                                           java.lang.String label)
Deprecated. since 4.0 - untested and unused


getNodePath

public static java.lang.String getNodePath(java.lang.String path)
Deprecated. since 4.0 - untested and unused


getParentPath

public static java.lang.String getParentPath(java.lang.String path)
Deprecated. since 4.0 - untested and unused



Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.