## com.arsdigita.docmgr
Class Folder

    java.lang.Object
      com.arsdigita.domain.DomainObject
          com.arsdigita.domain.ObservableDomainObject
              com.arsdigita.kernel.ACSObject
                  com.arsdigita.versioning.VersionedACSObject
                      com.arsdigita.docmgr.ResourceImpl
                          com.arsdigita.docmgr.Folder

All Implemented Interfaces:
  com.arsdigita.auditing.Audited, Constants, Resource

public class Folder
extends ResourceImpl
implements Constants

Represents a Folder in the document manager application.

Version:
  $Id: //apps/docmgr/dev/src/com/arsdigita/docmgr/Folder.java#6 $
Author:
  Stefan Deusch (stefan@arsdigita.com), Ron Henderson (ron@arsdigita.com)

Field Summary
`static String` `BASE_DATA_OBJECT_TYPE`

Fields inherited from class com.arsdigita.docmgr.ResourceImpl
`PARENT, s_log, versionId`

Fields inherited from class com.arsdigita.versioning.VersionedACSObject
`IS_DELETED, MASTER`

Fields inherited from class com.arsdigita.kernel.ACSObject
`CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE`

Fields inherited from interface com.arsdigita.docmgr.Constants
`ACTION, CONTENT, DESCRIPTION, DURATION, FOLDER_ID, IS_FOLDER, LAST_MODIFIED_DATE, MIME_TYPE_LABEL, NAME, OBJECT_ID, PARENT, PARTY_ID, PATH, REPOSITORIES_MOUNTED, SIZE, TEXT_HTML, TEXT_PLAIN, TYPE, USER_ID`

Fields inherited from interface com.arsdigita.docmgr.Resource
`SEPARATOR, SEPARATOR_CHAR`

Constructor Summary
`` `Folder()` Constructor.
`` `Folder(BigDecimal id)` Creates a new folder by retrieving it based on ID.
`` `Folder(com.arsdigita.persistence.DataObject dataObject)` Creates a new folder object.
`protected` `Folder(com.arsdigita.persistence.metadata.ObjectType type)` Constructor.
`` `Folder(com.arsdigita.persistence.OID oid)` Creates a new folder by retrieving it based on OID.
`` `Folder(String objectTypeString)`
`` `Folder(String name, String description)` Creates a named folder with a description.
`` `Folder(String name, String description, Folder parent)` Creates a sub folder inside a given parent folder.

Method Summary
`protected void` `beforeSave()`
`Resource` `copyTo(String name, Resource parent)` Copy this folder to a new location.
`Folder` `createFolders(String path)` Creates the sub folder named by path, including any necessary but nonexistent parent folders.
`protected String` `getBaseDataObjectType()`
`String` `getDisplayName()` Returns the display name for a folder, which is equivalent to calling getName().
`boolean` `isFile()` Tests whether this resource is a file.
`boolean` `isFolder()` Tests whether this resource is a folder.
`File` `retrieveFile(String path)`
`Folder` `retrieveFolder(String path)` Retrieves the named sub folder by searching from the current folder along the given path.

Methods inherited from class com.arsdigita.docmgr.ResourceImpl

`afterSave, copy, copyTo, copyTo, delete, getCanonicalPath, getCreationDate, getCreationIP, getCreationUser, getDescription, getLastModifiedDate, getLastModifiedIP, getLastModifiedUser, getName, getParent, getParentResourceID, getPath, getPropertyNames, getResourceID, getResourceID, isAbsolutePath, isRoot, isValidName, isValidPath, retrievePath, setCreationDate, setCreationIP, setCreationUser, setDescription, setLastModifiedDate, setLastModifiedIP, setLastModifiedUser, setName, setParent, toURL`

Methods inherited from class com.arsdigita.versioning.VersionedACSObject
`applyTag, applyUniqueTag, autoPropagateMaster, getMaster, getRolledBackTo, getTransactions, getTransactions, isMaster, isRolledBack, isSubtype, permanentlyDelete, propagateMaster, recordAttributeChange, rollBackTo, rollBackTo, rollForward, save, setMaster, trackChanges`

Methods inherited from class com.arsdigita.kernel.ACSObject
`assertPrivilege, checkPrivilege, doCreateCheck, doWriteCheck, getContainer, getDefaultDomainClass, getID, getSpecificObjectType, getSpecificOID, gimmeContainer, initialize, isContainerModified, setID, setID`

Methods inherited from class com.arsdigita.domain.ObservableDomainObject
`addObserver, getObservers`

Methods inherited from class com.arsdigita.domain.DomainObject
`add, add, addToAssociation, afterDelete, beforeDelete, clear, disconnect, equals, get, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, isValid, remove, remove, remove, removeFromAssociation, save, set, setAssociation, setAssociation, specializeDataObject, specializeDataObject, toString`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface com.arsdigita.docmgr.Resource
`getID, toString`

Field Detail

### BASE_DATA_OBJECT_TYPE

    public static final String BASE_DATA_OBJECT_TYPE

See Also:
  Constant Field Values

Constructor Detail

### Folder

    public Folder()

  Constructor.

### Folder

    public Folder(com.arsdigita.persistence.DataObject dataObject)

  Creates a new folder object.

### Folder

    public Folder(BigDecimal id)
           throws com.arsdigita.domain.DataObjectNotFoundException

  Creates a new folder by retrieving it based on ID.

Parameters:
  `id` - - the BigDecimal ID

### Folder

    public Folder(com.arsdigita.persistence.OID oid)
           throws com.arsdigita.domain.DataObjectNotFoundException

  Creates a new folder by retrieving it based on OID.

Parameters:
  `oid` - - the Object oID

### Folder

    public Folder(String objectTypeString)

### Folder

    protected Folder(com.arsdigita.persistence.metadata.ObjectType type)

  Constructor. The contained `DataObject` is initialized with a new `DataObject` with an `ObjectType` specified by type.

Parameters:
  `type` - The `ObjectType` of the contained `DataObject`.
See Also:
  `DomainObject.DomainObject(ObjectType)`, `DataObject`, `ObjectType`

### Folder

    public Folder(String name,
                  String description)

  Creates a named folder with a description.

Parameters:
  `name` - the name of the folder
  `description` - the description of the folder contents (may be null)

### Folder

    public Folder(String name,
                  String description,
                  Folder parent)

  Creates a sub folder inside a given parent folder.

Parameters:
  `name` - the name of the folder
  `description` - the description of the folder contents (may be null)

Method Detail

### beforeSave

    protected void beforeSave()

  Overrides:
    `beforeSave` in class `ResourceImpl`

### getBaseDataObjectType

    protected String getBaseDataObjectType()

  Overrides:
    `getBaseDataObjectType` in class `ResourceImpl`

### retrieveFolder

    public Folder retrieveFolder(String path)
                          throws com.arsdigita.domain.DataObjectNotFoundException,
                                 InvalidNameException

  Retrieves the named sub folder by searching from the current folder along the given path. Returns the child folder or throws a DataObjectNotFoundException if the subfolder does not exist.

  Returns:
    child folder if and only if it exists as a sub folder with the correct path
  Throws:
    `com.arsdigita.domain.DataObjectNotFoundException`
    `InvalidNameException`

### retrieveFile

    public File retrieveFile(String path)
                      throws com.arsdigita.domain.DataObjectNotFoundException,
                             InvalidNameException

  Throws:
    `com.arsdigita.domain.DataObjectNotFoundException`
    `InvalidNameException`

### createFolders

    public Folder createFolders(String path)
                         throws InvalidNameException,
                                ResourceExistsException

  Creates the sub folder named by path, including any necessary but nonexistent parent folders.

  Throws:
    `InvalidNameException`
    `ResourceExistsException`

### isFolder

    public boolean isFolder()

  Description copied from interface: `Resource`
  Tests whether this resource is a folder.

  Specified by:
    `isFolder` in interface `Resource`
  Specified by:
    `isFolder` in class `ResourceImpl`

### isFile

    public boolean isFile()

  Description copied from interface: `Resource`
  Tests whether this resource is a file.

  Specified by:
    `isFile` in interface `Resource`
  Specified by:
    `isFile` in class `ResourceImpl`

### getDisplayName

    public String getDisplayName()

  Returns the display name for a folder, which is equivalent to calling getName().

### copyTo

    public Resource copyTo(String name,
                           Resource parent)

  Copy this folder to a new location. Recursively copies all children from the original resource location to the new resource location.

  Specified by:
    `copyTo` in interface `Resource`
  Specified by:
    `copyTo` in class `ResourceImpl`

Copyright (c) 2006 Red Hat, Inc. Corporation. All Rights Reserved. Generated at June 1 2006:1113 UTC