org.apache.lenya.cms.publication
Class ResourcesManager

java.lang.Object
  extended by org.apache.lenya.cms.publication.ResourcesManager

public class ResourcesManager
extends java.lang.Object

Manager for resources of a CMS document.


Field Summary
static java.lang.String RESOURCES_META_SUFFIX
           
static java.lang.String RESOURCES_PREFIX
           
 
Constructor Summary
ResourcesManager(Document document)
          Create a new instance of Resources.
 
Method Summary
 void deleteResources()
          Deletes all resources.
 Document getDocument()
           
protected  java.io.File[] getFiles(java.io.FileFilter filter)
          Returns the resources that are matched by a certain file filter.
 java.io.File[] getImageResources()
          Return all resources which are images.
 java.io.File getMetaFile(java.io.File resource)
          Returns a meta file for a given resource.
 java.io.File[] getMetaFiles()
          Get the meta data for all resources for the associated document.
 java.io.File getPath()
          Get the path to the resources.
 java.lang.String getPathFromPublication()
          Get the path to the resources.
 java.io.File[] getResources()
          Get all resources for the associated document.
 java.lang.String getResourceUrl(java.io.File resource)
          Returns the path of a resource relative to the context prefix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCES_PREFIX

public static final java.lang.String RESOURCES_PREFIX
See Also:
Constant Field Values

RESOURCES_META_SUFFIX

public static final java.lang.String RESOURCES_META_SUFFIX
See Also:
Constant Field Values
Constructor Detail

ResourcesManager

public ResourcesManager(Document document)
Create a new instance of Resources.

Parameters:
document - the document for which the resources are managed
Method Detail

getPathFromPublication

public java.lang.String getPathFromPublication()
Get the path to the resources.

Returns:
the path to the resources

getPath

public java.io.File getPath()
Get the path to the resources.

Returns:
the path to the resources

getResourceUrl

public java.lang.String getResourceUrl(java.io.File resource)
Returns the path of a resource relative to the context prefix.

Returns:
The path of a resource relative to the context prefix.

getResources

public java.io.File[] getResources()
Get all resources for the associated document.

Returns:
all resources of the associated document

getImageResources

public java.io.File[] getImageResources()
Return all resources which are images.

Returns:
All image resources.

getFiles

protected java.io.File[] getFiles(java.io.FileFilter filter)
Returns the resources that are matched by a certain file filter.

Parameters:
filter - A file filter.
Returns:
A file array.

getMetaFiles

public java.io.File[] getMetaFiles()
Get the meta data for all resources for the associated document.

Returns:
all meta data files for the resources for the associated document.

getMetaFile

public java.io.File getMetaFile(java.io.File resource)
                         throws java.lang.IllegalArgumentException
Returns a meta file for a given resource.

Parameters:
resource - A resource the meta file should be returned for.
Returns:
A file containing meta information about a resource. Returns null if no meta file was found.
Throws:
java.lang.IllegalArgumentException - If resource is a meta file itself.

deleteResources

public void deleteResources()
Deletes all resources.


getDocument

public Document getDocument()


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.