Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.adk.filesystem
Class IfsFileSystem

    java.lang.Object

      |

      +--oracle.ifs.adk.filesystem.IfsFileSystem

All Implemented Interfaces:
  FileSystem

public class IfsFileSystem
extends java.lang.Object
implements FileSystem

### WHAT IT IS:

The IfsFileSystem API allows developers to perform basic file system tasks with iFS. In addition to standard file system operations (such as copy, move, and delete), this API exposes some iFS-specific features that are at the core of our product (such as versioning and searching).

### WHAT IT IS NOT:

This API is not a replacement for the full repository SDK. Developers who wish to take advantage of advanced functionality in iFS will still have to use the core repository SDK. This API is intended to help developers to accomplish the most common iFS tasks that are directly related to files and folders. Security and full searching are not supported by this API.

### DEFINITIONS:

PublicObject

- PublicObject is the abstract superclass for all user-related classes in iFS, and thus defines the attributes and methods that are common to all of these classes.

LibrarySession

- A LibrarySession object represents an authenticated user session connected to the iFS.

VersionSeries

- A VersionSeries is used to track serial version of the document and its descriptions.

DirectoryUser

- A DirectoryUser object represents an iFS user.

### iFS FILE SYSTEM API IMPLEMENTATION:

The iFS file system API is represented by the IfsFileSystem class. Instances of this class use an existing LibrarySession object to perform the API tasks. Here's an example of the API in action, a simple command-line utility to print out the contents of a folder:

import oracle.ifs.beans.*;
import oracle.ifs.adk.filesystem.IfsFileSystem;

public class listFolder {

static public void main(String argv[]) throws IfsException {
IfsFileSystem fsAPI = new IfsFileSystem("admin", "welcome", "Local");

String dir = argv[0]; //get the path of the Folder whose contents we wish to display
PublicObject po = fsAPI.findPublicObjectByPath(dir);
PublicObject[] contents = fsAPI.listFolder((Folder)po);
System.out.println("Here are the names of the items in folder " + dir);
for (int i=0; i < contents.length; i++)
System.out.println(contents[i].getName());
}

Field Summary
`static char` | `MATCH_ALL` The character used as the wildcard to match any (0 or more) characters.
`static char` | `MATCH_ONE` The character used as the wildcard to match any single character.

Constructor Summary
`IfsFileSystem(LibrarySession session)` Construct an IfsFileSystem object given an already established session.
`IfsFileSystem(java.lang.String username, java.lang.String password, java.lang.String server, java.lang.String serverPassword)` Construct an IfsFileSystem object.

Method Summary
`void` | `addFolderRelationship(Folder folder, PublicObject po)` Create a reference between a Folder and a PublicObject; placing the PublicObject inside the Folder.
`void` | `cancelCheckout(PublicObject po)` Cancel a checkout.
`DirectoryUser` | `checkedOutBy(PublicObject po)` Return the DirectoryUser who currently has PublicObject po checked out, or null if po is not checked out.
`void` | `checkIn(PublicObject po, java.lang.String comment)` If po is unversioned: the session lock will be released on the object.
`PublicObject` | `checkOut(PublicObject po, boolean makeVersioned)` If po is unversioned, and makeVersioned is True: po will become versioned.
`Folder` | `copy(Folder fromFolder, Folder toFolder, boolean recursive, AccessControlList acl)` Copy a Folder into another Folder.
`PublicObject` | `copy(PublicObject po, Folder folder, AccessControlList acl, boolean overwrite)` Copy the PublicObject po into the specified folder.
`Document` | `createDocument(java.lang.String name, java.io.InputStream content, java.lang.String folderPath, AccessControlList acl, boolean doParse, ParserCallback callback)` Create a Document in iFS.
`Folder` | `createFolder(java.lang.String name, Folder destfolder, boolean createParents, AccessControlList acl)` Create a Folder in iFS.
`void` | `delete(Folder folder, boolean recursive)` Delete a Folder.
`void` | `delete(PublicObject po)` Delete a PublicObject.
`PublicObject` | `findPublicObjectById(java.lang.Long id)` Returns the PublicObject having the specified `id`.
`PublicObject` | `findPublicObjectByPath(java.lang.String path)` Returns the PublicObject pointed to by `path`.
`AttributeValue` | `getAttribute(PublicObject po, java.lang.String attrName)` Return a specified attribute of a PublicObject.
`AttributeValue[]` | `getAttributes(PublicObject po, java.lang.String[] attrNames)` Return the specified attributes of a PublicObject.
`DirectoryUser` | `getCurrentUser()` Display the current user in the session.
`java.io.InputStream` | `getDocumentContent(Document doc)` Retrieve the content of a Document as a stream.
`VersionDescription[]` | `getHistory(PublicObject po)` Retrieve the revision history of the specified PublicObject.
`LibrarySession` | `getLibrarySession()` Return the LibrarySession object being used to communicate with iFS.
`Folder[]` | `getParents(PublicObject po)` Return a list of parent Folders that reference the specified PublicObject.
`boolean` | `isCheckedOut(PublicObject po)` Check to see if a PublicObject is currently checked out.
`boolean` | `isVersioned(PublicObject po)` Check to see if a PublicObject is versioned.
`PublicObject[]` | `listFolder(Folder folder, java.lang.String pattern)` Return the items of the specified `folder` whose names match `pattern`.
`PublicObject` | `makeVersioned(PublicObject po)` Convert an unversioned PublicObject into versioned PublicObject.
`PublicObject` | `move(Folder fromFolder, Folder toFolder, PublicObject po, java.lang.String newName, AccessControlList acl, boolean overwrite)` Move a PublicObject from `fromFolder` to `toFolder` with the new name `newName` and new access control list `acl`, if specified.
`Document` | `putDocument(java.lang.String name, java.io.InputStream content, java.lang.String folderPath, AccessControlList acl, boolean doParse, ParserCallback callback)` Create an iFS Document named `name` in Folder `folder` with `content` as the body.
`void` | `removeFolderRelationship(Folder folder, PublicObject po, boolean rmNoRef)` Removes the relationship between a Folder and a PublicObject.
`void` | `rename(PublicObject po, java.lang.String newName)` Rename a PublicObject.
`java.io.InputStream` | `renderAsStream(PublicObject po, java.lang.String rendererType, java.lang.String rendererName)` Render the object out as a stream.
`PublicObject[]` | `searchByContent(java.lang.String[] keywords, Folder folder, int maxDepth)` Perform a recursive search based on document content starting in Folder `folder`.
`PublicObject[]` | `searchByContent(java.lang.String keyword, Folder folder, int maxDepth)` Perform a recursive search based on document content starting in Folder `folder`.
`PublicObject[]` | `searchByName(java.lang.String pattern, Folder folder, int maxDepth)` Perform a recursive search based on filename starting in Folder `folder`.
`void` | `setAttribute(PublicObject po, java.lang.String name, AttributeValue value)` Set an attribute for a PublicObject in iFS.
`void` | `setAttributes(PublicObject po, java.lang.String[] names, AttributeValue[] values)` Set attributes for a PublicObject in iFS.
`void` | `setLibrarySession(LibrarySession session)` Set a new LibrarySession to communicate with iFS.
`Document` | `updateDocument(java.lang.String name, java.io.InputStream content, java.lang.String folderPath, AccessControlList acl, boolean doParse, ParserCallback callback)` Update a document in iFS.

Field Detail

### MATCH_ALL

    public static final char MATCH_ALL

  The character used as the wildcard to match any (0 or more) characters.

### MATCH_ONE

    public static final char MATCH_ONE

  The character used as the wildcard to match any single character.

Constructor Detail

### IfsFileSystem

    public IfsFileSystem(LibrarySession session)
                  throws IfsException

  Construct an IfsFileSystem object given an already established session.
  Parameters:
    `session` - Session object

### IfsFileSystem

    public IfsFileSystem(java.lang.String username,
                         java.lang.String password,
                         java.lang.String server,
                         java.lang.String serverPassword)
                  throws IfsException

  Construct an IfsFileSystem object. A new session will be created in this constructor. `username`, `password`, and `server` must be specified. `serverPassword` is optional.
  Parameters:
    `username` - Username
    `password` - Password
    `server` - Server to connect to
    `serverPassword` - Server password

Method Detail

### addFolderRelationship

    public void addFolderRelationship(Folder folder,
                                      PublicObject po)
                               throws IfsException

  Create a reference between a Folder and a PublicObject; placing the PublicObject inside the Folder.
  Specified by:
    `addFolderRelationship` in interface `FileSystem`
  Parameters:
    `folder` - Folder object that will contain `po`
    `po` - PublicObject object
  Returns:
    None
  Throws:
    `IfsException(68010)` - - if a po by that name already exists in folder.

### cancelCheckout

    public void cancelCheckout(PublicObject po)
                        throws IfsException

  Cancel a checkout. Unreserve the Primary VersionSeries for the document.
  Specified by:
    `cancelCheckout` in interface `FileSystem`
  Parameters:
    `po` - PublicObject object to be cancelled
  Returns:
    None
  Throws:
    `IfsException(68011)` - - if po is not checked out.
    `IfsException(68012)` - - if po is not versioned.
    `IfsException(68022)` - - if po is a Folder.

### checkIn

    public void checkIn(PublicObject po,
                        java.lang.String comment)
                 throws IfsException

  If po is unversioned:
  - the session lock will be released on the object.
  If po is versioned:
  - a new version will be created in the primary VersionSeries.
  - the primary VersionSeries will be unreserved.
  Specified by:
    `checkIn` in interface `FileSystem`
  Parameters:
    `po` - PublicObject to be checked in
    `comments` - CheckIn comments
  Returns:
    None
  Throws:
    `IfsException(68011)` - - if po is not checked out.
    `IfsException(68012)` - - if po is not versioned.
    `IfsException(68022)` - - if po is a Folder.

### checkOut

    public PublicObject checkOut(PublicObject po,
                                 boolean makeVersioned)
                          throws IfsException

  If po is unversioned, and makeVersioned is True:
  - po will become versioned.
  - the primary VersionSeries will be reserved.
  If po is unversioned, and makeVersioned is False:
  - an exception will be thrown.
  If po is versioned:
  - primary VersionSeries will be reserved.
  Specified by:
    `checkOut` in interface `FileSystem`
  Parameters:
    `po` - PublicObject to be checked out
    `makeVersioned` - Flag to request creation of VersionSeries for po
  Returns:
    PublicObject
  Throws:
    `IfsException(68012)` - - if po is not versioned, and makeVersioned is false.
    `IfsException(68014)` - - if po is already checked out.
    `IfsException(68022)` - - if po is a Folder.

### checkedOutBy

    public DirectoryUser checkedOutBy(PublicObject po)
                               throws IfsException

  Return the DirectoryUser who currently has PublicObject po checked out, or null if po is not checked out.
  Specified by:
    `checkedOutBy` in interface `FileSystem`
  Parameters:
    `po` - PublicObject
  Returns:
    DirectoryUser
  Throws:
    `IfsException(68012)` - - if po is not versioned
    `IfsException(68022)` - - if po is a Folder.

### copy

    public PublicObject copy(PublicObject po,
                             Folder folder,
                             AccessControlList acl,
                             boolean overwrite)
                      throws IfsException

  Copy the PublicObject po into the specified folder. An exception will be thrown if attempts are made to overwrite a non-Folder object with a Folder object, and vice versa. If `po` is a non-Folder object:
  - If `overwrite` is True, existing PublicObject in `folder` will be overwritten.
  - If `overwrite` is False, a new copy will be created with the naming convention "Copy of .." for the first copy, and "Copy (#) of .." for all other copies.
  For `po` is a Folder object:
  - A recursive copy is performed.
  - If `overwrite` is True, the content of `po` will be copied over to the existing PublicObject in `folder` with versioning semantics.
  - If `overwrite` is False, a new copy will be created with the naming convention "Copy of .." for the first copy, and "Copy (#) of .." for all other copies.
  Specified by:
    `copy` in interface `FileSystem`
  Parameters:
    `po` - PublicObject to copy from
    `folder` - Folder object to copy to
    `acl` - ACL to be applied to the newly created copy; if null, session user's default ACL is used
    `overwrite` - If true, overwrite existing PublicObject in folder . Note: overwrite behaves differently if po is a Folder. See above for details.
  Returns:
    PublicObject (the new copy)
  Throws:
    `IfsException(68021)` - - if name conflict exists while trying to copy between a Folder and a non-Folder objects.
  See Also:
    `copy(Folder, Folder, boolean, AccessControlList)`

### copy

    public Folder copy(Folder fromFolder,
                       Folder toFolder,
                       boolean recursive,
                       AccessControlList acl)
                throws IfsException

  Copy a Folder into another Folder. If `recursive` flag is True, subfolders will be copied as well. If there exists a Folder object in `toFolder` with same name as `fromFolder`, the contents of `fromFolder` will be copied over to the existing Folder object in `toFolder` with versioning semantics.
  Specified by:
    `copy` in interface `FileSystem`
  Parameters:
    `fromFolder` - Folder to copy from
    `toFolder` - Folder to copy to
    `recursive` - If True, subfolders will be copied
    `acl` - ACL to be applied to the newly created copy of fromFolder (but not its items); if null, session user's default ACL will be used
  Returns:
    Folder (the new copy)
  Throws:
    `IfsException(68021)` - - if name conflict exists while trying to copy between a Folder and a non-Folder objects.

### createDocument

    public Document createDocument(java.lang.String name,
                                   java.io.InputStream content,
                                   java.lang.String folderPath,
                                   AccessControlList acl,
                                   boolean doParse,
                                   ParserCallback callback)
                            throws IfsException,
                                   java.io.IOException

  Create a Document in iFS. If a document already exists with the same name as `name`, an exception is thrown. If `doParse` is true and the object created from parsing the input stream is a Document or a subclass, then it will be returned. If the object created from parsing the input stream is not a Document or a subclass, null is returned (but the object is still created).
  Specified by:
    `createDocument` in interface `FileSystem`
  Parameters:
    `name` - Name of the document to be created
    `content` - InputStream to read contents from; if null, empty document is created
    `folderPath` - Absolute path of folder in which to create the document
    `acl` - ACL to be assigned to the new document; if null, sess user's default ACL will be used
    `doParse` - If true, input stream will be parsed using a parser which is determined based on the file extension
    `callback` - Parser callback to be specified if doParse is true
  Returns:
    Document (the new Document created)
  Throws:
    `IfsException(68003)` - - if `folderPath` is not a Folder
    `IfsException(68004)` - - if `folderPath` is not found
    `IfsException(68010)` - - if a document by that name already exists

### createFolder

    public Folder createFolder(java.lang.String name,
                               Folder destfolder,
                               boolean createParents,
                               AccessControlList acl)
                        throws IfsException

  Create a Folder in iFS.
  Specified by:
    `createFolder` in interface `FileSystem`
  Parameters:
    `name` - Name of the Folder to be created; name can also be in the format of a path (relative to destFolder) if createParents is true (eg. "a/b/c")
    `destfolder` - Folder in which to create the new folder
    `createParents` - If true, non-existing parent folders will be created
    `acl` - ACL to be assigned to new folder(s) created; if null, session user's default ACL will be used
  Returns:
    Folder (the new folder created)
  Throws:
    `IfsException` - - if operation failed.

### delete

    public void delete(PublicObject po)
                throws IfsException

  Delete a PublicObject. If `po` is a Folder, then recursive delete will be performed.
  Specified by:
    `delete` in interface `FileSystem`
  Parameters:
    `po` - PublicObject to be deleted.
  Returns:
    None
  Throws:
    `IfsException` - - if operation failed.
  See Also:
    `delete(Folder, boolean)`

### delete

    public void delete(Folder folder,
                       boolean recursive)
                throws IfsException

  Delete a Folder. If recursive if True, subfolders will be deleted.
  Specified by:
    `delete` in interface `FileSystem`
  Parameters:
    `folder` - Folder object to be deleted
    `recursive` - If true, subfolders will be deleted
  Returns:
    None
  Throws:
    `IfsException(68020)` - - if `folder` is non-empty, and `recursive` is False.

### findPublicObjectById

    public PublicObject findPublicObjectById(java.lang.Long id)
                                      throws IfsException

  Returns the PublicObject having the specified `id`.
  Specified by:
    `findPublicObjectById` in interface `FileSystem`
  Parameters:
    `id` - Id of the PublicObject
  Returns:
    PublicObject
  Throws:
    `IfsException` - - if operation failed.

### findPublicObjectByPath

    public PublicObject findPublicObjectByPath(java.lang.String path)
                                        throws IfsException

  Returns the PublicObject pointed to by `path`.
  Specified by:
    `findPublicObjectByPath` in interface `FileSystem`
  Parameters:
    `path` - Path to the PublicObject
  Returns:
    PublicObject
  Throws:
    `IfsException` - - if operation failed.

### getAttribute

    public AttributeValue getAttribute(PublicObject po,
                                       java.lang.String attrName)
                                throws IfsException

  Return a specified attribute of a PublicObject.
  Specified by:
    `getAttribute` in interface `FileSystem`
  Parameters:
    `po` - PublicObject from which to get the attribute
    `attrName` - Name of the attribute
  Returns:
    AttributeValue
  Throws:
    `IfsException` - - if operation failed.

### getAttributes

    public AttributeValue[] getAttributes(PublicObject po,
                                          java.lang.String[] attrNames)
                                   throws IfsException

  Return the specified attributes of a PublicObject. If attrNames is null, all attributes will be returned.
  Specified by:
    `getAttributes` in interface `FileSystem`
  Parameters:
    `po` - PublicObject from which to get the attributes
    `attrNames` - A list of attributes to return; if null, all attributes will be returned
  Returns:
    An array of AttributeValue objects
  Throws:
    `IfsException` - - if operation failed.

### getCurrentUser

    public DirectoryUser getCurrentUser()
                                 throws IfsException

  Display the current user in the session.
  Specified by:
    `getCurrentUser` in interface `FileSystem`
  Returns:
    DirectoryUser
  Throws:
    `IfsException` - - if operation failed.

### getDocumentContent

    public java.io.InputStream getDocumentContent(Document doc)
                                           throws IfsException,
                                                  java.io.IOException

  Retrieve the content of a Document as a stream.
  Specified by:
    `getDocumentContent` in interface `FileSystem`
  Parameters:
    `doc` - Document from which to retrieve content
  Returns:
    InputStream
  Throws:
    `IfsException` - - if operation failed.
  See Also:
    `renderAsStream(PublicObject, String, String)`

### getHistory

    public VersionDescription[] getHistory(PublicObject po)
                                    throws IfsException

  Retrieve the revision history of the specified PublicObject. The versions are ordered oldest first. If `po` is unversioned, return null.
  Specified by:
    `getHistory` in interface `FileSystem`
  Parameters:
    `po` - PublicObject from which to get history
  Returns:
    An array of VersionDescription objects. Null; if `po` is unversioned
  Throws:
    `IfsException(68022)` - - if po is a Folder.

### getLibrarySession

    public LibrarySession getLibrarySession()

  Return the LibrarySession object being used to communicate with iFS.
  Specified by:
    `getLibrarySession` in interface `FileSystem`
  Returns:
    LibrarySession

### getParents

    public Folder[] getParents(PublicObject po)
                        throws IfsException

  Return a list of parent Folders that reference the specified PublicObject.
  Specified by:
    `getParents` in interface `FileSystem`
  Parameters:
    `po` - PublicObject from which to retrieve parents
  Returns:
    An array of Folder objects
  Throws:
    `IfsException` - - if operation failed.

### isCheckedOut

    public boolean isCheckedOut(PublicObject po)
                         throws IfsException

  Check to see if a PublicObject is currently checked out. Return 'True' if checked out, 'False' otherwise.
  Specified by:
    `isCheckedOut` in interface `FileSystem`
  Parameters:
    `po` - PublicObject
  Returns:
    boolean
  Throws:
    `IfsException(68012)` - - if po is not versioned.
    `IfsException(68022)` - - if po is a Folder.
  See Also:
    `checkedOutBy(PublicObject)`

### isVersioned

    public boolean isVersioned(PublicObject po)
                        throws IfsException

  Check to see if a PublicObject is versioned. Return 'true' if po is versioned. False otherwise.
  Specified by:
    `isVersioned` in interface `FileSystem`
  Parameters:
    `po` - PublicObject
  Returns:
    boolean
  Throws:
    `IfsException(68022)` - - if po is a Folder..

### listFolder

    public PublicObject[] listFolder(Folder folder,
                                     java.lang.String pattern)
                              throws IfsException

  Return the items of the specified `folder` whose names match `pattern`. (Subfolders are not expanded -- see searchByName()). `pattern` may contain wildcards. If `pattern` is null, then all items will be returned. The returned array is in alphabetical order.
  Specified by:
    `listFolder` in interface `FileSystem`
  Parameters:
    `folder` - Folder to list contents of
    `pattern` - Filename pattern to be matched; if null, return all
  Returns:
    An array of PublicObject
  Throws:
    `IfsException` - - if operation failed.
  See Also:
    `searchByName(String, Folder, int)`

### makeVersioned

    public PublicObject makeVersioned(PublicObject po)
                               throws IfsException

  Convert an unversioned PublicObject into versioned PublicObject. All parents of `po` will have their references changed to point to the newly created Family object.
  Specified by:
    `makeVersioned` in interface `FileSystem`
  Parameters:
    `doc` - Unversioned document to convert
  Returns:
    PublicObject
  Throws:
    `IfsException(68014)` - - if po is already checked out.
    `IfsException(68022)` - - if po is a Folder.

### move

    public PublicObject move(Folder fromFolder,
                             Folder toFolder,
                             PublicObject po,
                             java.lang.String newName,
                             AccessControlList acl,
                             boolean overwrite)
                      throws IfsException

  Move a PublicObject from `fromFolder` to `toFolder` with the new name `newName` and new access control list `acl`, if specified. If `fromFolder` and `toFolder` are the same:
  - If `newName` is not null:
    - rename() will be performed, ignoring `acl`..
  - If `acl` is not null:
    - an exception will be thrown.
  If there exists a po with same name in `toFolder` as `po`:
  - If `overwrite` is false:
    - an exception will be thrown.
  - If `overwrite` is true and `po` is a Folder:
    - contents of `po` will be copied to the existing folder in `toFolder` with versioning semantics.
  - If `overwrite` is true and `po` is not a Folder:
    - overwrite the existing po in `toFolder` with `po` with versioning semantics.
  Otherwise:
  - If `newName` is specified:
    - Move `po` to `toFolder`.
    - Change `po`'s name to `newName`.
  - If `newName` is not specified:
    - Move `po` to `toFolder`.
  If ACL is null, `po`'s ACL will be left unchanged.
  Specified by:
    `move` in interface `FileSystem`
  Parameters:
    `fromFolder` - Folder in which the PO belongs
    `toFolder` - Folder to which to move PO
    `po` - PublicObject to move
    `newName` - New name to be assigned to the moved PO
    `acl` - ACL to be used on the moved object; if null, acl will not be changed
    `overwrite` - If true, overwrite existing PublicObject in folder
  Returns:
    PublicObject
  Throws:
    `IfsException(68018)` - - if po is checked out.
    `IfsException(68019)` - - if po is an unfoldered version document.
    `IfsException(68021)` - - if name conflict exists while trying to move between a Folder and a non-Folder objects.

### putDocument

    public Document putDocument(java.lang.String name,
                                java.io.InputStream content,
                                java.lang.String folderPath,
                                AccessControlList acl,
                                boolean doParse,
                                ParserCallback callback)
                         throws IfsException,
                                java.io.IOException

  Create an iFS Document named `name` in Folder `folder` with `content` as the body. If there is an existing Document with same name as `name`, this call is equivalent to updateDocument(). If document does not exist:
  - an unversioned Document will be created.
  If document does exist:
  - updateDocument() is called.
  If `doParse` is true:
  - the input stream will be parsed using a parser which is determined based on the file extension.
  If `acl` is null:
  - session user's default acl will be used.
  If `doParse` is true and the object created from parsing the input stream is a Document or a subclass, then it will be returned. If the object created from parsing the input stream is not a Document or a subclass, null is returned (but the object is still created).
  Parameters:
    `name` - Name of the document
    `content` - InputStream from which to read document contents
    `folderPath` - Absolute path of Folder in which to create the document
    `acl` - ACL to be assigned to the document; if null, session user's default ACL will be used
    `doParse` - If true, input stream will be parsed using a parser which is determined based on the file extension
    `callback` - Parser callback to be specified if `doParse` is true
  Returns:
    Document (the new document created)
  Throws:
    `IfsException` - - if operation failed.

### removeFolderRelationship

    public void removeFolderRelationship(Folder folder,
                                         PublicObject po,
                                         boolean rmNoRef)
                                  throws IfsException

  Removes the relationship between a Folder and a PublicObject. If `rmNoRef` is 'True', `po` will be deleted if there are no other relationships existing for `po`.
  Specified by:
    `removeFolderRelationship` in interface `FileSystem`
  Parameters:
    `folder` - Folder from which contains a reference to `po`
    `po` - PublicObject from which to remove reference
    `rmNoRef` - If 'True', `po` will be removed when there are no more existing relationships
  Returns:
    None
  Throws:
    `IfsException` - - if operation failed.
  See Also:
    `delete(PublicObject)`

### rename

    public void rename(PublicObject po,
                       java.lang.String newName)
                throws IfsException

  Rename a PublicObject. If any of `po`'s parent Folders contains an existing PO with the same name as `newName`, the PO will not be renamed, and an exception will be thrown.
  Specified by:
    `rename` in interface `FileSystem`
  Parameters:
    `po` - PublicObject to be renamed
    `newName` - New name to be assigned
  Returns:
    None
  Throws:
    `IfsException(68005)` - - if newName already exists.

### renderAsStream

    public java.io.InputStream renderAsStream(PublicObject po,
                                              java.lang.String rendererType,
                                              java.lang.String rendererName)
                                       throws IfsException

  Render the object out as a stream. The renderer that is used is determined in the following fashion:
  - If rendererName is not null, the specified renderer always gets used.
  - If rendererName is null, and rendererType is not null, then:
    - if rendererType has a mapping to a renderer in the object's PolicyBundle, that renderer is used.
    - otherwise, if rendererType has a mapping to a renderer in the class object's PolicyBundle, that renderer is used.
    - otherwise, if the parent class' class object has a mapping from rendererType to a renderer, that renderer is used, etc., all the way up to PublicObject, from which all classes inherit.
    - if no mapping is found in this hierarchy, an exception is thrown.
  Specified by:
    `renderAsStream` in interface `FileSystem`
  Parameters:
    `po` - PublicObject
    `rendererType` - String
    `rendererName` - String
  Returns:
    InputStream

### searchByContent

    public PublicObject[] searchByContent(java.lang.String keyword,
                                          Folder folder,
                                          int maxDepth)
                                   throws IfsException

  Perform a recursive search based on document content starting in Folder `folder`. The maximum depth of recursive search to be performed starting at `folder` can be specified in the `maxDepth` argument. If `maxDepth` is < 1, it is ignored and the default is a search with unlimited depth. Only foldered items containing `keyword` will be returned. Only unversioned documents' content can be searched. Versioned documents will not be handled. This will be fixed in the next release. For example: searchByContent("happy", thisFolder, 2)
  - return all documents whose contents contain the word "happy" in `thisFolder` and/or its subfolders 2 levels deep.
  Parameters:
    `keyword` - A keyword on which to search
    `folder` - Folder from which to start the search; if null, the search will start from the root folder
    `maxDepth` - Maximum depth for search; if < 1, unlimited depth
  Returns:
    An array of PublicObject objects

### searchByContent

    public PublicObject[] searchByContent(java.lang.String[] keywords,
                                          Folder folder,
                                          int maxDepth)
                                   throws IfsException

  Perform a recursive search based on document content starting in Folder `folder`. The maximum depth of recursive search to be performed starting at `folder` can be specified in the `maxDepth` argument. If `maxDepth` is < 1, it is ignored and the default is a search with unlimited depth. Only foldered items containing `keyword` will be returned. Only unversioned documents' content can be searched. Versioned documents will not be handled. This will be fixed in the next release. For example: searchByContent(new String[] {"abc", "smile"}, null, 0)
  - return all documents whose contents contain the words "abc" and "smile" in the root folder and/or all of its subfolders.
  Parameters:
    `keywords` - A set of keywords on which to search
    `folder` - Folder from which to start the search; if null, the search will start from the root folder
    `maxDepth` - Maximum depth for search; if < 1, unlimited depth
  Returns:
    An array of PublicObject objects

### searchByName

    public PublicObject[] searchByName(java.lang.String pattern,
                                       Folder folder,
                                       int maxDepth)
                                throws IfsException

  Perform a recursive search based on filename starting in Folder `folder`. Only foldered items whose filenames match `pattern` will be returned. "*" matches any string of zero or more characters, and "?" matches any single character. For versioned documents, only the Family's name will be searched. Each individual version's name will not be searched. This will be fixed in the next release. For example: searchByName(MATCH_ALL + "txt", thisFolder, 0)
  - return all PublicObjects whose names match the pattern "*.txt" in thisFolder and/or all of its subfolders.
  searchByName("abc.txt", thisFolder, 3)
  - return all PublicObjects whose names match exactly "abc.txt" in thisFolder and/or its subfolders 3 levels deep.
  Parameters:
    `pattern` - Name pattern
    `folder` - Folder from which to start the search; if null, the search will start from the root folder
    `maxDepth` - Maximum depth for search; if < 1, it is ignored
  Returns:
    An array of PublicObject objects

### setAttribute

    public void setAttribute(PublicObject po,
                             java.lang.String name,
                             AttributeValue value)
                      throws IfsException

  Set an attribute for a PublicObject in iFS.
  Specified by:
    `setAttribute` in interface `FileSystem`
  Parameters:
    `po` - PublicObject for which to set the attribute
    `name` - Name of the attribute
    `value` - Attribute value to be set
  Returns:
    None
  Throws:
    `IfsException` - if operation failed.

### setAttributes

    public void setAttributes(PublicObject po,
                              java.lang.String[] names,
                              AttributeValue[] values)
                       throws IfsException

  Set attributes for a PublicObject in iFS.
  Specified by:
    `setAttributes` in interface `FileSystem`
  Parameters:
    `po` - PublicObject for which to set attributes
    `names` - Names of the attributes
    `values` - Attribute values to be set
  Returns:
    None
  Throws:
    `IfsException` - - if operation failed.

### setLibrarySession

    public void setLibrarySession(LibrarySession session)
                           throws IfsException

  Set a new LibrarySession to communicate with iFS. Please note that any objects retrieved from the previous session are no longer valid.
  Specified by:
    `setLibrarySession` in interface `FileSystem`
  Parameters:
    `session` - LibrarySession object
  Returns:
    None

### updateDocument

    public Document updateDocument(java.lang.String name,
                                   java.io.InputStream content,
                                   java.lang.String folderPath,
                                   AccessControlList acl,
                                   boolean doParse,
                                   ParserCallback callback)
                            throws IfsException,
                                   java.io.IOException

  Update a document in iFS. Multiple update calls to the same Document have the following behavior:
  - If document is versioned:
    - If document is checked out by the current user:
      - only one new version is created upon checkin (only the last update call before check in has any permanent effect).
    - If document is checked out by another user:
      - an exception is thrown.
    - If document is not checked out:
      - a new version is created with new content.
  - If document is unversioned:
    - its body is overwritten by each call.
  If `doParse` is true and the object created from parsing the input stream is a Document or a subclass, then it will be returned. If the object created from parsing the input stream is not a Document or a subclass, null is returned (but the object is still created).
  Specified by:
    `updateDocument` in interface `FileSystem`
  Parameters:
    `name` - Name of the document
    `content` - InputStream from which to read the document contents
    `folderPath` - Absolute path of folder in which to update the document
    `acl` - ACL to be assigned to the document; if null, session user's default ACL will be used
    `doParse` - If 'True', input stream will be parsed using a parser which is determined based on the file extension
    `callback` - Parser callback to be specified if doParse is true
  Returns:
    Document (the updated document)
  Throws:
    `IfsException(68003)` - if folderPath is not a Folder.
    `IfsException(68004)` - if folderPath is not found.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD