| Oracle Repository API and Model Reference Guide |
java.lang.Object | +--oracle.repos.services.file.FileService
| Field Summary | |
static int |
FS_ADD_NEW_FILES |
static int |
FS_NO_RTN_INFO |
static int |
FS_NO_TXT_FORMAT |
static int |
FS_OS_LOCK |
static int |
FS_OS_MKDIRS |
static int |
FS_OVERWRITE |
static int |
FS_RECURSE |
static int |
FS_SYNC_DEL_OS |
static int |
FS_SYNC_DL_ON_ERR |
static int |
FS_SYNC_FOR_CI |
static int |
FS_SYNC_FOR_CO |
static int |
FS_SYNC_FOR_UNDOCO |
static int |
FS_SYNC_IVID |
static int |
FS_SYNC_NO_DL |
static int |
FS_SYNC_NO_UL |
static int |
FS_SYNC_SKIP_UNMAP |
static int |
FS_SYNC_UL_ON_ERR |
static int |
FS_SYNC_VER_FOR_UL |
static int |
FS_UNX_TXT_FORMAT |
static int |
FS_UPDATE |
static int |
FS_VERSION_PARENT |
static int |
FS_WIN_TXT_FORMAT |
| Constructor Summary |
FileService(RepositoryConnection conn)
Constructor for entry point to repository file services. |
FileService(RepositoryConnection conn,
java.io.PrintWriter out) Constructor for entry point to repository file services. |
| Method Summary | |
(package private)
static void |
|
void |
close() Closes the the FileService object and releases any open resources (such as database cursors). |
Vector |
downloadByName(String strOSPath,
String strNameFilter, String strReposPath, String strNameTarget, oracle.repos.services.RID ctxtFolderID,
boolean bRecurse, boolean bOverwrite) Deprecated. |
Vector |
downloadByName(String strOSPath,
String strNameFilter, String strReposPath, String strNameTarget, oracle.repos.services.RID ctxtFolderID, int flags)
Copies named files from the given repos path to the named os path. |
void |
downloadFromRID(String strOSFile,
oracle.repos.services.RID rid, boolean bLock,
boolean bOverwrite) Deprecated. |
boolean |
downloadFromRID(String strOSFile,
oracle.repos.services.RID rid, int flags)
Download a repos file to the specified OS file. |
int |
getCommitFreq() Method which fetches the current commit frequency for this FileService object |
Vector |
getCORefreshList(String strOSPath,
String strNameFilter, String strReposPath, oracle.repos.services.RID ctxtFolderID,
boolean bRecurse) |
oracle.repos.services.file.ReposFileInputStream |
getDownloadStream(oracle.repos.services.RID rid) Returns a ReposFileInputStream that can be used to read the contents of a repository file. |
long |
getFileCRC(java.io.File osFile)
Method that gets a repository compatible CRC for the specified os file. |
static int |
getMaxChunkSize() Calculates and returns the maximum chunk of data which can be read/written by the FileService. |
static int |
getStoredCommitFreq() Native method which fetches the persistently stored commit frequency |
oracle.repos.services.GID |
getSyncDetails(String strReposPath,
String strRootFolder, oracle.repos.services.file.FileServiceNfo ctxtFolder)
|
static String |
GetTempDir() Gets the name of the temporary directory. |
static boolean |
IsSymbolicLink(Object obRef,
String strOSPath) Tests to see if the specified file is a symbolic link. |
static int |
IsSymbolicLnk(String strOSPath)
|
static long |
javaTimeToRepos(long javaTimestamp)
Converts a java time to repos time. |
static void |
OSFileClose(Object obRef,
int hFile) |
static String |
OSFileError() |
static int |
OSFileOpen(Object obRef,
String strFileName) |
static int |
OSFileWrite(Object obRef,
int hFile, byte[] b, int offset, int len, int txtFmt,
int nLastChar) |
static long |
ReposCRC(long crc,
byte[] b, int len) |
static long |
reposTimeToJava(long reposTimestamp)
Converts a repos time to java time. |
void |
setCommitFreq(int nCommitFreq)
Method which sets the commit frequency used by the FileService, for the lifetime of this FileService object (unless changed by this method) If this function is not called, the FileService uses the stored commit frequency. |
static boolean |
setReadOnly(String fileName)
Native method which sets an os file read-write permissions to read-only. |
static boolean |
setReadWrite(String fileName)
Native method which sets an os file read-write permissions to read-write. |
static boolean |
setStoredCommitFreq(int nCommitFreq)
Native method which persistently stores the commit frequency The commit frequency specifies how often the fileservice opens and closes repos activities. |
static void |
setTimestamp(String fileName,
long timeStamp) Native method which sets an os file timestamp. |
Vector |
synchronize(String strUUID,
oracle.repos.services.GID gidWorkareaID,
java.util.Enumeration enumFileIDs, int flags) Synchronizes repository files given a vector of ID values. |
Vector |
synchronize(String strUUID,
oracle.repos.services.GID gidWorkareaID, oracle.repos.services.GID gidFileID, int flags)
Synchronizes repository file given an ID value. |
Vector |
synchronize(String strUUID,
oracle.repos.services.GID gidWorkareaID,
String strReposPath, String strNameFilter, boolean bRecurse,
boolean bVersionParentFol, boolean bAddNewFiles) Deprecated. |
Vector |
synchronize(String strUUID,
oracle.repos.services.GID gidWorkareaID,
String strReposPath, String strNameFilter, int flags) Synchronizes repository workarea / folders / files. |
Vector |
synchronize(String strOSPath,
String strReposPath, String strNameFilter, boolean bRecurse,
boolean bVersionParentFol, boolean bAddNewFiles) Deprecated. |
Vector |
synchronize(String strOSPath,
String strReposPath, String strNameFilter, int flags) Synchronizes repository workarea / folders / files. |
Vector |
uploadByName(String strOSPath,
String strNameFilter, String strReposPath, String strNameTarget, oracle.repos.services.RID ctxtFolderID,
boolean bRecurse, boolean bVersionParentFol, boolean bOverwrite) Deprecated. |
Vector |
uploadByName(String strOSPath,
String strNameFilter, String strReposPath, String strNameTarget, oracle.repos.services.RID ctxtFolderID, int flags)
Copies named files from the given os path to the named repository path. |
void |
uploadToRID(java.io.InputStream uploadStream,
oracle.repos.services.RID rid, long osTimestamp)
Upload an InputStream to the specified repository file. |
void |
uploadToRID(java.io.InputStream uploadStream,
oracle.repos.services.RID rid,
java.sql.Timestamp osTimestamp) |
void |
uploadToRID(String strOSPath,
oracle.repos.services.RID rid,
java.sql.Timestamp osTimestamp) Upload an OS file to the specified repository file. |
| Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait,
wait, wait |
| Field Detail |
public static final int FS_RECURSE
public static final int FS_VERSION_PARENT
public static final int FS_ADD_NEW_FILES
public static final int FS_OVERWRITE
public static final int FS_WIN_TXT_FORMAT
public static final int FS_UNX_TXT_FORMAT
public static final int FS_SYNC_DEL_OS
public static final int FS_OS_LOCK
public static final int FS_OS_MKDIRS
public static final int FS_NO_TXT_FORMAT
public static final int FS_SYNC_NO_UL
public static final int FS_SYNC_NO_DL
public static final int FS_SYNC_FOR_CI
public static final int FS_SYNC_FOR_CO
public static final int FS_SYNC_UL_ON_ERR
public static final int FS_SYNC_DL_ON_ERR
public static final int FS_SYNC_VER_FOR_UL
public static final int FS_SYNC_FOR_UNDOCO
public static final int FS_NO_RTN_INFO
public static final int FS_UPDATE
public static final int FS_SYNC_IVID
public static final int FS_SYNC_SKIP_UNMAP
| Constructor Detail |
public FileService(RepositoryConnection conn)
throws FileServiceException
conn - RepositoryConnection to repository. Workarea is assumed to be
correctly set (if required)
public FileService(RepositoryConnection conn,
java.io.PrintWriter out)
throws FileServiceException
conn - RepositoryConnection to repository. Workarea is assumed to be
correctly set (if required)out - Pass in a PrintWriter to direct output stream.| Method Detail |
static void()
public static void setTimestamp(String fileName,
long timeStamp)
fileName - The full os file nametimeStamp - The timestamp value in the format provided by
java.sql.Timestamp.toString()public static boolean setReadOnly(String fileName)
fileName - The full os file namepublic static boolean setReadWrite(String fileName)
fileName - The full os file namepublic static boolean setStoredCommitFreq(int nCommitFreq)
nCommitFreq - Value of commit frequencypublic static int getStoredCommitFreq()
public void setCommitFreq(int nCommitFreq)
nCommitFreq - Value of commit frequencypublic int getCommitFreq()
public void close()
throws FileServiceException
public Vector synchronize(String strOSPath,
String strReposPath,
String strNameFilter,
boolean bRecurse,
boolean bVersionParentFol,
boolean bAddNewFiles)
throws FileServiceException
strOSPath - The OSPath to syncstrReposPath - The repository path which contains files / folders to be
syncrhonized (e.g. "fol1\fol2")strNameFilter - A filter pattern specifying one or more files (e.g.
"file*.txt")bRecurse - Recurse into sub-folders in both filesystem and repositorybVersionParentFol - Version checked-in folders if necessary, to add new
file/folder elements. Checked-out folders, or folders that do not have new elements added
are unversioned.bAddNewFiles - Add new files to the repository.
public Vector synchronize(String strOSPath,
String strReposPath,
String strNameFilter,
int flags)
throws FileServiceException
strOSPath - The OSPath to syncstrReposPath - The repository path which contains files / folders to be
syncrhonized (e.g. "fol1\fol2")strNameFilter - A filter pattern specifying one or more files (e.g.
"file*.txt")flags - Flags that specify additional options (see below). Valid flags:
FS_RECURSE Recurse into sub-folders in both filesystem and repository FS_VERSION_PARENT
Version checked-in folders if necessary, to add new file/folder elements. Checked-out
folders, or folders that do not have new elements added are unversioned. FS_ADD_NEW_FILES
Add new files to the repository. FS_SYNC_NO_DL Do not download files on sync (files that
should be downloaded are ignored) FS_SYNC_NO_UL Do not upload files on sync (files that
should be uploaded are ignored). FS_WIN_TXT_FORMAT Specifies that the file should be
downloaded with all single line-feed (LF) characters converted to carriage-return (CR) /
line-feed (CR-LF) pairs, producing MSDOS end-of-line (EOL) characters (i.e. UNIX EOL
--> MSDOS EOL) FS_UNX_TXT_FORMAT Specifies that the file should be downloaded with all
CR-LF pairs converted to single LF characters, producing UNIX EOL characters (i.e. MSDOS
EOL --> UNIX EOL) NOTE: --Both text conversion options are only applied to text files
(i.e. files with kind = C or kind = X. --The conversion is written to os disk only, no
conversion is made to the repository files --By default
(FS_WIN_TXT_FORMAT/FS_UNX_TXT_FORMAT not specified) no EOL character conversion occurs
(FS_NO_TXT_FORMAT). All other flags are ignored.
public Vector synchronize(String strUUID,
oracle.repos.services.GID gidWorkareaID,
String strReposPath,
String strNameFilter,
boolean bRecurse,
boolean bVersionParentFol,
boolean bAddNewFiles)
throws FileServiceException
strUUID - The repository UUIDgidWorkareaID - The repository workarea IDstrReposPath - The repository path which contains files / folders to be
syncrhonized (e.g. "fol1\fol2")strNameFilter - A filter pattern specifying one or more files (e.g.
"file*.txt")bRecurse - Recurse into sub-folders in both filesystem and repositorybVersionParentFol - Version checked-in folders if necessary, to add new
file/folder elements. Checked-out folders, or folders that do not have new elements added
are unversioned.bAddNewFiles - Add new files to the repository.
public Vector synchronize(String strUUID,
oracle.repos.services.GID gidWorkareaID,
String strReposPath,
String strNameFilter,
int flags)
throws FileServiceException
strUUID - The repository UUIDgidWorkareaID - The repository workarea IDstrReposPath - The repository path which contains files / folders to be
syncrhonized (e.g. "fol1\fol2")strNameFilter - A filter pattern specifying one or more files (e.g.
"file*.txt")flags - Flags that specify additional options Valid flags are: FS_RECURSE
Recurse into sub-folders in both filesystem and repository FS_VERSION_PARENT Version
checked-in folders if necessary, to add new file/folder elements. Checked-out folders, or
folders that do not have new elements added are unversioned. FS_ADD_NEW_FILES Add new
files to the repository. FS_WIN_TXT_FORMAT Specifies that the file should be downloaded
with all single line-feed (LF) characters converted to carriage-return (CR) / line-feed
(CR-LF) pairs, producing MSDOS end-of-line (EOL) characters (i.e. UNIX EOL --> MSDOS
EOL) FS_UNX_TXT_FORMAT Specifies that the file should be downloaded with all CR-LF pairs
converted to single LF characters, producing UNIX EOL characters (i.e. MSDOS EOL -->
UNIX EOL) FS_NO_TXT_FORMAT Force text conversion *not* to happen (if the mapping specifies
that it should. NOTE: --Both text conversion options are only applied to text files (i.e.
files with kind = C or kind = X. --The conversion is written to os disk only, no
conversion is made to the repository files --IMPORTANT: Text conversion can be
automatically set via the folder mapping. By default, the mapping text conversion is
applied. To override this default, you must specify FS_WIN_TXT_FORMAT/FS_UNX_TXT_FORMAT or
FS_NO_TXT_FORMAT. All other flags are ignored.
public Vector synchronize(String strUUID,
oracle.repos.services.GID gidWorkareaID,
java.util.Enumeration enumFileIDs,
int flags)
throws FileServiceException
strUUID - The repository UUIDgidWorkareaID - The repository workarea IDenumFileIDs - An enumeration containing one or more repository IDsflags - Flags that specify additional options Valid flags are: FS_SYNC_IVID
As stated above, by default the vector of IDs are assumed to be IRID values. Use this flag
if they are IVIDs. FS_SYNC_SKIP)UNMAP Skip files that are not mapped (rather than throwing
an exception).
public Vector synchronize(String strUUID,
oracle.repos.services.GID gidWorkareaID,
oracle.repos.services.GID gidFileID,
int flags)
throws FileServiceException
strUUID - The repository UUIDgidWorkareaID - The repository workarea IDgidFileID - A respoitory ID valueflags - Flags that specify additional options Valid flags are: FS_SYNC_IVID
As stated above, by default the vector of IDs are assumed to be IRID values. Use this flag
if they are IVIDs.
public Vector uploadByName(String strOSPath,
String strNameFilter,
String strReposPath,
String strNameTarget,
oracle.repos.services.RID ctxtFolderID,
boolean bRecurse,
boolean bVersionParentFol,
boolean bOverwrite)
throws FileServiceException
strOSPath - The os folder path.strNameFilter - The name filter pattern.strReposPath - The target repos path.strNameTarget - The target repos file name (for individual os files only).
Set parameter to null if not being used.ctxtFolderID - The repos context folder id (optional - set to null if not
being specified).bRecurse - Flag to indicate if sub-folders should be recursively visited as
well.bVersionParentFol - Flag to indicate if folders should be versioned
whenever new elements are added.bOverwrite - Flag to indicate whether existing files should be overwritten
or not. Returns a vector of FileServiceNfo.java objects which contain information about
any files/folders that have been copied.
public Vector uploadByName(String strOSPath,
String strNameFilter,
String strReposPath,
String strNameTarget,
oracle.repos.services.RID ctxtFolderID,
int flags)
throws FileServiceException
This is a powerful function that does not perform data integrity checks before copying. With the exception of checked in files (which can never be overwriten), the repository file content is replaced by the os file content. If the repository file does not exist, it is created.
The repository context folder ID is an optional input parameter (set to null if not being passed in) and specifies the repos ID of the target folder (the last folder in the repos folder path).
If bRecurse is true, files in any os sub-folders are recursed into and the copy operation repeated.
If bVersionParentFol is true, if new elements are added to a folder, the folder is versioned. I.e. if the folder is checked in, it is checked out the elements added, then the folder checked in again. If the folder is already checked out, then no versioning occurs.
strOSPath - The os folder path.strNameFilter - The name filter pattern.strReposPath - The target repos path.strNameTarget - The target repos file name (not currently used, set to
null)ctxtFolderID - The repos context folder id (optional - set to null if not
being specified).flags - Flags that specify additional options Valid flags: FS_RECURSE Flag
to indicate if sub-folders should be recursively visited as well (operating system folders
only) FS_VERSION_PARENT Flag to indicate if folders should be versioned whenever new
elements are added. FS_OVERWRITE Flag to indicate whether existing (repos) files should be
overwritten or not. Returns a vector of FileServiceNfo.java objects which contain
information about any files/folders that have been copied.
public Vector downloadByName(String strOSPath,
String strNameFilter,
String strReposPath,
String strNameTarget,
oracle.repos.services.RID ctxtFolderID,
boolean bRecurse,
boolean bOverwrite)
throws FileServiceException
strOSPath - The os folder path.strNameFilter - The name filter pattern.strReposPath - The target repos path.strNameTarget - The target repos file name (for individual os files only).
Set parameter to null if not being used.ctxtFolderID - The repos context folder id (optional - set to null if not
being specified).bRecurse - Flag to indicate if sub-folders should be recursively visited as
well. Returns a vector of FileServiceNfo.java objects which contain information about any files/folders that have been copied.
public Vector downloadByName(String strOSPath,
String strNameFilter,
String strReposPath,
String strNameTarget,
oracle.repos.services.RID ctxtFolderID,
int flags)
throws FileServiceException
This is a powerful function that does not perform data integrity checks before copying, the os file content is simply replaced by the repos file content. If the os file does not exist it is created.
The repository context folder ID is an optional input parameter (set to null if not being passed in) and specifies the repos ID of the target folder (the last folder in the repos folder path).
If bRecurse is true, files in any repos sub-folders are recursed into and the copy operation repeated.
strOSPath - The os folder path.strNameFilter - The name filter pattern.strReposPath - The target repos path.strNameTarget - The target repos file name (for individual os files only).
Set parameter to null if not being used.ctxtFolderID - The repos context folder id (optional - set to null if not
being specified).flags - Flags to specify additional options Valid flags: FS_RECURSE Flag to
indicate if (repository) sub-folders should be recursively visited as well. FS_OVERWRITE
Flag to indicate whether existing (os) files should be overwritten or not.
FS_WIN_TXT_FORMAT Specifies that the file should be downloaded with all single line-feed
(LF) characters converted to carriage-return (CR) / line-feed (CR-LF) pairs, producing
MSDOS end-of-line (EOL) characters (i.e. UNIX EOL --> MSDOS EOL) FS_UNX_TXT_FORMAT
Specifies that the file should be downloaded with all CR-LF pairs converted to single LF
characters, producing UNIX EOL characters (i.e. MSDOS EOL --> UNIX EOL) NOTE: --Both
text conversion options are only applied to text files (i.e. files with kind = C or kind =
X. --The conversion is written to os disk only, no conversion is made to the repository
files --By default (FS_WIN_TXT_FORMAT/FS_UNX_TXT_FORMAT not specified) no EOL character
conversion occurs (FS_NO_TXT_FORMAT). Returns a vector of FileServiceNfo.java objects which contain information about any files/folders that have been copied.
public void uploadToRID(java.io.InputStream uploadStream,
oracle.repos.services.RID rid,
long osTimestamp)
throws FileServiceException
Throws SQLException or IOException on error
uploadStream - The java.io.InputStream which will provide the upload data.rid - The repository file ID to upload to.osTimestamp - Optional client specified timestamp. The timestamp is
expected to be in standard java format - the number of milliseconds since Midnight, Jan
1st 1970 (i.e. UTC milliseconds) - i.e. a valid value can be obtained from
java.io.File.lastModified(); NOTE: The repository stores timestamps as UTC *seconds*, not
milliseconds. However, clients should not alter the timestamp to account for this as the
upload method performs the conversion automatically. Similarly, download methods
re-convert repos stored timestamps to java format. If the client does not provide a
timestamp (osTimestamp = 0), then the system time (System.currentTimeMillis()) is used to
provide the timestamp.
public void uploadToRID(java.io.InputStream uploadStream,
oracle.repos.services.RID rid,
java.sql.Timestamp osTimestamp)
throws FileServiceException
public void uploadToRID(String strOSPath,
oracle.repos.services.RID rid,
java.sql.Timestamp osTimestamp)
throws FileServiceException
Throws SQLException or IOException on error
strOSPath - The full OS path, including file name (e.g.
"C:\fol1\file.txt")rid - The repository file ID to upload to.osTimestamp -
public void downloadFromRID(String strOSFile,
oracle.repos.services.RID rid,
boolean bLock,
boolean bOverwrite)
throws FileServiceException
strOSPath - The full OS path, including file name (e.g.
"C:\fol1\file.txt")rid - The repository file ID to download from.bLock - Specifies whether the OS file is locked (file permissions set to
read-only) after download. If bLock is FALSE, the file is set to read-write, if true, the
file is read-only.bOverwrite - Specifies whether the data integrity checks should be made.
public boolean downloadFromRID(String strOSFile,
oracle.repos.services.RID rid,
int flags)
throws FileServiceException
Throws FileServiceException on error
strOSPath - The full OS path, including file name (e.g.
"C:\fol1\file.txt")rid - The repository file ID to download from.flags - Flags to specify additional options Valid flags: FS_OS_LOCK
Specifies whether the OS file is locked (file permissions set to read-only) after
download. Otherwise the file is r/w FS_OVERWRITE Specifies whether the os file should be
overwritten if it already exists. FS_OS_MKDIRS Specifies whether the function should
attempt to create the os path if it does not exist (note: this does not apply to the file,
which is created automatically if it does not exist) FS_WIN_TXT_FORMAT Specifies that the
file should be downloaded with all single line-feed (LF) characters converted to
carriage-return (CR) / line-feed (CR-LF) pairs, producing MSDOS end-of-line (EOL)
characters (i.e. UNIX EOL --> MSDOS EOL) FS_UNX_TXT_FORMAT Specifies that the file
should be downloaded with all CR-LF pairs converted to single LF characters, producing
UNIX EOL characters (i.e. MSDOS EOL --> UNIX EOL) NOTE: --Both text conversion options
are not recommended for use with binary files. --The conversion is written to os disk
only, no conversion is made to the repository files --By default
(FS_WIN_TXT_FORMAT/FS_UNX_TXT_FORMAT not specified) no EOL character conversion occurs.
public ReposFileInputStream getDownloadStream(oracle.repos.services.RID rid)
throws FileServiceException
Throws throws FileServiceException on error
rid - The repository file ID which is to be downloaded by the stream.public static int getMaxChunkSize()
public static long javaTimeToRepos(long javaTimestamp)
javaTimestamp - The java timestamp in UTC milliseconds to be converted a
repos timestamp (UTC seconds).public static long reposTimeToJava(long reposTimestamp)
reposTimestamp - The repos timestamp in UTC seconds to be converted a java
timestamp (UTC milliseconds).
public long getFileCRC(java.io.File osFile)
throws FileServiceException
osFile - The OS file to calculate the CRC from (must be readable)
public Vector getCORefreshList(String strOSPath,
String strNameFilter,
String strReposPath,
oracle.repos.services.RID ctxtFolderID,
boolean bRecurse)
throws FileServiceException
public oracle.repos.services.GID getSyncDetails(String strReposPath,
String strRootFolder,
oracle.repos.services.file.FileServiceNfo ctxtFolder)
throws java.sql.SQLException
public static long ReposCRC(long crc,
byte[] b,
int len)
public static int OSFileOpen(Object obRef,
String strFileName)
throws FileServiceException
public static void OSFileClose(Object obRef,
int hFile)
throws FileServiceException
public static int OSFileWrite(Object obRef,
int hFile,
byte[] b,
int offset,
int len,
int txtFmt,
int nLastChar)
throws FileServiceException
public static String OSFileError()
public static String GetTempDir()
public static boolean IsSymbolicLink(Object obRef,
String strOSPath)
throws FileServiceException
public static int IsSymbolicLnk(String strOSPath)
| BM0463 - JR0670 - JDev446 | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |