public class CopyToIfs extends BaseApp
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 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.
m_currentuser
m_defaultWriter, m_logWriter, m_parametertable, m_timervalue
Constructor and Description |
---|
CopyToIfs()
Creates a new CopyToIfs.
|
CopyToIfs(LibrarySession sess)
Creates a new CopyToIfs given a LibrarySession.
|
CopyToIfs(String[] args)
Creates a new CopyToIfs given command-line arguments
used to determine what to copy to iFS.
|
CopyToIfs(String[] args,
LibrarySession sess)
Creates a new CopyToIfs given command-line arguments
used to determine what to copy to iFS.
|
Modifier and Type | Method and Description |
---|---|
LibrarySession |
connect(String username,
String password,
String server,
String serverPassword)
Create a LibrarySession.
|
void |
copyDir(String rootDir,
String ifsRootDir)
Copies a directory tree from the local filesystem into iFS.
|
void |
copyDir(String rootDir,
String ifsRootDir,
String aclType)
Copies a directory tree from the local filesystem into iFS.
|
void |
copyDir(String rootDir,
String ifsRootDir,
String language,
String charset)
Copies a directory tree from the local filesystem into iFS.
|
void |
copyDir(String rootDir,
String ifsRootDir,
String language,
String charset,
String aclType)
Copies a directory tree from the local filesystem into iFS.
|
void |
createDocument(String name,
String parent,
FileInputStream content)
Creates a new Document in iFS, given a FileInputStream which points
to an existing file in the local filesystem.
|
void |
createDocument(String name,
String parent,
FileInputStream content,
String aclType)
Creates a new Document in iFS, given a FileInputStream which points
to an existing file in the local filesystem.
|
void |
createDocument(String name,
String parent,
FileInputStream content,
String language,
String charset)
Creates a new Document in iFS, given a FileInputStream which points
to an existing file in the local filesystem.
|
void |
createDocument(String name,
String parent,
FileInputStream content,
String language,
String charset,
String aclType)
Creates a new Document in iFS, given a FileInputStream which points
to an existing file in the local filesystem.
|
void |
createFolder(String name,
String parent)
Creates a new Folder in iFS.
|
void |
createFolder(String name,
String parent,
String aclType)
Creates a new Folder in iFS.
|
void |
createFolderHierarchy(String dir)
Recursively creates a folder hierarchy starting at the root of iFS (/)
and ending at
dir . |
void |
createFolderHierarchy(String dir,
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(String aclType) |
static void |
main(String[] args)
Runs CopyToIfs from the command-line given parameters:
|
void |
run()
Empty implementation; required by subclasses of BaseApp
|
connect, Connect, connect, Connect, Connect, Connect, connect, Connect, Connect, Disconnect, getCachePerformanceString, getCleartextCredential, getCleartextCredential, getConnectionPoolPerformanceString, getConnectOptions, getConnectOptions, getConnectOptions, getLocale, showCachePerformance, showConnectionPoolPerformance
getElapsedTime, getParameterTable, initTrace, log, log, logCurrentTimestamp, printStackTrace, setTimer, showElapsedTime
public CopyToIfs()
public CopyToIfs(LibrarySession sess)
public CopyToIfs(String[] args)
public CopyToIfs(String[] args, LibrarySession sess)
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.public static void main(String[] args)
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]
args
- command-line arguments in standard BaseApp
format (name=value).public LibrarySession connect(String username, String password, String server, String serverPassword) throws IfsException
BaseApp
connect
in class BaseApp
IfsException
- if operation fails.public void disconnect() throws IfsException
IfsException
- if an error occurs while disconnecting.public void copyDir(String rootDir, String ifsRootDir, String language, String charset) throws IfsException, DirectoryItemHandlerException
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.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.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.public void copyDir(String rootDir, String ifsRootDir, String language, String charset, String aclType) throws IfsException, DirectoryItemHandlerException
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.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.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.public void copyDir(String rootDir, String ifsRootDir) throws IfsException, DirectoryItemHandlerException
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.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.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.public void copyDir(String rootDir, String ifsRootDir, String aclType) throws IfsException, DirectoryItemHandlerException
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.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.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.public void createFolderHierarchy(String dir) throws IfsException
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).dir
- the directory path to create in iFSIfsException
- if an error occurs while creating Folders in iFS.public void createFolderHierarchy(String dir, String aclType) throws IfsException
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).dir
- the directory path to create in iFSaclType
- the type of ACL to apply to this new directory hierarchy.
It would be applied to all the directories.IfsException
- if an error occurs while creating Folders in iFS.public void createFolder(String name, String parent) throws IfsException
name
- the name of the Folder to create.parent
- the path of the Folder in iFS in which to create the new Folder.IfsException
- if an error occurs while creating the Folder.public void createFolder(String name, String parent, String aclType) throws IfsException
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.IfsException
- if an error occurs while creating the Folder.public void createDocument(String name, String parent, FileInputStream content, String language, String charset) throws IfsException, IOException
Note: this method will overwrite existing documents.
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.IfsException
- if an error occurs while creating the Document.IOException
public void createDocument(String name, String parent, FileInputStream content, String language, String charset, String aclType) throws IfsException, IOException
Note: this method will overwrite existing documents.
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.IfsException
- if an error occurs while creating the Document.IOException
public void createDocument(String name, String parent, FileInputStream content) throws IfsException, IOException
Note: this method will overwrite existing documents.
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.IfsException
- if an error occurs while creating the Document.IOException
public void createDocument(String name, String parent, FileInputStream content, String aclType) throws IfsException, IOException
Note: this method will overwrite existing documents.
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.IfsException
- if an error occurs while creating the Document.IOException
public void run()
protected AccessControlList getACLFor(String aclType) throws IfsException
IfsException
Copyright © 2023. All rights reserved.