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

## oracle.ifs.admin.tools.schema
Class CopyToIfs

    java.lang.Object
      oracle.ifs.common.BaseMain
          oracle.ifs.common.BaseApp
              oracle.ifs.admin.tools.schema.CopyToIfs

All Implemented Interfaces:
  java.lang.Runnable, Logger

    public class CopyToIfs

extends BaseApp

The CopyToIfs class allows clients to copy files and directories from the local filesystem into iFS. To use this class, create a new instance and use the `connect` method to login to iFS. Then use the `copyDir` method to specify a path on the local filesystem and a path within iFS. The method will recursively copy the contents of the entire directory tree in the local filesystem into the specified path in iFS, creating folders as necessary. To create single Documents or Folders, clients can call the `createFolder` and `createDocument` methods directly.

Note: `CopyToIfs` does not set any ACLs on the objects being created in iFS -- they are set to the default ACL and owned by the user who is specified in the `connect` method.

Modified:
  dlong 01/25/2005 Ignore copy of hidden files, sgarg 06/19/2001 Fix for bug# 1838699. Overloaded functions to take ACL type., lsaenz 02/08/2001 added ability to set language/characterset used for content indexing., lsaenz 08/17/2000 added constructor with LibrarySession., lsaenz 07/24/2000 fixed bug introduced by change 6292., lsaenz 03/20/2000 made createFolder method do nothing if Folder already exists., kgillett 03/20/2000 added throws IfsException to getIfsPathFromFile., kgillett 03/15/2000 creates file withing version framework, lsaenz 02/17/2000 put the connect method back in, as this class must override BaseApp's connect method to provide additional functionality. Also fixed some terrible bugs introduced due to using the root Folder as where to begin searching for absolute paths, rather than good old FolderPathResolver., kgillett 02/14/2000 added usage of the FolderPathDelimiter session property., dlong 02/13/2000 removed connect as this is in BaseApp now., kgillett 02/11/2000 removed import for oracle.ifs.beans.FolderPathResolver added import for oracle.ifs.utils.common.PublicObjectUtilites changed createDocument to use PublicObjectUtilities changed createFolder to use PublicObjectUtilities changed ifs delimiter handling, lsaenz 02/06/2000 added import statements for oracle.ifs.utils.*., lsaenz 01/28/2000 made protected Constructor not automatically call doCopy, eliminating duplicate throwing of some Exceptions. Also added servicePassword to the connect method to support iFS schema passwords other than the default of "same as the schema name"., lsaenz 01/25/2000 removed setting default acl to that of parent Folder from methods createDocument and createFolder (fixed bug #1138137)., kgillett 12/23/1999 added setting default acl to that of parent Folder to methods createDocument and createFolder., lsaenz 12/08/1999 Changed name of method being used from OsUtils; change reflected in this class., lsaenz 12/04/1999 Made some methods private, updated comments., lsaenz 12/03/1999 Fixed bug in createFolderHierarchy., lsaenz 12/02/1999 Now proactively converts local filename and path strings to use the correct path-separator character for the current platform. Also made createFolderHierarchy public., lsaenz 12/01/1999 Added ability to run from the command-line using standard BaseApp-style parameters., lsaenz 11/30/1999 Added ability to recursively create a directory tree if folders do not already exist in iFS. Also updated comments., lsaenz 11/22/1999 Created.

Field Summary

Fields inherited from class oracle.ifs.common.BaseApp
`m_currentuser`

Fields inherited from class oracle.ifs.common.BaseMain
`m_defaultWriter, m_logWriter, m_parametertable, m_timervalue`

Constructor Summary
`CopyToIfs()` Creates a new CopyToIfs.
`CopyToIfs(LibrarySession sess)` Creates a new CopyToIfs given a LibrarySession.
`CopyToIfs(java.lang.String[] args)` Creates a new CopyToIfs given command-line arguments used to determine what to copy to iFS.
`CopyToIfs(java.lang.String[] args, LibrarySession sess)` Creates a new CopyToIfs given command-line arguments used to determine what to copy to iFS.

Method Summary
`LibrarySession` | `connect(java.lang.String username, java.lang.String password, java.lang.String server, java.lang.String serverPassword)` Create a LibrarySession.
`void` | `copyDir(java.lang.String rootDir, java.lang.String ifsRootDir)` Copies a directory tree from the local filesystem into iFS.
`void` | `copyDir(java.lang.String rootDir, java.lang.String ifsRootDir, java.lang.String aclType)` Copies a directory tree from the local filesystem into iFS.
`void` | `copyDir(java.lang.String rootDir, java.lang.String ifsRootDir, java.lang.String language, java.lang.String charset)` Copies a directory tree from the local filesystem into iFS.
`void` | `copyDir(java.lang.String rootDir, java.lang.String ifsRootDir, java.lang.String language, java.lang.String charset, java.lang.String aclType)` Copies a directory tree from the local filesystem into iFS.
`void` | `createDocument(java.lang.String name, java.lang.String parent, java.io.FileInputStream content)` Creates a new Document in iFS, given a FileInputStream which points to an existing file in the local filesystem.
`void` | `createDocument(java.lang.String name, java.lang.String parent, java.io.FileInputStream content, java.lang.String aclType)` Creates a new Document in iFS, given a FileInputStream which points to an existing file in the local filesystem.
`void` | `createDocument(java.lang.String name, java.lang.String parent, java.io.FileInputStream content, java.lang.String language, java.lang.String charset)` Creates a new Document in iFS, given a FileInputStream which points to an existing file in the local filesystem.
`void` | `createDocument(java.lang.String name, java.lang.String parent, java.io.FileInputStream content, java.lang.String language, java.lang.String charset, java.lang.String aclType)` Creates a new Document in iFS, given a FileInputStream which points to an existing file in the local filesystem.
`void` | `createFolder(java.lang.String name, java.lang.String parent)` Creates a new Folder in iFS. Note: this method does nothing if the Folder already exists in iFS.
`void` | `createFolder(java.lang.String name, java.lang.String parent, java.lang.String aclType)` Creates a new Folder in iFS. Note: this method does nothing if the Folder already exists in iFS.
`void` | `createFolderHierarchy(java.lang.String dir)` Recursively creates a folder hierarchy starting at the root of iFS (/) and ending at `dir`.
`void` | `createFolderHierarchy(java.lang.String dir, java.lang.String aclType)` Recursively creates a folder hierarchy starting at the root of iFS (/) and ending at `dir`.
`void` | `disconnect()` Disconnects from iFS.
`protected AccessControlList` | `getACLFor(java.lang.String aclType)`
`static void` | `main(java.lang.String[] args)` Runs CopyToIfs from the command-line given parameters: `username = [iFS user to login as] password = [iFS user's password] server = [iFS server to connect to] serverpassword = [Oracle iFS user DBMS password] language = [Oracle language name to use when indexing Document contents] localdirectory = [directory on local filesystem to copy into iFS] ifsdirectory = [directory in iFS to copy files into] localfile = [file on local filesystem to copy into iFS] ifsfolder = [name of folder to create in iFS] ifsparent = [folder in iFS to put the new file or folder into] acltype = [ACL to apply to the folder/document]`
`void` | `run()` Empty implementation; required by subclasses of BaseApp

Methods inherited from class oracle.ifs.common.BaseApp
`connect, Connect, connect, Connect, Connect, Connect, connect, Connect, Connect, Disconnect, getCachePerformanceString, getCleartextCredential, getCleartextCredential, getConnectionPoolPerformanceString, getConnectOptions, getConnectOptions, getConnectOptions, getLocale, showCachePerformance, showConnectionPoolPerformance`

Methods inherited from class oracle.ifs.common.BaseMain
`getElapsedTime, getParameterTable, initTrace, log, log, logCurrentTimestamp, printStackTrace, setTimer, showElapsedTime`

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

Constructor Detail

### CopyToIfs

    public CopyToIfs()

  Creates a new CopyToIfs.

### CopyToIfs

    public CopyToIfs(LibrarySession sess)

  Creates a new CopyToIfs given a LibrarySession.

### CopyToIfs

    public CopyToIfs(java.lang.String[] args)

  Creates a new CopyToIfs given command-line arguments used to determine what to copy to iFS.

### CopyToIfs

    public CopyToIfs(java.lang.String[] args,
                     LibrarySession sess)

  Creates a new CopyToIfs given command-line arguments used to determine what to copy to iFS.

  Parameters:
    `args` - name/value pairs that will be used to determine what to copy into iFS. See main() for more information.
    `sess` - the LibrarySession to use.

Method Detail

### main

    public static void main(java.lang.String[] args)

  Description copied from class: `CopyToIfs`
  Runs CopyToIfs from the command-line given parameters:

  > `
  > username = [iFS user to login as]
  > password = [iFS user's password]
  > server = [iFS server to connect to]
  > serverpassword = [Oracle iFS user DBMS password]
  > language = [Oracle language name to use when indexing Document contents]
  > localdirectory = [directory on local filesystem to copy into iFS]
  > ifsdirectory = [directory in iFS to copy files into]
  > localfile = [file on local filesystem to copy into iFS]
  > ifsfolder = [name of folder to create in iFS]
  > ifsparent = [folder in iFS to put the new file or folder into]
  > acltype = [ACL to apply to the folder/document]`

  Parameters:
    `args` - command-line arguments in standard BaseApp format (name=value).

### connect

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

  Description copied from class: `BaseApp`
  Create a LibrarySession. This uses a CleartextCredential from specified username/password information, and a ConnectOptions from the specified server & server password, and additional information contained in the Parametertable.

  Overrides:
    `connect` in class `BaseApp`
  Throws:
    `IfsException` - if operation fails.

### disconnect

    public void disconnect()
                    throws IfsException

  Description copied from class: `CopyToIfs`
  Disconnects from iFS.

  Throws:
    `IfsException` - if an error occurs while disconnecting.

### copyDir

    public void copyDir(java.lang.String rootDir,
                        java.lang.String ifsRootDir,
                        java.lang.String language,
                        java.lang.String charset)
                 throws IfsException,
                        DirectoryItemHandlerException

  Description copied from class: `CopyToIfs`
  Copies a directory tree from the local filesystem into iFS. Each file in the directory tree is inserted into iFS as a new Document whose contents are indexed using the given language. Note: `ifsRootDir` must be a path following iFS path conventions (i.e. m_session.getFolderPathDelimiter is the file separator). Also note that if `ifsRootDir` does not exist in iFS, this method will create the necessary folders.

  Parameters:
    `rootDir` - the directory on the local filesystem to copy into iFS. This is used as the "root directory" for `DirectoryTree.traverse`.
    `ifsRootDir` - the directory in which to place the copied tree within iFS.
    `language` - the Oracle language name to use when indexing the new Document's contents.
    `charset` - the character set to use when indexing the new Document's contents.
  Throws:
    `IfsException` - if an error occurs while creating the folders for `ifsRootDir` if they do not already exist.
    `DirectoryItemHandlerException` - if an error occurs while copying the tree into iFS.

### copyDir

    public void copyDir(java.lang.String rootDir,
                        java.lang.String ifsRootDir,
                        java.lang.String language,
                        java.lang.String charset,
                        java.lang.String aclType)
                 throws IfsException,
                        DirectoryItemHandlerException

  Description copied from class: `CopyToIfs`
  Copies a directory tree from the local filesystem into iFS. Each file in the directory tree is inserted into iFS as a new Document whose contents are indexed using the given language. Note: `ifsRootDir` must be a path following iFS path conventions (i.e. m_session.getFolderPathDelimiter is the file separator). Also note that if `ifsRootDir` does not exist in iFS, this method will create the necessary folders.

  Parameters:
    `rootDir` - the directory on the local filesystem to copy into iFS. This is used as the "root directory" for `DirectoryTree.traverse`.
    `ifsRootDir` - the directory in which to place the copied tree within iFS.
    `language` - the Oracle language name to use when indexing the new Document's contents.
    `charset` - the character set to use when indexing the new Document's contents.
    `aclType` - the type of ACL to apply to this new directory. It would be applied to all the files and sub directories also.
  Throws:
    `IfsException` - if an error occurs while creating the folders for `ifsRootDir` if they do not already exist.
    `DirectoryItemHandlerException` - if an error occurs while copying the tree into iFS.

### copyDir

    public void copyDir(java.lang.String rootDir,
                        java.lang.String ifsRootDir)
                 throws IfsException,
                        DirectoryItemHandlerException

  Description copied from class: `CopyToIfs`
  Copies a directory tree from the local filesystem into iFS. Each file in the directory tree is inserted into iFS as a new Document whose contents are indexed using the default language. Note: `ifsRootDir` must be a path following iFS path conventions (i.e. m_session.getFolderPathDelimiter is the file separator). Also note that if `ifsRootDir` does not exist in iFS, this method will create the necessary folders.

  Parameters:
    `rootDir` - the directory on the local filesystem to copy into iFS. This is used as the "root directory" for `DirectoryTree.traverse`.
    `ifsRootDir` - the directory in which to place the copied tree within iFS.
  Throws:
    `IfsException` - if an error occurs while creating the folders for `ifsRootDir` if they do not already exist.
    `DirectoryItemHandlerException` - if an error occurs while copying the tree into iFS.

### copyDir

    public void copyDir(java.lang.String rootDir,
                        java.lang.String ifsRootDir,
                        java.lang.String aclType)
                 throws IfsException,
                        DirectoryItemHandlerException

  Description copied from class: `CopyToIfs`
  Copies a directory tree from the local filesystem into iFS. Each file in the directory tree is inserted into iFS as a new Document whose contents are indexed using the default language. Note: `ifsRootDir` must be a path following iFS path conventions (i.e. m_session.getFolderPathDelimiter is the file separator). Also note that if `ifsRootDir` does not exist in iFS, this method will create the necessary folders.

  Parameters:
    `rootDir` - the directory on the local filesystem to copy into iFS. This is used as the "root directory" for `DirectoryTree.traverse`.
    `ifsRootDir` - the directory in which to place the copied tree within iFS.
    `aclType` - the type of ACL to apply to this new directory. It would be applied to all the files and sub directories also.
  Throws:
    `IfsException` - if an error occurs while creating the folders for `ifsRootDir` if they do not already exist.
    `DirectoryItemHandlerException` - if an error occurs while copying the tree into iFS.

### createFolderHierarchy

    public void createFolderHierarchy(java.lang.String dir)
                               throws IfsException

  Description copied from class: `CopyToIfs`
  Recursively creates a folder hierarchy starting at the root of iFS (/) and ending at `dir`. Only creates the folders necessary; hence, this method does nothing if `dir` already exists in iFS. Note: `dir` must follow iFS filename conventions (i.e., m_session.getFolderPathDelimiter is the path-separator).

  Parameters:
    `dir` - the directory path to create in iFS
  Throws:
    `IfsException` - if an error occurs while creating Folders in iFS.

### createFolderHierarchy

    public void createFolderHierarchy(java.lang.String dir,
                                      java.lang.String aclType)
                               throws IfsException

  Description copied from class: `CopyToIfs`
  Recursively creates a folder hierarchy starting at the root of iFS (/) and ending at `dir`. Only creates the folders necessary; hence, this method does nothing if `dir` already exists in iFS. Note: `dir` must follow iFS filename conventions (i.e., m_session.getFolderPathDelimiter is the path-separator).

  Parameters:
    `dir` - the directory path to create in iFS
    `aclType` - the type of ACL to apply to this new directory hierarchy. It would be applied to all the directories.
  Throws:
    `IfsException` - if an error occurs while creating Folders in iFS.

### createFolder

    public void createFolder(java.lang.String name,
                             java.lang.String parent)
                      throws IfsException

  Description copied from class: `CopyToIfs`
  Creates a new Folder in iFS.
  Note: this method does nothing if the Folder already exists in iFS.

  Parameters:
    `name` - the name of the Folder to create.
    `parent` - the path of the Folder in iFS in which to create the new Folder.
  Throws:
    `IfsException` - if an error occurs while creating the Folder.

### createFolder

    public void createFolder(java.lang.String name,
                             java.lang.String parent,
                             java.lang.String aclType)
                      throws IfsException

  Description copied from class: `CopyToIfs`
  Creates a new Folder in iFS.
  Note: this method does nothing if the Folder already exists in iFS.

  Parameters:
    `name` - the name of the Folder to create.
    `parent` - the path of the Folder in iFS in which to create the new Folder.
    `aclType` - the type of ACL to apply to this new folder. Possible values are "Private", "Public", "Published" etc.
  Throws:
    `IfsException` - if an error occurs while creating the Folder.

### createDocument

    public void createDocument(java.lang.String name,
                               java.lang.String parent,
                               java.io.FileInputStream content,
                               java.lang.String language,
                               java.lang.String charset)
                        throws IfsException,
                               java.io.IOException

  Description copied from class: `CopyToIfs`
  Creates a new Document in iFS, given a FileInputStream which points to an existing file in the local filesystem. Uses the given language to index the new Document's contents.

  Note: this method will overwrite existing documents.

  Parameters:
    `name` - the name of the Document to create.
    `parent` - the path of the Folder in iFS for the new Document.
    `content` - the local file's data.
    `language` - the Oracle language name to use when indexing the new Document's contents.
    `charset` - the characterset to use when indexing the new Document's contents.
  Throws:
    `IfsException` - if an error occurs while creating the Document.
    `java.io.IOException`

### createDocument

    public void createDocument(java.lang.String name,
                               java.lang.String parent,
                               java.io.FileInputStream content,
                               java.lang.String language,
                               java.lang.String charset,
                               java.lang.String aclType)
                        throws IfsException,
                               java.io.IOException

  Description copied from class: `CopyToIfs`
  Creates a new Document in iFS, given a FileInputStream which points to an existing file in the local filesystem. Uses the given language to index the new Document's contents.

  Note: this method will overwrite existing documents.

  Parameters:
    `name` - the name of the Document to create.
    `parent` - the path of the Folder in iFS for the new Document.
    `content` - the local file's data.
    `language` - the Oracle language name to use when indexing the new Document's contents.
    `charset` - the characterset to use when indexing the new Document's contents.
    `aclType` - the type of ACL to apply to this new document. Possible values are "Private", "Public", "Published" etc.
  Throws:
    `IfsException` - if an error occurs while creating the Document.
    `java.io.IOException`

### createDocument

    public void createDocument(java.lang.String name,
                               java.lang.String parent,
                               java.io.FileInputStream content)
                        throws IfsException,
                               java.io.IOException

  Description copied from class: `CopyToIfs`
  Creates a new Document in iFS, given a FileInputStream which points to an existing file in the local filesystem. Uses the default language to index the new Document's contents.

  Note: this method will overwrite existing documents.

  Parameters:
    `name` - the name of the Document to create.
    `parent` - the path of the Folder in iFS into which to put the new Document.
    `content` - the local file's data.
  Throws:
    `IfsException` - if an error occurs while creating the Document.
    `java.io.IOException`

### createDocument

    public void createDocument(java.lang.String name,
                               java.lang.String parent,
                               java.io.FileInputStream content,
                               java.lang.String aclType)
                        throws IfsException,
                               java.io.IOException

  Description copied from class: `CopyToIfs`
  Creates a new Document in iFS, given a FileInputStream which points to an existing file in the local filesystem. Uses the default language to index the new Document's contents.

  Note: this method will overwrite existing documents.

  Parameters:
    `name` - the name of the Document to create.
    `parent` - the path of the Folder in iFS into which to put the new Document.
    `content` - the local file's data.
    `aclType` - the type of ACL to apply to this new document. Possible values are "Private", "Public", "Published" etc.
  Throws:
    `IfsException` - if an error occurs while creating the Document.
    `java.io.IOException`

### run

    public void run()

  Description copied from class: `CopyToIfs`
  Empty implementation; required by subclasses of BaseApp

### getACLFor

    protected AccessControlList getACLFor(java.lang.String aclType)
                                   throws IfsException

  Throws:
    `IfsException`

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