Oracle Repository API and Model Reference Guide


Contents


API Methods


Element Definitions


Index  


oracle.repos.services.file
Class FileService

java.lang.Object
  |
  +--oracle.repos.services.file.FileService

public class FileService
extends Object

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

FS_RECURSE

public static final int FS_RECURSE

FS_VERSION_PARENT

public static final int FS_VERSION_PARENT

FS_ADD_NEW_FILES

public static final int FS_ADD_NEW_FILES

FS_OVERWRITE

public static final int FS_OVERWRITE

FS_WIN_TXT_FORMAT

public static final int FS_WIN_TXT_FORMAT

FS_UNX_TXT_FORMAT

public static final int FS_UNX_TXT_FORMAT

FS_SYNC_DEL_OS

public static final int FS_SYNC_DEL_OS

FS_OS_LOCK

public static final int FS_OS_LOCK

FS_OS_MKDIRS

public static final int FS_OS_MKDIRS

FS_NO_TXT_FORMAT

public static final int FS_NO_TXT_FORMAT

FS_SYNC_NO_UL

public static final int FS_SYNC_NO_UL

FS_SYNC_NO_DL

public static final int FS_SYNC_NO_DL

FS_SYNC_FOR_CI

public static final int FS_SYNC_FOR_CI

FS_SYNC_FOR_CO

public static final int FS_SYNC_FOR_CO

FS_SYNC_UL_ON_ERR

public static final int FS_SYNC_UL_ON_ERR

FS_SYNC_DL_ON_ERR

public static final int FS_SYNC_DL_ON_ERR

FS_SYNC_VER_FOR_UL

public static final int FS_SYNC_VER_FOR_UL

FS_SYNC_FOR_UNDOCO

public static final int FS_SYNC_FOR_UNDOCO

FS_NO_RTN_INFO

public static final int FS_NO_RTN_INFO

FS_UPDATE

public static final int FS_UPDATE

FS_SYNC_IVID

public static final int FS_SYNC_IVID

FS_SYNC_SKIP_UNMAP

public static final int FS_SYNC_SKIP_UNMAP
Constructor Detail

FileService

public FileService(RepositoryConnection conn)
            throws FileServiceException
Constructor for entry point to repository file services. The FileService allows upload, download and synchronisation of repository and OS files.
Parameters:
conn - RepositoryConnection to repository. Workarea is assumed to be correctly set (if required)

FileService

public FileService(RepositoryConnection conn,
                   java.io.PrintWriter out)
            throws FileServiceException
Constructor for entry point to repository file services. The FileService allows upload, download and synchronisation of repository and OS files.
Parameters:
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 ()

setTimestamp

public static void setTimestamp(String fileName,
                                long timeStamp)
Native method which sets an os file timestamp. The timestamp must be in the form provided by java.sql.Timestamp.toString().
Parameters:
fileName - The full os file name
timeStamp - The timestamp value in the format provided by java.sql.Timestamp.toString()

setReadOnly

public static boolean setReadOnly(String fileName)
Native method which sets an os file read-write permissions to read-only.
Parameters:
fileName - The full os file name

setReadWrite

public static boolean setReadWrite(String fileName)
Native method which sets an os file read-write permissions to read-write.
Parameters:
fileName - The full os file name

setStoredCommitFreq

public 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. If the value is 0, then one activity is opened and closed (start and end of operation), otherwise the current activity is closed (and reopened) every files that are *uploaded*.
Parameters:
nCommitFreq - Value of commit frequency

getStoredCommitFreq

public static int getStoredCommitFreq()
Native method which fetches the persistently stored commit frequency

setCommitFreq

public 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. The commit frequency specifies how often the fileservice opens and closes repos activities. If the value is 0, then one activity is opened and closed (start and end of operation), otherwise the current activity is closed (and reopened) every files that are *uploaded*.
Parameters:
nCommitFreq - Value of commit frequency

getCommitFreq

public int getCommitFreq()
Method which fetches the current commit frequency for this FileService object

close

public void close()
           throws FileServiceException
Closes the the FileService object and releases any open resources (such as database cursors). The client *must* call close once the object is finished with.

synchronize

public Vector synchronize(String strOSPath,
                                    String strReposPath,
                                    String strNameFilter,
                                    boolean bRecurse,
                                    boolean bVersionParentFol,
                                    boolean bAddNewFiles)
                             throws FileServiceException
Deprecated.  
Synchronizes repository workarea / folders / files. This function is superceded by synchronize(string,string,string,int);
Parameters:
strOSPath - The OSPath to sync
strReposPath - 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 repository
bVersionParentFol - 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.

synchronize

public Vector synchronize(String strOSPath,
                                    String strReposPath,
                                    String strNameFilter,
                                    int flags)
                             throws FileServiceException
Synchronizes repository workarea / folders / files. This function synchrnoizes the specified repository path with the the specified os path. *No mapping* is required for this sync to be performed.
Parameters:
strOSPath - The OSPath to sync
strReposPath - 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.

synchronize

public Vector synchronize(String strUUID,
                          oracle.repos.services.GID gidWorkareaID,
                          String strReposPath,
                          String strNameFilter,
                          boolean bRecurse,
                          boolean bVersionParentFol,
                          boolean bAddNewFiles)
                   throws FileServiceException
Deprecated.  
Synchronizes repository workarea / folders / files, given a mapping This function has been superceded by synchronize(string,gid,string,string,int)
Parameters:
strUUID - The repository UUID
gidWorkareaID - The repository workarea ID
strReposPath - 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 repository
bVersionParentFol - 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.

synchronize

public Vector synchronize(String strUUID,
                          oracle.repos.services.GID gidWorkareaID,
                          String strReposPath,
                          String strNameFilter,
                          int flags)
                   throws FileServiceException
Synchronizes repository workarea / folders / files. The files / folders must be *mapped* (i.e. they must be in a repository folder hierarchy that has a mapping between a root folder and an operating system path. Caller must provide the repository UUID, a valid workarea ID and the name pattern for the files to be synchornized. If the caller provides a repos path, then it is this which is used for sync. Otherwise, the whole workarea is syncrhonized (all mapped folders and their sub-folders are syncd).
Parameters:
strUUID - The repository UUID
gidWorkareaID - The repository workarea ID
strReposPath - 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.

synchronize

public Vector synchronize(String strUUID,
                          oracle.repos.services.GID gidWorkareaID,
                          java.util.Enumeration enumFileIDs,
                          int flags)
                   throws FileServiceException
Synchronizes repository files given a vector of ID values. The IDs can be IRIDs or IVIDs, but should be consistent (all IRID or IVID, not a mixture). IMPORTANT NOTE: By default values are considered to be IRIDs. If the values are IVIDs you *must* pass in the FS_SYNC_IVID flag to indicate this. NOTE: this function will sync the real file (not a shared file) ALSO: As with all FileService functions you *must* be in the context of a workarea The files / folders must be *mapped* (i.e. they must be in a repository folder hierarchy that has a mapping between a root folder and an operating system path). If not, an exception will be thrown unless you specify the FS_SYNC_SKIP_UNMAP flag.
Parameters:
strUUID - The repository UUID
gidWorkareaID - The repository workarea ID
enumFileIDs - An enumeration containing one or more repository IDs
flags - 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). >

synchronize

public Vector synchronize(String strUUID,
                          oracle.repos.services.GID gidWorkareaID,
                          oracle.repos.services.GID gidFileID,
                          int flags)
                   throws FileServiceException
Synchronizes repository file given an ID value. The ID can be IRID or IVID. IMPORTANT NOTE: By default the value is considered to be an IRID. If the value is an IVID you *must* pass in the FS_SYNC_IVID flag to indicate this. NOTE: this function will sync the real file (not a shared file) ALSO: As with all FileService functions you *must* be in the context of a workarea The file be *mapped* (i.e. they must be in a repository folder hierarchy that has a mapping between a root folder and an operating system path). If not, an exception will be thrown.
Parameters:
strUUID - The repository UUID
gidWorkareaID - The repository workarea ID
gidFileID - A respoitory ID value
flags - 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. >

uploadByName

public Vector uploadByName(String strOSPath,
                           String strNameFilter,
                           String strReposPath,
                           String strNameTarget,
                           oracle.repos.services.RID ctxtFolderID,
                           boolean bRecurse,
                           boolean bVersionParentFol,
                           boolean bOverwrite)
                    throws FileServiceException
Deprecated.  
Copies named files from the given os path to the named repository path. This function is superceeded by uploadByName(string,string,string,string,rid,int)
Parameters:
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.

uploadByName

public Vector uploadByName(String strOSPath,
                           String strNameFilter,
                           String strReposPath,
                           String strNameTarget,
                           oracle.repos.services.RID ctxtFolderID,
                           int flags)
                    throws FileServiceException
Copies named files from the given os path to the named repository path. Names are specified by a filter pattern. Valid wild cards are "*" and "%" which match any string pattern and "?" which matches any single character. File names in the repository are the same as in the os, except if only one file has been specified (in the os) and the target name is not null.

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.

Parameters:
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.

downloadByName

public Vector downloadByName(String strOSPath,
                             String strNameFilter,
                             String strReposPath,
                             String strNameTarget,
                             oracle.repos.services.RID ctxtFolderID,
                             boolean bRecurse,
                             boolean bOverwrite)
                      throws FileServiceException
Deprecated.  
Copies named files from the given repos path to the named os path. This function is superceeded by downloadByName(string,string,string,string,RID,int)
Parameters:
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.


downloadByName

public Vector downloadByName(String strOSPath,
                             String strNameFilter,
                             String strReposPath,
                             String strNameTarget,
                             oracle.repos.services.RID ctxtFolderID,
                             int flags)
                      throws FileServiceException
Copies named files from the given repos path to the named os path. Names are specified by a filter pattern. Valid wild cards are "*" and "%" which match any string pattern and "?" which matches any single character. File names in the os are the same as in the repos, except if only one file has been specified (in the repos) and the target name is not null.

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.

Parameters:
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.


uploadToRID

public void uploadToRID(java.io.InputStream uploadStream,
                        oracle.repos.services.RID rid,
                        long osTimestamp)
                 throws FileServiceException
Upload an InputStream to the specified repository file. The repository file *must* exist and be checked out or the upload is aborted. The function currently assumes that the repository file kind is correct and uses this to determine whether the file is binary or text. Once it is available, the Repos FileRegistry will be used. This function is a thin wrapper call to FileServiceImpl.uploadToRID()

Throws SQLException or IOException on error

Parameters:
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.

uploadToRID

public void uploadToRID(java.io.InputStream uploadStream,
                        oracle.repos.services.RID rid,
                        java.sql.Timestamp osTimestamp)
                 throws FileServiceException

uploadToRID

public void uploadToRID(String strOSPath,
                        oracle.repos.services.RID rid,
                        java.sql.Timestamp osTimestamp)
                 throws FileServiceException
Upload an OS file to the specified repository file. The repository file *must* exist and be checked out or the upload is aborted. The file type is again taken from the existing file kind, but will use the FileRegistry when it is available. Timestamp and CRC comparisons are made unless bOverwrite is true. This function is a thin wrapper call to FileServiceImpl.uploadToRID()

Throws SQLException or IOException on error

Parameters:
strOSPath - The full OS path, including file name (e.g. "C:\fol1\file.txt")
rid - The repository file ID to upload to.
osTimestamp -  

downloadFromRID

public void downloadFromRID(String strOSFile,
                            oracle.repos.services.RID rid,
                            boolean bLock,
                            boolean bOverwrite)
                     throws FileServiceException
Deprecated.  
Download a repos file to the specified OS file. This function is superceeded by downloadFromRID(String,RID,int)
Parameters:
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.

downloadFromRID

public boolean downloadFromRID(String strOSFile,
                               oracle.repos.services.RID rid,
                               int flags)
                        throws FileServiceException
Download a repos file to the specified OS file. If the file does not exist it is created. If bOverwrite is true, then the OS file is overwritten, regardless of whether it is newer than the repos file or not. This function is a thin wrapper call to FileServiceImpl.downloadFromRID()

Throws FileServiceException on error

Parameters:
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.

getDownloadStream

public ReposFileInputStream getDownloadStream(oracle.repos.services.RID rid)
                                                                  throws FileServiceException
Returns a ReposFileInputStream that can be used to read the contents of a repository file. The specified file must exist. It is recommended that clients do not try and read more than FileService.getMaxChunkSize() bytes at a time from the returned ReposFileInputStream.

Throws throws FileServiceException on error

Parameters:
rid - The repository file ID which is to be downloaded by the stream.

getMaxChunkSize

public static int getMaxChunkSize()
Calculates and returns the maximum chunk of data which can be read/written by the FileService. I.e. both repository and OS files are read and written in FileService.getMaxChunkSize() chunks (if the file size is bigger than FileService.getMaxChunkSize()).

javaTimeToRepos

public static long javaTimeToRepos(long javaTimestamp)
Converts a java time to repos time. Java time is UTC milliseconds -- the number of milliseconds since Midnight Jan 1st 1970. Repos time is UTC seconds -- the number of *seconds* since 00:00 1-1-1970.
Parameters:
javaTimestamp - The java timestamp in UTC milliseconds to be converted a repos timestamp (UTC seconds).

reposTimeToJava

public static long reposTimeToJava(long reposTimestamp)
Converts a repos time to java time. Java time is UTC milliseconds -- the number of milliseconds since Midnight Jan 1st 1970. Repos time is UTC seconds -- the number of *seconds* since 00:00 1-1-1970.
Parameters:
reposTimestamp - The repos timestamp in UTC seconds to be converted a java timestamp (UTC milliseconds).

getFileCRC

public long getFileCRC(java.io.File osFile)
                throws FileServiceException
Method that gets a repository compatible CRC for the specified os file. Throws an IOException on error
Parameters:
osFile - The OS file to calculate the CRC from (must be readable)

getCORefreshList

public Vector getCORefreshList(String strOSPath,
                                         String strNameFilter,
                                         String strReposPath,
                                         oracle.repos.services.RID ctxtFolderID,
                                         boolean bRecurse)
                                  throws FileServiceException

getSyncDetails

public oracle.repos.services.GID getSyncDetails(String strReposPath,
                                                String strRootFolder,
                                                oracle.repos.services.file.FileServiceNfo ctxtFolder)
                                         throws java.sql.SQLException

ReposCRC

public static long ReposCRC(long crc,
                            byte[] b,
                            int len)

OSFileOpen

public static int OSFileOpen(Object obRef,
                             String strFileName)
                      throws FileServiceException

OSFileClose

public static void OSFileClose(Object obRef,
                               int hFile)
                        throws FileServiceException

OSFileWrite

public static int OSFileWrite(Object obRef,
                              int hFile,
                              byte[] b,
                              int offset,
                              int len,
                              int txtFmt,
                              int nLastChar)
                       throws FileServiceException

OSFileError

public static String OSFileError()

GetTempDir

public static String GetTempDir()
Gets the name of the temporary directory. This is done by first looking at the TEMP environment variable and if this is not set, the TMP environment variable is used. If neither of these are set, 'null' is returned.

IsSymbolicLink

public static boolean IsSymbolicLink(Object obRef,
                                     String strOSPath)
                              throws FileServiceException
Tests to see if the specified file is a symbolic link. Currently, WIN32 shortcuts are *NOT* considered to be links

IsSymbolicLnk

public static int IsSymbolicLnk(String strOSPath)

BM0463 - JR0670 - JDev446