com.crystaldecisions.sdk.occa.infostore
Interface IFiles

All Superinterfaces:
java.util.Collection, java.lang.Iterable, java.util.List

public interface IFiles
extends java.util.List

This interface represents a collection of file objects. These objects support the IFile interface, and are associated with an InfoObject.

This interface defines two categories of operations:

Note: all the file operations are "two-phase". None of the operations will happen until the operations are committed. However, the IFiles.commit() method will be called implicitly when the associated InfoObject is committed.


Field Summary
static java.lang.String UPLOAD_FRS_PROMPTLY
          This constant defines whether an object's files should be uploaded to the FRS right away after they are added or replaced through the corresponding IFiles interface operations.
 
Method Summary
 void abort()
           Aborts all changes made to the file repository server.
 ILocalFile addFile(byte[] stream, java.lang.String prefix, java.lang.String ext, java.lang.String destFileName, java.lang.String subDir)
           Adds a stream to the files collection and uploads it to the specified destination on the file repository server with a unique name.
 ILocalFile addFile(java.io.File file)
           The shortcut for addFile(file, false).
 ILocalFile addFile(java.io.File file, boolean deleteLocalFile)
           The shortcut for addFile(file, null,null,null,null,deleteLocalFile).
 ILocalFile addFile(java.io.File file, java.lang.String prefix, java.lang.String ext, java.lang.String destFilename, java.lang.String subDir, boolean deleteLocalFile)
           Adds a local file to the files collection and uploads it to the specified destination on the file repository server.
 ILocalFile addFile(java.lang.String filePath)
           The shortcut for addFile(filePath, false).
 ILocalFile addFile(java.lang.String filePath, boolean deleteLocalFile)
           The shortcut for addFile(filePath, null,null,null,null,null,deleteLocalFile).
 ILocalFile addFile(java.lang.String filePath, java.lang.String prefix, java.lang.String ext, java.lang.String destFilename, java.lang.String subDir, boolean deleteLocalFile)
           Adds a local file to the files collection and uploads it to the specified destination on the file repository server.
 IStreamingUploadFile addStreamingFile(long size, java.lang.String prefix, java.lang.String ext, java.lang.String destFileName, java.lang.String subDir)
           creates an IStreamingUploadFile object to add a stream to the files collection and uploads it to the specified destination on the file repository server with a specified name.
 IStreamingUploadFile addStreamingFile(java.lang.String prefix, java.lang.String ext, java.lang.String destFileName, java.lang.String subDir)
           creates a upload steam files object to add a stream to the files collection and uploads it to the specified destination on the file repository server with a specified name.
 ILocalFile addUniqueFile(byte[] stream)
           This is a shortcut for addUnique(stream, null, null, null).
 ILocalFile addUniqueFile(byte[] stream, java.lang.String prefix, java.lang.String ext, java.lang.String subDir)
           Adds a local stream to the files collection and uploads it to the specified folder under the default folder for this InfoObject on the file repository server using the specified prefix and extension.
 ILocalFile addUniqueFile(java.io.File file)
           This is a shortcut for addUniqueFile(file, false).
 ILocalFile addUniqueFile(java.io.File file, boolean deleteLocalFile)
           This is a shortcut for addUniqueFile(file, null, null, null, deleteLocalFile).
 ILocalFile addUniqueFile(java.io.File file, java.lang.String prefix, java.lang.String ext, java.lang.String subDir, boolean deleteLocalFile)
           Adds a local file to the files collection and uploads it to the specified folder under the default folder for this InfoObject on the file repository server using the specified prefix and extension.
 ILocalFile addUniqueFile(java.lang.String filePath)
           This is a shortcut for addUniqueFile(filePath, false).
 ILocalFile addUniqueFile(java.lang.String filePath, boolean deleteLocalFile)
           This is a shortcut for addUniqueFile(filePath, null, null, null, deleteLocalFile) .
 ILocalFile addUniqueFile(java.lang.String filePath, java.lang.String prefix, java.lang.String ext, java.lang.String subDir, boolean deleteLocalFile)
           Adds a local file to the files collection and uploads it to the specified folder under the default folder for this InfoObject on the file repository server using the specified prefix and extension.
 IStreamingUploadFile addUniqueStreamingFile(long size, java.lang.String prefix, java.lang.String ext, java.lang.String subDir)
           Adds upload stream to the files collection and uploads it to the specified folder under the default folder for this InfoObject on the file repository server using the specified prefix and extension.
 IStreamingUploadFile addUniqueStreamingFile(java.lang.String prefix, java.lang.String ext, java.lang.String subDir)
           Adds upload stream to the files collection and uploads it to the specified folder under the default folder for this InfoObject on the file repository server using the specified prefix and extension.
 IFile append(int index, byte[] stream)
           Appends the input file content to an existing file in the files collection.
 IFile append(int index, java.io.File file, boolean deleteLocalFile)
           Appends the input file content to an existing file in the files collection.
 IFile append(int index, java.lang.String filepath, boolean deleteLocalFile)
           Appends the input file content to an existing file in the files collection.
 void commit()
           Commits all changes to the file repository server.
 IFiles copy(java.lang.String destPath)
           Copies this IFiles object to the specified path.
 java.lang.String getFRSPathURL()
           Returns the URL to the File Repository Server path.
 java.util.Locale getLocale()
           Returns the locale for this object if it was obtained from the getFiles(Locale, LocaleOption) method.
 boolean isUploadToFRSPromptly()
           Returns the flag indicating whether the files should be uploaded to FRS as soon as they are added or replaced by local data
 IProperties properties()
           Returns the property bag for this files object.
 IFile replace(int index, byte[] stream, java.lang.String prefix, java.lang.String ext, java.lang.String destFilename, java.lang.String subDir)
           Replaces an existing file in the files collection with a new local file.
 IFile replace(int index, java.io.File file)
           The shortcut for replace(index, file, false).
 IFile replace(int index, java.io.File file, boolean deleteLocalFile)
           The shortcut for replace(index, file, null, null, null, null, deleteLocalFile).
 IFile replace(int index, java.io.File file, java.lang.String prefix, java.lang.String ext, java.lang.String destFilename, java.lang.String subDir, boolean deleteLocalFile)
           Replaces an existing file in the files collection with a new local file.
 IFile replace(int index, java.lang.String filePath)
           The shortcut for replace(index, filePath, false).
 IFile replace(int index, java.lang.String filePath, boolean deleteLocalFile)
           The shortcut for replace(index, filePath, null, null, null, null, deleteLocalFile).
 IFile replace(int index, java.lang.String filePath, java.lang.String prefix, java.lang.String ext, java.lang.String destFilename, java.lang.String subDir, boolean deleteLocalFile)
           Replaces an existing file in the files collection with a new local file.
 IFile replaceUnique(int index, byte[] stream)
           The shortcut for replaceUnique(index, stream, null, null, null).
 IFile replaceUnique(int index, byte[] stream, java.lang.String prefix, java.lang.String ext, java.lang.String subDir)
           Replaces an existing file in the files collection with a new local file.
 IFile replaceUnique(int index, java.io.File file)
           The shortcut for replaceUnique(index, file, false).
 IFile replaceUnique(int index, java.io.File file, boolean deleteLocalFile)
           The shortcut for replaceUnique(index, file, null, null, deleteLocalFile).
 IFile replaceUnique(int index, java.io.File file, java.lang.String prefix, java.lang.String ext, java.lang.String subDir, boolean deleteLocalFile)
           Replaces an existing file in the files collection with a new local file.
 IFile replaceUnique(int index, java.lang.String filePath)
           The shortcut for replaceUnique(index, filePath, false).
 IFile replaceUnique(int index, java.lang.String filePath, boolean deleteLocalFile)
           The shortcut for replaceUnique(index, filePath, null, null, deleteLocalFile).
 IFile replaceUnique(int index, java.lang.String filePath, java.lang.String prefix, java.lang.String ext, java.lang.String subDir, boolean deleteLocalFile)
           Replaces an existing file in the files collection with a new local file.
 IFile replaceUniqueWithStreamingFile(int index, long size, java.lang.String prefix, java.lang.String ext, java.lang.String subDir)
           Replaces an existing file in the files collection with a new upload stream file The stream file is uploaded to the specified destination on the file server.
 IFile replaceUniqueWithStreamingFile(int index, java.lang.String prefix, java.lang.String ext, java.lang.String subDir)
           Replaces an existing file in the files collection with a new upload stream file The stream file is uploaded to the specified destination on the file server.
 IFile replaceWithStreamingFile(int index, long size, java.lang.String prefix, java.lang.String ext, java.lang.String destFilename, java.lang.String subDir)
           Replaces an existing file in the files collection with a new upload stream.
 IFile replaceWithStreamingFile(int index, java.lang.String prefix, java.lang.String ext, java.lang.String destFilename, java.lang.String subDir)
           Replaces an existing file in the files collection with a new upload stream.
 void setUploadToFRSPromptly(boolean bUpload)
           Sets the flag to upload the files to the FRS as soon as they are added or replaced by local data
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Field Detail

UPLOAD_FRS_PROMPTLY

static final java.lang.String UPLOAD_FRS_PROMPTLY
This constant defines whether an object's files should be uploaded to the FRS right away after they are added or replaced through the corresponding IFiles interface operations. Default value is false.

See Also:
Constant Field Values
Method Detail

addFile

ILocalFile addFile(java.lang.String filePath,
                   java.lang.String prefix,
                   java.lang.String ext,
                   java.lang.String destFilename,
                   java.lang.String subDir,
                   boolean deleteLocalFile)
                   throws SDKException

Adds a local file to the files collection and uploads it to the specified destination on the file repository server.

Parameters:
filePath - The local file's path.
prefix - The prefix of the destination file name. When this argument is null, no prefix will be added to the destination file name.
ext - The extension of the destination file name. When this argument is null, no suffix will be added to the destination file name.
destFilename - The destination file name, excluding the prefix and suffix. That is, if destFileName is not null, the final file name will be <prefix><destFileName>.<ext>. If the destFileName is null, the destination file will have the same name as the local file.
subDir - The sub-directory under the destination directory. If null, no subDir will be added.
deleteLocalFile - This is true if the local file needs to be deleted after the transaction is committed and false if the local file should be kept.
Returns:
A local file object representing the local file.
Throws:
SDKException - This is thrown if the process is unsuccessful.

addFile

ILocalFile addFile(java.io.File file,
                   java.lang.String prefix,
                   java.lang.String ext,
                   java.lang.String destFilename,
                   java.lang.String subDir,
                   boolean deleteLocalFile)
                   throws SDKException

Adds a local file to the files collection and uploads it to the specified destination on the file repository server.

Parameters:
file - The local file to be added.
prefix - The prefix of the destination file name. When this argument is null, no prefix will be added to the destination file name.
ext - The extension of the destination file name. When this argument is null, no suffix will be added to the destination file name.
destFilename - The destination file name, excluding the prefix and suffix. The final file name will be <prefix><destFileName>.<ext>.
subDir - The sub-directory under the destination directory. If null, no subDir will be added.
deleteLocalFile - This is true if the local file needs to be deleted after the transaction is committed and false if the local file should be kept.
Returns:
A local file object representing the local file.
Throws:
SDKException - This is thrown if the process is unsuccessful.

addFile

ILocalFile addFile(byte[] stream,
                   java.lang.String prefix,
                   java.lang.String ext,
                   java.lang.String destFileName,
                   java.lang.String subDir)
                   throws SDKException

Adds a stream to the files collection and uploads it to the specified destination on the file repository server with a unique name.

Parameters:
stream - The byte array to be added.
prefix - The prefix of the destination file name. When this argument is null, no prefix will be added to the destination file name.
ext - The extension of the destination file name. When this argument is null, no suffix will be added to the destination file name.
destFileName - The destination file name, excluding the prefix and suffix. The final file name will be <prefix><destFileName>.<ext>.
subDir - The sub-directory under the destination directory. If null, no subDir will be added.
Returns:
A local file object representing the supplied local stream.
Throws:
SDKException - This is thrown if the process is unsuccessful.

addStreamingFile

IStreamingUploadFile addStreamingFile(java.lang.String prefix,
                                      java.lang.String ext,
                                      java.lang.String destFileName,
                                      java.lang.String subDir)
                                      throws SDKException

creates a upload steam files object to add a stream to the files collection and uploads it to the specified destination on the file repository server with a specified name.

Parameters:
prefix - The prefix of the destination file name. When this argument is null, no prefix will be added to the destination file name.
ext - The extension of the destination file name. When this argument is null, no suffix will be added to the destination file name.
destFileName - The destination file name, excluding the prefix and suffix. The final file name will be <prefix><destFileName>.<ext>.
subDir - The sub-directory under the destination directory. If null, no subDir will be added.
Returns:
An upload streaming file object that will be uploading the actual byte steams
Throws:
SDKException - This is thrown if the process is unsuccessful.

addStreamingFile

IStreamingUploadFile addStreamingFile(long size,
                                      java.lang.String prefix,
                                      java.lang.String ext,
                                      java.lang.String destFileName,
                                      java.lang.String subDir)
                                      throws SDKException

creates an IStreamingUploadFile object to add a stream to the files collection and uploads it to the specified destination on the file repository server with a specified name.

Parameters:
size - The size of the file that will be uploaded. This will be used to check disk availability on frs If you don't know the size of the file, put in 0
prefix - The prefix of the destination file name. When this argument is null, no prefix will be added to the destination file name.
ext - The extension of the destination file name. When this argument is null, no suffix will be added to the destination file name.
destFileName - The destination file name, excluding the prefix and suffix. The final file name will be <prefix><destFileName>.<ext>.
subDir - The sub-directory under the destination directory. If null, no subDir will be added.
Returns:
An upload streaming file object that will be uploading the actual byte steams
Throws:
SDKException - This is thrown if the process is unsuccessful.

addFile

ILocalFile addFile(java.lang.String filePath,
                   boolean deleteLocalFile)
                   throws SDKException

The shortcut for addFile(filePath, null,null,null,null,null,deleteLocalFile).

Parameters:
filePath - The local file's path.
deleteLocalFile - This is true if the local file needs to be deleted after the transaction is committed and false if the local file should be kept.
Returns:
A local file object representing the local file.
Throws:
SDKException - This is thrown if the process is unsuccessful.

addFile

ILocalFile addFile(java.io.File file,
                   boolean deleteLocalFile)
                   throws SDKException

The shortcut for addFile(file, null,null,null,null,deleteLocalFile).

Parameters:
file - The local file to be added.
deleteLocalFile - This is true if the local file needs to be deleted after the transaction is committed and false if the local file should be kept.
Returns:
A local file object representing the local file.
Throws:
SDKException - This is thrown if the process is unsuccessful.

addFile

ILocalFile addFile(java.lang.String filePath)
                   throws SDKException

The shortcut for addFile(filePath, false).

Parameters:
filePath - The local file's path.
Returns:
A local file object representing the local file.
Throws:
SDKException - This is thrown if the process is unsuccessful.

addFile

ILocalFile addFile(java.io.File file)
                   throws SDKException

The shortcut for addFile(file, false).

Parameters:
file - The local file to be added.
Returns:
A local file object representing the local file.
Throws:
SDKException - This is thrown if the process is unsuccessful.

addUniqueFile

ILocalFile addUniqueFile(java.lang.String filePath,
                         java.lang.String prefix,
                         java.lang.String ext,
                         java.lang.String subDir,
                         boolean deleteLocalFile)
                         throws SDKException

Adds a local file to the files collection and uploads it to the specified folder under the default folder for this InfoObject on the file repository server using the specified prefix and extension. The file name is randomly chosen by the server, provided it is unique among the files in the same directory.

Parameters:
filePath - The local file's path.
prefix - The prefix of the destination file name. When this argument is null, no prefix will be added to the destination file name.
ext - The extension of the destination file name. When this argument is null, the local file's extension will be used.
subDir - The sub-directory under the destination directory. If null, no subDir will be added.
deleteLocalFile - This is true if the local file needs to be deleted after the transaction is committed and false if the local file should be kept.
Returns:
A local file object representing the local file.
Throws:
SDKException - This is thrown if the process was unsuccessful.

addUniqueFile

ILocalFile addUniqueFile(java.io.File file,
                         java.lang.String prefix,
                         java.lang.String ext,
                         java.lang.String subDir,
                         boolean deleteLocalFile)
                         throws SDKException

Adds a local file to the files collection and uploads it to the specified folder under the default folder for this InfoObject on the file repository server using the specified prefix and extension. The file name is randomly chosen by the server, provided it is unique among the files in the same directory.

Parameters:
file - The local file to be added.
prefix - The prefix of the destination file name. When this argument is null, no prefix will be added to the destination file name.
ext - The extension of the destination file name. When this argument is null, the local file's extension will be used.
subDir - The sub-directory under the destination directory. If null, no subDir will be added.
deleteLocalFile - This is true if the local file needs to be deleted after the transaction is committed and false if the local file should be kept.
Returns:
A local file object representing the local file.
Throws:
SDKException - This is thrown if the process was unsuccessful.

addUniqueFile

ILocalFile addUniqueFile(byte[] stream,
                         java.lang.String prefix,
                         java.lang.String ext,
                         java.lang.String subDir)
                         throws SDKException

Adds a local stream to the files collection and uploads it to the specified folder under the default folder for this InfoObject on the file repository server using the specified prefix and extension. The file name is randomly chosen by the server provided it is unique among the files in the same directory.

Parameters:
stream - The byte array to be added.
prefix - The prefix of the destination file name. When this argument is null, no prefix will be added to the destination file name.
ext - The extension of the destination file name. When this argument is null, the local file's extension will be used.
subDir - The sub-directory under the destination directory. If null, no subDir will be added.
Returns:
A local file object representing the local stream.
Throws:
SDKException - This is thrown if the process was unsuccessful.

addUniqueStreamingFile

IStreamingUploadFile addUniqueStreamingFile(java.lang.String prefix,
                                            java.lang.String ext,
                                            java.lang.String subDir)
                                            throws SDKException

Adds upload stream to the files collection and uploads it to the specified folder under the default folder for this InfoObject on the file repository server using the specified prefix and extension. The file name is randomly chosen by the server provided it is unique among the files in the same directory.

Parameters:
prefix - The prefix of the destination file name. When this argument is null, no prefix will be added to the destination file name.
ext - The extension of the destination file name. When this argument is null, the local file's extension will be used.
subDir - The sub-directory under the destination directory. If null, no subDir will be added.
Returns:
A local file object representing the local stream.
Throws:
SDKException - This is thrown if the process was unsuccessful.

addUniqueStreamingFile

IStreamingUploadFile addUniqueStreamingFile(long size,
                                            java.lang.String prefix,
                                            java.lang.String ext,
                                            java.lang.String subDir)
                                            throws SDKException

Adds upload stream to the files collection and uploads it to the specified folder under the default folder for this InfoObject on the file repository server using the specified prefix and extension. The file name is randomly chosen by the server provided it is unique among the files in the same directory.

Parameters:
size - The size of the file that will be uploaded. This will be used to check disk availability on frs If you don't know the size of the file, put in 0
prefix - The prefix of the destination file name. When this argument is null, no prefix will be added to the destination file name.
ext - The extension of the destination file name. When this argument is null, the local file's extension will be used.
subDir - The sub-directory under the destination directory. If null, no subDir will be added.
Returns:
A local file object representing the local stream.
Throws:
SDKException - This is thrown if the process was unsuccessful.

addUniqueFile

ILocalFile addUniqueFile(java.lang.String filePath,
                         boolean deleteLocalFile)
                         throws SDKException

This is a shortcut for addUniqueFile(filePath, null, null, null, deleteLocalFile) .

Parameters:
filePath - The local file's path.
deleteLocalFile - This is true if the local file needs to be deleted after the transaction is committed and false if the local file should be kept.
Returns:
A local file object representing the local file.
Throws:
SDKException - This is thrown if the process was unsuccessful.

addUniqueFile

ILocalFile addUniqueFile(java.io.File file,
                         boolean deleteLocalFile)
                         throws SDKException

This is a shortcut for addUniqueFile(file, null, null, null, deleteLocalFile).

Parameters:
file - The local file to be added.
deleteLocalFile - This is true if the local file needs to be deleted after the transaction is committed and false if the local file should be kept.
Returns:
A local file object representing the local file.
Throws:
SDKException - This is thrown if the process was unsuccessful.

addUniqueFile

ILocalFile addUniqueFile(java.lang.String filePath)
                         throws SDKException

This is a shortcut for addUniqueFile(filePath, false).

Parameters:
filePath - The local file's path.
Returns:
A local file object representing the local file.
Throws:
SDKException - This is thrown if the process was unsuccessful.

addUniqueFile

ILocalFile addUniqueFile(java.io.File file)
                         throws SDKException

This is a shortcut for addUniqueFile(file, false).

Parameters:
file - The local file to be added.
Returns:
A local file object representing the local file.
Throws:
SDKException - This is thrown if the process was unsuccessful.

addUniqueFile

ILocalFile addUniqueFile(byte[] stream)
                         throws SDKException

This is a shortcut for addUnique(stream, null, null, null).

Parameters:
stream - The byte array to be added.
Returns:
A local file object representing the local stream.
Throws:
SDKException - This is thrown if the process was unsuccessful.

replace

IFile replace(int index,
              java.lang.String filePath,
              java.lang.String prefix,
              java.lang.String ext,
              java.lang.String destFilename,
              java.lang.String subDir,
              boolean deleteLocalFile)
              throws SDKException

Replaces an existing file in the files collection with a new local file. The local file is uploaded to the specified destination on the file server. The file is added in the same way as calling the addFile(filePath, prefix, ext, destFilename, subDir, deleteLocalFile) method.

Parameters:
index - The index of the object to be replaced.
filePath - The local file's path.
prefix - The prefix of the destination file name. When this argument is null, no prefix will be added to the destination file name.
ext - The extension of the destination file name. When this argument is null, no suffix will be added to the destination file name.
destFilename - The destination file name, excluding the prefix and suffix. That is, if destFileName is not null, the final file name will be <prefix><destFileName>.<ext>. If the destFileName is null, the destination file will have the same name as the local file.
subDir - The sub-directory under the destination directory. If null, no subDir will be added.
deleteLocalFile - This is true if the local file needs to be deleted after the transaction is committed and false if the local file should be kept.
Returns:
The old file object.
Throws:
SDKException - This is thrown if the process was unsuccessful.

replace

IFile replace(int index,
              java.io.File file,
              java.lang.String prefix,
              java.lang.String ext,
              java.lang.String destFilename,
              java.lang.String subDir,
              boolean deleteLocalFile)
              throws SDKException

Replaces an existing file in the files collection with a new local file. The local file is uploaded to the specified destination on the file server. The file is added in the same way as calling the addFile(file, prefix, ext, destFilename, subDir, deleteLocalFile) method

Parameters:
index - The index of the object to be replaced.
file - The local file that will replace the current file.
prefix - The prefix of the destination file name. When this argument is null, no prefix will be added to the destination file name.
ext - The extension of the destination file name. When this argument is null, no suffix will be added to the destination file name.
destFilename - The destination file name, excluding the prefix and suffix. That is, if destFileName is not null, the final file name will be <prefix><destFileName>.<ext>. If the destFileName is null, the destination file will have the same name as the local file.
subDir - The sub-directory under the destination directory. If null, no subDir will be added.
deleteLocalFile - This is true if the local file needs to be deleted after the transaction is committed and false if the local file should be kept.
Returns:
The old file object.
Throws:
SDKException - This is thrown if the process was unsuccessful.

replace

IFile replace(int index,
              byte[] stream,
              java.lang.String prefix,
              java.lang.String ext,
              java.lang.String destFilename,
              java.lang.String subDir)
              throws SDKException

Replaces an existing file in the files collection with a new local file. The local file is uploaded to the specified destination on the file server. The file is added in the same way as calling the addFile(stream, prefix, ext, destFilename, subDir) method.

Parameters:
index - The index of the object to be replaced.
stream - The byte array to be added.
prefix - The prefix of the destination file name. When this argument is null, no prefix will be added to the destination file name.
ext - The extension of the destination file name. When this argument is null, no suffix will be added to the destination file name.
destFilename - The destination file name, excluding the prefix and suffix. The final file name will be <prefix><destFileName>.<ext>.
subDir - The sub-directory under the destination directory. If null, no subDir will be added.
Returns:
The old file object.
Throws:
SDKException - This is thrown if the process was unsuccessful.

replaceWithStreamingFile

IFile replaceWithStreamingFile(int index,
                               java.lang.String prefix,
                               java.lang.String ext,
                               java.lang.String destFilename,
                               java.lang.String subDir)
                               throws SDKException

Replaces an existing file in the files collection with a new upload stream. The stream is uploaded to the specified destination on the file server. The file is added in the same way as calling the addFile(size, prefix, ext, destFilename, subDir) method.

Parameters:
index - The index of the object to be replaced.
prefix - The prefix of the destination file name. When this argument is null, no prefix will be added to the destination file name.
ext - The extension of the destination file name. When this argument is null, no suffix will be added to the destination file name.
destFilename - The destination file name, excluding the prefix and suffix. The final file name will be <prefix><destFileName>.<ext>.
subDir - The sub-directory under the destination directory. If null, no subDir will be added.
Returns:
The old file object.
Throws:
SDKException - This is thrown if the process was unsuccessful.

replaceWithStreamingFile

IFile replaceWithStreamingFile(int index,
                               long size,
                               java.lang.String prefix,
                               java.lang.String ext,
                               java.lang.String destFilename,
                               java.lang.String subDir)
                               throws SDKException

Replaces an existing file in the files collection with a new upload stream. The stream is uploaded to the specified destination on the file server. The file is added in the same way as calling the addFile(size, prefix, ext, destFilename, subDir) method.

Parameters:
index - The index of the object to be replaced.
size - The size of the file that will be uploaded. This will be used to check disk availability on frs If you don't know the size of the file, put in 0
prefix - The prefix of the destination file name. When this argument is null, no prefix will be added to the destination file name.
ext - The extension of the destination file name. When this argument is null, no suffix will be added to the destination file name.
destFilename - The destination file name, excluding the prefix and suffix. The final file name will be <prefix><destFileName>.<ext>.
subDir - The sub-directory under the destination directory. If null, no subDir will be added.
Returns:
The old file object.
Throws:
SDKException - This is thrown if the process was unsuccessful.

replace

IFile replace(int index,
              java.lang.String filePath,
              boolean deleteLocalFile)
              throws SDKException

The shortcut for replace(index, filePath, null, null, null, null, deleteLocalFile).

Parameters:
index - The index of the object to be replaced.
filePath - The local file's path.
deleteLocalFile - This is true if the local file needs to be deleted after the transaction is committed and false if the local file should be kept.
Returns:
The old file object.
Throws:
SDKException - This is thrown if the process was unsuccessful.

replace

IFile replace(int index,
              java.io.File file,
              boolean deleteLocalFile)
              throws SDKException

The shortcut for replace(index, file, null, null, null, null, deleteLocalFile).

Parameters:
index - The index of the object to be replaced.
file - The local file that will replace the current file.
deleteLocalFile - This is true if the local file needs to be deleted after the transaction is committed and false if the local file should be kept.
Returns:
The old file object.
Throws:
SDKException - This is thrown if the process was unsuccessful.

replace

IFile replace(int index,
              java.lang.String filePath)
              throws SDKException

The shortcut for replace(index, filePath, false).

Parameters:
index - The index of the object to be replaced.
filePath - The local file's path.
Returns:
The old file object.
Throws:
SDKException - This is thrown if the process was unsuccessful.

replace

IFile replace(int index,
              java.io.File file)
              throws SDKException

The shortcut for replace(index, file, false).

Parameters:
index - The index of the object to be replaced.
file - The local file that will replace the current file.
Returns:
The old file object.
Throws:
SDKException - This is thrown if the process was unsuccessful.

replaceUnique

IFile replaceUnique(int index,
                    java.lang.String filePath,
                    java.lang.String prefix,
                    java.lang.String ext,
                    java.lang.String subDir,
                    boolean deleteLocalFile)
                    throws SDKException

Replaces an existing file in the files collection with a new local file. The local file is uploaded to the specified destination on the file server. The file is added in the same way as calling the addUniqueFile(filePath, prefix, ext, subDir, deleteLocalFile) method.

Parameters:
index - The index of the object to be replaced.
filePath - The local file's path.
prefix - The prefix of the destination file name. When this argument is null, no prefix will be added to the destination file name.
ext - The extension of the destination file name. When this argument is null, no suffix will be added to the destination file name.
subDir - The sub-directory under the destination directory. If null, no subDir will be added.
deleteLocalFile - This is true if the local file needs to be deleted after the transaction is committed and false if the local file should be kept.
Returns:
The old file object.
Throws:
SDKException - This is thrown if the process was unsuccessful.

replaceUnique

IFile replaceUnique(int index,
                    java.io.File file,
                    java.lang.String prefix,
                    java.lang.String ext,
                    java.lang.String subDir,
                    boolean deleteLocalFile)
                    throws SDKException

Replaces an existing file in the files collection with a new local file. The local file is uploaded to the specified destination on the file server. The file is added in the same way as calling the addUniqueFile(filePath, prefix, ext, subDir, deleteLocalFile) method.

Parameters:
index - The index of the object to be replaced.
file - The local file that will replace the current file.
prefix - The prefix of the destination file name. When this argument is null, no prefix will be added to the destination file name.
ext - The extension of the destination file name. When this argument is null, no suffix will be added to the destination file name.
subDir - The sub-directory under the destination directory. If null, no subDir will be added.
deleteLocalFile - This is true if the local file needs to be deleted after the transaction is committed and false if the local file should be kept.
Returns:
The old file object.
Throws:
SDKException - This is thrown if the process was unsuccessful.

replaceUnique

IFile replaceUnique(int index,
                    byte[] stream,
                    java.lang.String prefix,
                    java.lang.String ext,
                    java.lang.String subDir)
                    throws SDKException

Replaces an existing file in the files collection with a new local file. The local file is uploaded to the specified destination on the file server. The file is added in the same way as calling the addUniqueFile(filePath, prefix, ext, subDir, deleteLocalFile) method.

Parameters:
index - The index of the object to be replaced.
stream - The byte array to be added.
prefix - The prefix of the destination file name. When this argument is null, no prefix will be added to the destination file name.
ext - The extension of the destination file name. When this argument is null, no suffix will be added to the destination file name.
subDir - The sub-directory under the destination directory. If null, no subDir will be added.
Returns:
The old file object.
Throws:
SDKException - This is thrown if the process was unsuccessful.

replaceUniqueWithStreamingFile

IFile replaceUniqueWithStreamingFile(int index,
                                     java.lang.String prefix,
                                     java.lang.String ext,
                                     java.lang.String subDir)
                                     throws SDKException

Replaces an existing file in the files collection with a new upload stream file The stream file is uploaded to the specified destination on the file server. The file is added in the same way as calling the addUniqueFile(filePath, prefix, ext, subDir, deleteLocalFile) method.

Parameters:
index - The index of the object to be replaced.
prefix - The prefix of the destination file name. When this argument is null, no prefix will be added to the destination file name.
ext - The extension of the destination file name. When this argument is null, no suffix will be added to the destination file name.
subDir - The sub-directory under the destination directory. If null, no subDir will be added.
Returns:
The old file object.
Throws:
SDKException - This is thrown if the process was unsuccessful.

replaceUniqueWithStreamingFile

IFile replaceUniqueWithStreamingFile(int index,
                                     long size,
                                     java.lang.String prefix,
                                     java.lang.String ext,
                                     java.lang.String subDir)
                                     throws SDKException

Replaces an existing file in the files collection with a new upload stream file The stream file is uploaded to the specified destination on the file server. The file is added in the same way as calling the addUniqueFile(filePath, prefix, ext, subDir, deleteLocalFile) method.

Parameters:
index - The index of the object to be replaced.
size - The size of the file that will be uploaded. This will be used to check disk availability on frs If you don't know the size of the file, put in 0
prefix - The prefix of the destination file name. When this argument is null, no prefix will be added to the destination file name.
ext - The extension of the destination file name. When this argument is null, no suffix will be added to the destination file name.
subDir - The sub-directory under the destination directory. If null, no subDir will be added.
Returns:
The old file object.
Throws:
SDKException - This is thrown if the process was unsuccessful.

replaceUnique

IFile replaceUnique(int index,
                    java.lang.String filePath,
                    boolean deleteLocalFile)
                    throws SDKException

The shortcut for replaceUnique(index, filePath, null, null, deleteLocalFile).

Parameters:
index - The index of the object to be replaced.
filePath - The local file's path.
deleteLocalFile - This is true if the local file needs to be deleted after the transaction is committed and false if the local file should be kept.
Returns:
The old file object.
Throws:
SDKException - This is thrown if the process was unsuccessful.

replaceUnique

IFile replaceUnique(int index,
                    java.io.File file,
                    boolean deleteLocalFile)
                    throws SDKException

The shortcut for replaceUnique(index, file, null, null, deleteLocalFile).

Parameters:
index - The index of the object to be replaced.
file - The local file that will replace the current file.
deleteLocalFile - This is true if the local file needs to be deleted after the transaction is committed and false if the local file should be kept.
Returns:
The old file object.
Throws:
SDKException - This is thrown if the process was unsuccessful.

replaceUnique

IFile replaceUnique(int index,
                    java.lang.String filePath)
                    throws SDKException

The shortcut for replaceUnique(index, filePath, false).

Parameters:
index - The index of the object to be replaced.
filePath - The local file's path.
Returns:
The old file object.
Throws:
SDKException - This is thrown if the process was unsuccessful.

replaceUnique

IFile replaceUnique(int index,
                    java.io.File file)
                    throws SDKException

The shortcut for replaceUnique(index, file, false).

Parameters:
index - The index of the object to be replaced.
file - The local file that will replace the current file.
Returns:
The old file object.
Throws:
SDKException - This is thrown if the process was unsuccessful.

replaceUnique

IFile replaceUnique(int index,
                    byte[] stream)
                    throws SDKException

The shortcut for replaceUnique(index, stream, null, null, null).

Parameters:
index - the index of the object to be replaced.
stream - The byte array to be added.
Returns:
The old file object.
Throws:
SDKException - This is thrown if the process was unsuccessful.

commit

void commit()
            throws SDKException

Commits all changes to the file repository server.

Throws:
SDKException - This is thrown if the process is unsuccessful.

abort

void abort()

Aborts all changes made to the file repository server.


copy

IFiles copy(java.lang.String destPath)
            throws SDKException

Copies this IFiles object to the specified path.

Parameters:
destPath - The path of the destination where the file will be copied to.
Returns:
An IFiles object containing the copied files.
Throws:
SDKException

properties

IProperties properties()

Returns the property bag for this files object.

Returns:
An IProperties object containing the property bag for this files object.

getFRSPathURL

java.lang.String getFRSPathURL()

Returns the URL to the File Repository Server path.

Returns:
A String containing the URL to the FRS path.

isUploadToFRSPromptly

boolean isUploadToFRSPromptly()

Returns the flag indicating whether the files should be uploaded to FRS as soon as they are added or replaced by local data

Returns:
the flag indicating whether the files should be uploaded to FRS as soon as they are added or replaced by local data

setUploadToFRSPromptly

void setUploadToFRSPromptly(boolean bUpload)

Sets the flag to upload the files to the FRS as soon as they are added or replaced by local data

Parameters:
bUpload - The flag indicating whether the files should be uploaded to FRS as soon as they are added or replaced by local data

append

IFile append(int index,
             java.io.File file,
             boolean deleteLocalFile)
             throws SDKException

Appends the input file content to an existing file in the files collection. The local file is uploaded to the file server and append to the physical file corresponding to the specified file in collection.

Parameters:
index - The index of the file object to be appended.
file - The local file that will be appended to the specified file.
deleteLocalFile - This is true if the local file needs to be deleted after the transaction is committed and false if the local file should be kept.
Returns:
The old file object.
Throws:
SDKException - This is thrown if the process was unsuccessful.

append

IFile append(int index,
             java.lang.String filepath,
             boolean deleteLocalFile)
             throws SDKException

Appends the input file content to an existing file in the files collection. The local file is uploaded to the file server and append to the physical file corresponding to the specified file in collection.

Parameters:
index - The index of the file object to be appended.
filepath - The local file that will be appended to the specified file.
deleteLocalFile - This is true if the local file needs to be deleted after the transaction is committed and false if the local file should be kept.
Returns:
The old file object.
Throws:
SDKException - This is thrown if the process was unsuccessful.

append

IFile append(int index,
             byte[] stream)
             throws SDKException

Appends the input file content to an existing file in the files collection. The local file is uploaded to the file server and append to the physical file corresponding to the specified file in collection.

Parameters:
index - The index of the file object to be appended.
stream - The byte stream that will be appended to the specified file. after the transaction is committed and false if the local file should be kept.
Returns:
The old file object.
Throws:
SDKException - This is thrown if the process was unsuccessful.

getLocale

java.util.Locale getLocale()

Returns the locale for this object if it was obtained from the getFiles(Locale, LocaleOption) method. If this object was obtained from the getSourceFiles method, it returns null. If this object was obtained from the getFiles method, it returns null.

Returns:
the locale for this IFiles object