org.opencms.ade.configuration
Class CmsFolderOrName

java.lang.Object
  extended by org.opencms.ade.configuration.CmsFolderOrName

public class CmsFolderOrName
extends Object

A bean which can either represent a folder or a relative folder name, but not both at the same time.

Since:
8.0.0
Version:
$Revision: 1.0$
Author:
Georg Westenberger

Constructor Summary
CmsFolderOrName(CmsResource folder)
          Creates an instance based on an existing folder.
CmsFolderOrName(String basePath, String name)
          Creates an instance based on a relative folder name.
 
Method Summary
 String getBasePath()
          Gets the base path.
 CmsResource getFolder()
          Gets the folder.
 String getFolderName()
          Gets the relative folder name if available, else null.
 String getFolderPath(CmsObject cms)
          Computes the folder root path.
 boolean isFolder()
          Returns true if the current instance was created with a folder structure id parameter.
 boolean isName()
          Returns true if this instance was created with a folder name parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsFolderOrName

public CmsFolderOrName(CmsResource folder)
Creates an instance based on an existing folder.

Parameters:
folder - the folder

CmsFolderOrName

public CmsFolderOrName(String basePath,
                       String name)
Creates an instance based on a relative folder name.

Parameters:
basePath - the base path which the folder name is relative to
name - the relative folder name
Method Detail

getBasePath

public String getBasePath()
Gets the base path.

Returns:
the base path

getFolder

public CmsResource getFolder()
Gets the folder.

Returns:
the folder

getFolderName

public String getFolderName()
Gets the relative folder name if available, else null.

Returns:
the relative folder name null

getFolderPath

public String getFolderPath(CmsObject cms)
Computes the folder root path.

Parameters:
cms - the CMS context to use
Returns:
the folder root path

isFolder

public boolean isFolder()
Returns true if the current instance was created with a folder structure id parameter.

Returns:
true if this instance was created with a folder structure id parameter

isName

public boolean isName()
Returns true if this instance was created with a folder name parameter.

Returns:
true if this instance was created with a folder name parameter