Package com.sas.services.information.metadata

# Interface FolderInterface

All Superinterfaces:
  `MetadataInterface`, `MutableContainerInterface`, `PublicObjectContainerInterface`, `PublicObjectInterface`, `Remote`

All Known Subinterfaces:
  `FilteredFolderInterface`, `FilteredRepositoryInterface`, `MyDocumentsInterface`, `MyInboxInterface`, `MyResultsInterface`, `PersonalRepositoryInterface`, `RootFolderInterface`, `VirtualFolderInterface`

All Known Implementing Classes:
  `DavPerson`, `FilteredFolder`, `FilteredRepository`, `Folder`, `MyDocuments`, `MyInbox`, `MyResults`, `PersonalRepository`, `ServerVirtualFolder`, `VirtualFolder`

public interface FolderInterface extends MetadataInterface, MutableContainerInterface
This is a generic interface for interacting with a Folder object.

Note: This interface currently has no support for ordering of items within a Folder although the contents are returned in an ordered list. It may be useful to subclass the list of items to allow sorting by name, date created, date modified, etc.

Since:
  1.0

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `FOLDER_TYPE_BIP`
  The type string that most BIP applications like.

  ### Fields inherited from interface com.sas.services.information.metadata.MetadataInterface

  `METADATA_STATE_DELETED, METADATA_STATE_DESTROYED, METADATA_STATE_NEW, METADATA_STATE_NORMAL, PERMISSION_READMETADATA, PERMISSION_WRITEMETADATA`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addItem(MetadataInterface item)`
  Add an item to the folder.
  `MetadataInterface`
  `addNewItem(String name, String type)`
  Create a new metadata object to add to the folder.
  `void`
  `addSubfolder(FolderInterface folder)`
  Add an existing folder to this one as a subfolder.
  `void`
  `deleteItem(MetadataInterface item)`
  Delete an item from this folder.
  `void`
  `deleteSubfolder(String name)`
  Delete a subfolder.
  `Date`
  `getContentCreateDate()`
  Get the content create date.
  `ContentInfo`
  `getContentInfo()`
  Returns the `ContentInfo`object corresponding to the root of the given PathUrl.
  `Date`
  `getContentModifyDate()`
  Get the content modification date.
  `String`
  `getFolderType()`
  Get the folder type.
  `MetadataInterface`
  `getItem(String name)`
  Get a named item from the folder.
  `MetadataInterface`
  `getItemByClass(String name, Class itemClass)`
  Get a named item from the folder.
  `MetadataInterface`
  `getItemByType(String name, String metadataType)`
  Get a named item from the folder.
  `List`
  `getItems()`
  List all items in the folder.
  `List`
  `getItemsByClass(Class itemClass)`
  List the items in the folder that match the Class passed in as a parameter.
  `List`
  `getItemsByType(String metadataType)`
  Get a list of items in the folder of a specific type.
  `List`
  `getItemSublist(int start, int end)`
  Get a sublist of items from this folder
  `List`
  `getItemSublist(int start, int end, String sort)`
  Get a sublist of items from this folder which are sorted.
  `FolderInterface`
  `getParent()`
  Get parent folder.
  `String`
  `getPath()`
  Get path of the current folder.
  `MetadataInterface`
  `getPublicTypeItem(String name, String type)`
  Find an item in this Folder with the given name and type.
  `FolderInterface`
  `getSubfolder(String name)`
  Get a named subfolder.
  `List`
  `getSubfolders()`
  Get all the folders immediately below this one in the hiearchy.
  `int`
  `getTotalNumberOfItems()`
  Get the total number of items in this folder
  `boolean`
  `hasDuplicate(String name, String type)`
  Check if there's a duplicate object in this folder with the same name and of the same type.
  `boolean`
  `hasDuplicateSubfolder(String name)`
  Check if this folder already has a subfolder with the given name.
  `boolean`
  `isEmpty()`
  Returns true if this folder has no subfolders and no member objects.
  `boolean`
  `isItemNameUnique(MetadataInterface member)`
  Validate that the name of the metadata object is unique within the Folder.
  `FolderInterface`
  `makeSubfolder(String name)`
  Makes a subfolder under the current folder.
  `FolderInterface`
  `makeSubfolder(String name, String type)`
  Make a subfolder of a specific type.
  `boolean`
  `moveMembersOnOverflow()`
  Check for too many objects in a folder.
  `void`
  `removeItem(MetadataInterface item)`
  Remove an item from the folder.
  `void`
  `removeSubfolder(String name)`
  Remove a subfolder from the current folder.
  `void`
  `setContentCreateDate(Date date)`
  Set the Date that the content folder was created.
  `void`
  `setContentModifyDate(Date date)`
  Set the date when an object was last added to or removed from this folder.
  `void`
  `setFolderType(String type)`
  Set the folder type.

  ### Methods inherited from interface com.sas.services.information.metadata.MetadataInterface

  `add, addAccessControl, addAttribute, addAttributes, addDocument, addExtension, addGroup, addImplementor, addKeyword, addNoteTextStore, addNoteTextStore, addObjectProperty, addObjectProperty, addPermissions, addPrompt, addPropertySet, addRemark, addResponsibleParty, addTransactionListener, addUsedByPrototype, checkin, checkout, commit, copyTo, countAssociatedObjects, delete, deleteAttribute, deleteAttributes, destroy, getAccessControls, getAttribute, getAttributes, getAuthorizationUtil, getCreateDate, getCreatedBy, getDescription, getDocuments, getEntityKey, getEntityURL, getExtensions, getGroups, getGUID, getIdentities, getImplementors, getKeywords, getLockedBy, getModifiedBy, getModifyDate, getNoteTextStore, getNoteTextStores, getNoteTextStoresByRole, getObjectProperties, getParentPath, getParents, getPath, getPaths, getPermission, getPermissions, getPermissions, getPreviousVersionNames, getPrimaryPropertyGroup, getPrompt, getPrompts, getPropertyBag, getPropertySets, getRemarksList, getReposId, getRepository, getRepositoryEntity, getRepositoryName, getReposKey, getResponsibleParties, getState, getTrackingId, getType, getUsageVersion, getUsedByPrototypes, getUsingPrototype, getVersion, isAuthorized, isCompatible, isDeleted, isDestroyed, isObjectAlive, isReadCompatible, mapNameToFilesystem, mapUrlToFilesystem, moveTo, newServiceObject, refresh, removeAccessControl, removeDocument, removeExtension, removeGroup, removeImplementor, removeKeyword, removeNoteTextStore, removeObjectProperty, removePermissions, removePrompt, removePropertySet, removeResponsibleParty, removeResponsiblePartyByIdentity, removeUsedByPrototype, rollback, setAttribute, setAttributes, setDeleted, setDescription, setDocuments, setExtensions, setGroups, setGUID, setKeywords, setName, setNoteTextStores, setObjectProperties, setPermission, setPrimaryPropertyGroup, setPrompt, setPrompts, setRemarksList, setRepository, setUsingPrototype, startTransaction, toByteArray, transactionEvent, uncheckout, update, updateFromBag, version`

  ### Methods inherited from interface com.sas.services.information.publicobject.MutableContainerInterface

  `addChild, insertChild, removeChild`

  ### Methods inherited from interface com.sas.services.information.publicobject.PublicObjectContainerInterface

  `getChildAt, getChildCount, getChildren, getChildren, newChild`

  ### Methods inherited from interface com.sas.services.information.publicobject.PublicObjectInterface

  `addProcessorInterface, getContainer, getIdentifier, getName, getObjectURI, getPathUrl, getProcessorInterface, getTypeDescriptor`

- ## Field Details

  - ### FOLDER_TYPE_BIP

    static final String FOLDER_TYPE_BIP
    The type string that most BIP applications like.
    See Also:
      - Constant Field Values

- ## Method Details

  - ### getPath

    String getPath() throws RemoteException
    Get path of the current folder. This is the path starting with the Tree just below the Bip Service SoftwareComponent down to this folder, with forward-slash separators.

    Returns:
      The path string for this folder.
    Throws:
      `RemoteException` - in the event of remote object failure.

  - ### getItems

    List getItems() throws ServiceException, RemoteException
    List all items in the folder. These are only the individual items. Subfolders will be returned separately.

    Returns:
      A List of MetadataInterface objects in this folder.
    Throws:
      `ServiceException` - if a repository error occurs.
      `RemoteException` - in the event of remote object failure.

  - ### getItemsByType

    List getItemsByType(String metadataType) throws ServiceException, RemoteException
    Get a list of items in the folder of a specific type.

    Parameters:
      `metadataType` - A String that will match the output from the object's getType method.
    Returns:
      A List of MetadataInterface objects whose getType() method returns the string specified by metadataType.
    Throws:
      `ServiceException` - if a repository error occurs.
      `RemoteException` - in the event of remote object failure.

  - ### getItemsByClass

    List getItemsByClass(Class itemClass) throws ServiceException, RemoteException
    List the items in the folder that match the Class passed in as a parameter. This Class should be a subclass of MetadataInterface.

    Parameters:
      `itemClass` - The Class used to filter the folder objects to return.
    Returns:
      A List of MetadataInterface objects that match the itemClass.
    Throws:
      `ServiceException` - If a repository error occurs.
      `RemoteException` - in the event of remote object failure.

  - ### getItem

    MetadataInterface getItem(String name) throws ServiceException, RemoteException
    Get a named item from the folder. With only a name, we can't guarantee that the object coming back will be the one the user wants. Even if we ask for a type, name collisions can occur.

    Parameters:
      `name` - The name of the object to return.
    Returns:
      A MetadataInterface object matching name.
    Throws:
      `ServiceException` - if a repository error occurs.
      `RemoteException` - in the event of remote object failure.

  - ### getPublicTypeItem

    MetadataInterface getPublicTypeItem(String name, String type) throws ServiceException, RemoteException
    Find an item in this Folder with the given name and type. This will use search to get the item, so it will always go to the server to find the object. The upside is, it will always get a fresh copy of the object. The downside is, no caching applies. This doesn't populate the folders items, and will always go to the server.
    Parameters:
      `name` - The name of the object to find. If null, a null is returned.
      `type` - The public type name of the object type. If this is null, a null is returned. If the type is not recognized as a public type, a ServiceException will be thrown
    Returns:
      The matching item in this folder, or null if none exists.
    Throws:
      `ServiceException` - if the type is not a public type, or if a repository error occurs.
      `RemoteException` - in the event of remote object failure.

  - ### getItemByType

    MetadataInterface getItemByType(String name, String metadataType) throws ServiceException, RemoteException
    Get a named item from the folder. With only a name, we can't guarantee that the object coming back will be the one the user wants. Even if we ask for a type, name collisions can occur.
    Parameters:
      `name` - The name of the object to return.
      `metadataType` - The type of object to return.
    Returns:
      A MetadataInterface object that matches the name and type requested, or null if none is found.
    Throws:
      `ServiceException` - if a repository error occurs.
      `RemoteException` - in the event of remote object failure.

  - ### getItemByClass

    MetadataInterface getItemByClass(String name, Class itemClass) throws ServiceException, RemoteException
    Get a named item from the folder. It must match both the name and the Class provided. If no Class is provided on the call, the first object matching the name is retuned. If no match is found, null is returned.

    Parameters:
      `name` - The name of the object to return.
      `itemClass` - The Class of the object to return.
    Returns:
      A MetadataInterface object in the folder that matches the name and Class requested.
    Throws:
      `ServiceException` - if a repository error occurs.
      `RemoteException` - in the event of remote object failure.

  - ### getSubfolders

    List getSubfolders() throws ServiceException, RemoteException
    Get all the folders immediately below this one in the hiearchy.

    Returns:
      A List of FolderInterface objects that are members of this folder.
    Throws:
      `ServiceException` - if a repository error occurs.
      `RemoteException` - in the event of remote object failure.

  - ### getSubfolder

    FolderInterface getSubfolder(String name) throws ServiceException, RemoteException
    Get a named subfolder.

    Parameters:
      `name` - The name of the folder to return.
    Returns:
      A FolderInterface object with the name requested, or null if it doesn't exist.
    Throws:
      `ServiceException` - if a repository error occurs.
      `RemoteException` - in the event of remote object failure.

  - ### addItem

    void addItem(MetadataInterface item) throws ServiceException, RemoteException
    Add an item to the folder. The item should already exist. This method makes the association that puts it in this folder, but doesn't create the item in the store.

    Parameters:
      `item` - The item to add to this folder.
    Throws:
      `ServiceException` - if a repository error occurs.
      `RemoteException` - in the event of remote object failure.

  - ### addNewItem

    MetadataInterface addNewItem(String name, String type) throws ServiceException, RemoteException
    Create a new metadata object to add to the folder.

    Parameters:
      `name` - The name of the new object.
      `type` - The repository-specific type of the new object.
    Returns:
      The new metadata object.
    Throws:
      `ServiceException` - In the event of repository failure.
      `RemoteException` - In the event of remote object failure.

  - ### removeItem

    void removeItem(MetadataInterface item) throws ServiceException, RemoteException
    Remove an item from the folder. This call just breaks the association with the item, and leaves it otherwise undisturbed in the repository.

    Parameters:
      `item` - The item to remove from this folder.
    Throws:
      `ServiceException` - if a repository error occurs.
      `RemoteException` - in the event of remote object failure.

  - ### deleteItem

    void deleteItem(MetadataInterface item) throws ServiceException, RemoteException
    Delete an item from this folder. This method deletes the item from the repository as well as removing it from the folder.

    Parameters:
      `item` - The item to delete from this folder.
    Throws:
      `ServiceException` - if a repository error occurs.
      `RemoteException` - in the event of remote object failure.

  - ### makeSubfolder

    FolderInterface makeSubfolder(String name, String type) throws ServiceException, RemoteException
    Make a subfolder of a specific type. the type string should be the smart object type.
    Parameters:
      `name` - The name of the new subfolder.
      `type` - The smart object type of the new subfolder.
    Returns:
      A new subfolder of this folder.
    Throws:
      `ServiceException` - If the type is not a FolderInterface derivative, or if a repository error occurs.
      `RemoteException` - In the event of remote object failure.

  - ### makeSubfolder

    FolderInterface makeSubfolder(String name) throws ServiceException, RemoteException
    Makes a subfolder under the current folder.

    Parameters:
      `name` - The name of the folder to create.
    Returns:
      The new folder
    Throws:
      `ServiceException` - if a repository error occurs.
      `RemoteException` - in the event of remote object failure.

  - ### addSubfolder

    void addSubfolder(FolderInterface folder) throws ServiceException, RemoteException
    Add an existing folder to this one as a subfolder.
    Parameters:
      `folder` - The folder to add to this one as a subfolder.
    Throws:
      `ServiceException` - if a repository error occurs.
      `RemoteException` - in the event of remote object failure.

  - ### removeSubfolder

    void removeSubfolder(String name) throws ServiceException, RemoteException
    Remove a subfolder from the current folder. This breaks the association, but does not remove it from the repository.

    Parameters:
      `name` - The name of the subfolder to remove.
    Throws:
      `ServiceException` - if a repository error occurs.
      `RemoteException` - in the event of remote object failure.

  - ### deleteSubfolder

    void deleteSubfolder(String name) throws ServiceException, RemoteException
    Delete a subfolder. This will only work if the folder is empty.

    Parameters:
      `name` - The name of the subfolder to delete.
    Throws:
      `ServiceException` - if a repository error occurs.
      `RemoteException` - in the event of remote object failure.

  - ### getParent

    FolderInterface getParent() throws ServiceException, RemoteException
    Get parent folder.

    If the current folder has more than one parent, the preferred (first) parent folder is returned.

    Specified by:
      `getParent` in interface `MetadataInterface`
    Returns:
      The parent Folder of this folder.
    Throws:
      `ServiceException` - if a repository error occurs.
      `RemoteException` - in the event of remote object failure.

  - ### setFolderType

    void setFolderType(String type) throws ServiceException, RemoteException
    Set the folder type.
    Parameters:
      `type` - The String indicating the type of the folder.
    Throws:
      `ServiceException` - If a repository error occurs.
      `RemoteException` - In the event of remote object failure.

  - ### getFolderType

    String getFolderType() throws ServiceException, RemoteException
    Get the folder type.
    Returns:
      A String with the type of folder.
    Throws:
      `ServiceException` - If a repository error occurs.
      `RemoteException` - In the event of remote object failure.

  - ### getItemSublist

    List getItemSublist(int start, int end) throws RemoteException, ServiceException
    Get a sublist of items from this folder
    Parameters:
      `start` - item number to start at
      `end` - item number to end at
    Returns:
      The sublist of items.
    Throws:
      `RemoteException`
      `ServiceException`

  - ### getItemSublist

    List getItemSublist(int start, int end, String sort) throws RemoteException, ServiceException
    Get a sublist of items from this folder which are sorted.
    Parameters:
      `start` - item number to start at
      `end` - item number to end at
      `sort` - one of name, namedescending, desc, descdescending, date, datedescending, type, typedescending, defaults to name
    Returns:
      The sorted sublist of items.
    Throws:
      `RemoteException`
      `ServiceException`

  - ### getTotalNumberOfItems

    int getTotalNumberOfItems() throws RemoteException, ServiceException
    Get the total number of items in this folder
    Returns:
      The number of items in the folder.
    Throws:
      `RemoteException`
      `ServiceException`

  - ### hasDuplicate

    boolean hasDuplicate(String name, String type) throws ServiceException, RemoteException
    Check if there's a duplicate object in this folder with the same name and of the same type.
    Parameters:
      `name` - The name to check for.
      `type` - The type to check for. This should be the value of the PublicType attribute because I can't necessarily instantiate the object if the current user doesn't have ReadMetadata permission on it. I need to construct a filter to do a getCountNoSecurity with.
    Returns:
      true if this folder has an object with the given name and type, false otherwise.
    Throws:
      `ServiceException` - If a repository error occurs.
      `RemoteException` - In the event of remote object failure.

  - ### hasDuplicateSubfolder

    boolean hasDuplicateSubfolder(String name) throws ServiceException, RemoteException
    Check if this folder already has a subfolder with the given name.
    Parameters:
      `name` - The name of the subfolder to check for.
    Returns:
      true if this folder has a subfolder with the given name, false otherwise.
    Throws:
      `ServiceException` - If a metadata server, or other service level error occurs.
      `RemoteException` - In the event of remote object failure.

  - ### isEmpty

    boolean isEmpty() throws ServiceException, RemoteException
    Returns true if this folder has no subfolders and no member objects. This method may return false even if both `getSubfolders()` and `getItems()` return empty lists due to objects hidden by access controls.
    Returns:
      true if this folder has no subfolders and no member objects
    Throws:
      `ServiceException` - If a metadata server, or other service level error occurs.
      `RemoteException` - In the event of remote object failure.

  - ### getContentInfo

    ContentInfo getContentInfo() throws ServiceException, RemoteException
    Returns the `ContentInfo`object corresponding to the root of the given PathUrl.

    Implementation Note: computed results are cached; repeated calls are not expensive.

    Returns:
      The ContentInfo object with the path and credentials for the content area, or null if the folder isn't content mapped.
    Throws:
      `ServiceException` - If a repository error occurs.
      `RemoteException` - In the event of remote object failure.

  - ### getContentCreateDate

    Date getContentCreateDate() throws ServiceException, RemoteException
    Get the content create date. This is maintained separately from the metadata create date, which is when the Tree object itself was created. This date indicates when the content folder was created.
    Returns:
      The Date when the content folder was created.
    Throws:
      `ServiceException` - If a service level error occured.
      `RemoteException` - In the event of remote object failure.

  - ### setContentCreateDate

    void setContentCreateDate(Date date) throws ServiceException, RemoteException
    Set the Date that the content folder was created.
    Parameters:
      `date` - The date that the mapped content folder was created.
    Throws:
      `ServiceException` - If a service level error occured.
      `RemoteException` - In the event of remote object failure.

  - ### getContentModifyDate

    Date getContentModifyDate() throws ServiceException, RemoteException
    Get the content modification date. This is the date and time of the most recent addition to or deletion from this folder. This information may be maintained by the client.
    Returns:
      The Date when an object was last added or removed.
    Throws:
      `ServiceException` - If a service level error occured.
      `RemoteException` - In the event of remote object failure.

  - ### setContentModifyDate

    void setContentModifyDate(Date date) throws ServiceException, RemoteException
    Set the date when an object was last added to or removed from this folder.
    Parameters:
      `date` - The last time the contents of this folder were modified.
    Throws:
      `ServiceException` - If a service level error occured.
      `RemoteException` - In the event of remote object failure.

  - ### isItemNameUnique

    boolean isItemNameUnique(MetadataInterface member) throws ServiceException, RemoteException
    Validate that the name of the metadata object is unique within the Folder. The object should already be an item in the folder. If it's not, then the hasDuplicate call should be made. If the member name is unique in the folder, the method returns true. Otherwise it returns false. This method does not validate the name string itself.
    Parameters:
      `member` - The item to check for a unique name in the folder.
    Returns:
      True if the member's name is unique, false otherwise.
    Throws:
      `ServiceException` - If a repository error occurs.
      `RemoteException` - In the event of remote object failure.

  - ### moveMembersOnOverflow

    boolean moveMembersOnOverflow() throws ServiceException, RemoteException
    Check for too many objects in a folder. If the folder contains more than a limit defined by the folder, the current members of the folder are moved to a new subfolder. The new subfolder will be named "1", "2", etc. Subfolders are not considered in the count.
    Returns:
      true if objects were moved to a subfolder
    Throws:
      `ServiceException` - If a repository error occurs.
      `RemoteException` - In the event of remote object failure.