Package com.uc4.api.objects
Class FileTransferSettings
java.lang.Object
com.uc4.api.objects.FileTransferSettings
This class contains settings for the FileTransfer object ("FileTransfer")-Tab.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault file compression.static final intNo compression.static final intEnabled File compression.static final intAppend the transfered file to the existing destination file.static final intCancel the transfer if the destination file already exists.static final intOverwrite an existing file. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns an integer containing compression setting.intReturns an integer which indicates the behavior in case of an existing destination file.intbooleanReturnsfalseif a wild card file transfer should continue in case of errors.booleanbooleanbooleanbooleanbooleanReturns the setting to keep file attributes.booleanbooleanReturnstrueif the wildcard characters are used in this FileTransfer object.voidsetAbortAtFirstError(boolean abortAtFirstError) Changes the setting to cancel or continue a wildcard filetransfer in case of errors.voidsetCompression(int compress) Sets the compression level.voidsetDestinationCodeTable(UC4ObjectName destinationCodeTable) Sets the CodeTable for all destination files.voidsetDestinationFile(String destinationFile) Destination of the FileTransfer Specify where the file should be stored, thereby indicating the directory, folder or ID.voidsetDestinationFileAttributes(String destinationFileAttributes) Sets additional file attribtues (optional) of the source file.voidsetDestinationHost(UC4HostName destinationHost) Sets the destination host.voidsetDestinationLogin(UC4ObjectName destinationLogin) Sets the name fo the Login Object which should be used by source Agent.voidsetEraseSource(boolean eraseSource) Set this flag totrueto have the file deleted after the transfer.voidsetFileExistsAction(int fileExistsAction) Sets the behavior in case of an existing destination file.voidSets the file format to binary.voidSets the file format to text.voidsetIncludeSubDirectories(boolean includeSubDirectories) Set this flag to include files in subdirectories of a FileTransfer with wildcard characters.voidsetKeepFileAttributes(boolean keepFileAttributes) Changes the setting to keep the attributes of the source file.voidsetMaxParallelTransfers(int maxParallelTransfers) Sets the number of files to be transferred parallel to a FileTransfer with wildcard characters.voidsetSourceCodeTable(UC4ObjectName sourceCodeTable) Sets the CodeTable for all source files.voidsetSourceFile(String sourceFile) Sets the name of the source file(s), thereby using the directory, folder or ID FileTransfer with wildcard characters.voidsetSourceFileAttributes(String sourceFileAttributes) Sets additional file attribtues (optional) of the source file.voidsetSourceHost(UC4HostName sourceHost) Sets the source host.voidsetSourceLogin(UC4ObjectName sourceLogin) Sets the name fo the Login Object which should be used by source Agent.voidsetTransferFolderStructure(boolean transferCompleteFolderStructure) Set this flag to transfer the complete folder structure with a wildcard transfere.voidsetWildcards(boolean wildcards) Set this flag to true to execute FileTransfers with wildcards.protected void
-
Field Details
-
COMPRESSION_DEFAULT
public static final int COMPRESSION_DEFAULTDefault file compression.- See Also:
-
COMPRESSION_NO
public static final int COMPRESSION_NONo compression.- See Also:
-
COMPRESSION_YES
public static final int COMPRESSION_YESEnabled File compression.- See Also:
-
FILE_EXISTS_OVERWRITE
public static final int FILE_EXISTS_OVERWRITEOverwrite an existing file.- See Also:
-
FILE_EXISTS_CANCEL
public static final int FILE_EXISTS_CANCELCancel the transfer if the destination file already exists.- See Also:
-
FILE_EXISTS_APPEND
public static final int FILE_EXISTS_APPENDAppend the transfered file to the existing destination file.- See Also:
-
-
Constructor Details
-
FileTransferSettings
protected FileTransferSettings(com.uc4.util.XMLDocument doc)
-
-
Method Details
-
store
-
getFileExistsAction
public int getFileExistsAction()Returns an integer which indicates the behavior in case of an existing destination file. Possible return values are the constants defined in this class:- FILE_EXISTS_OVERWRITE
- FILE_EXISTS_CANCEL
- FILE_EXISTS_APPEND
- Returns:
- File exist action
-
setFileExistsAction
public void setFileExistsAction(int fileExistsAction) Sets the behavior in case of an existing destination file. The parameterfileExistsActioncan have the following values:- FILE_EXISTS_OVERWRITE
- FILE_EXISTS_CANCEL
- FILE_EXISTS_APPEND
- Parameters:
fileExistsAction- File exist action
-
isKeepFileAttributes
public boolean isKeepFileAttributes()Returns the setting to keep file attributes.- Returns:
- true if the source file attributes should be kept if possible
-
isAbortAtFirstError
public boolean isAbortAtFirstError()Returnsfalseif a wild card file transfer should continue in case of errors.- Returns:
- true if a wildcard file transfer should abort on the first error.
-
setAbortAtFirstError
public void setAbortAtFirstError(boolean abortAtFirstError) Changes the setting to cancel or continue a wildcard filetransfer in case of errors.- Parameters:
abortAtFirstError- true if a wildcard filetransfer should abort in case of error. If set to false the other files are transfered even one of them could not be transfered.
-
setKeepFileAttributes
public void setKeepFileAttributes(boolean keepFileAttributes) Changes the setting to keep the attributes of the source file.- Parameters:
keepFileAttributes- true if the attributes should be kept
-
isFormatText
public boolean isFormatText()- Returns:
- True if the files are transported as text files, false otherwise
-
isFormatBinary
public boolean isFormatBinary()- Returns:
- True if the files are transported as binary files
-
setFormatText
public void setFormatText()Sets the file format to text. -
setFormatBinary
public void setFormatBinary()Sets the file format to binary. -
isEraseSource
public boolean isEraseSource()- Returns:
- true if source files are deleted after transfer
-
setEraseSource
public void setEraseSource(boolean eraseSource) Set this flag totrueto have the file deleted after the transfer.- Parameters:
eraseSource- True if source files should be deleted after transfer
-
isIncludeSubDirectories
public boolean isIncludeSubDirectories()- Returns:
- True if subdirectories should be included, false otherwise
-
setIncludeSubDirectories
public void setIncludeSubDirectories(boolean includeSubDirectories) Set this flag to include files in subdirectories of a FileTransfer with wildcard characters. Only available if both platforms support this function and the option "Use wildcards" is selected.- Parameters:
includeSubDirectories- True if subdirectories should be included
-
getMaxParallelTransfers
public int getMaxParallelTransfers()- Returns:
- The number of files to be transferred parallel
-
setMaxParallelTransfers
public void setMaxParallelTransfers(int maxParallelTransfers) Sets the number of files to be transferred parallel to a FileTransfer with wildcard characters. The higher the number, the bigger the load on the participating computers. Only available if "Use wildcards" is selected.- Parameters:
maxParallelTransfers- Number of parallel transfers
-
isWildcards
public boolean isWildcards()Returnstrueif the wildcard characters are used in this FileTransfer object.- Returns:
- Use wildcards
-
setWildcards
public void setWildcards(boolean wildcards) Set this flag to true to execute FileTransfers with wildcards.- Parameters:
wildcards- Use wildcards
-
getDestinationFileAttributes
- Returns:
- File attributes of the destination file (optional)
-
setDestinationFileAttributes
Sets additional file attribtues (optional) of the source file.- Parameters:
destinationFileAttributes- File attributes of the destination file (optional)
-
getSourceFileAttributes
- Returns:
- File attributes of the source file (optional)
-
setSourceFileAttributes
Sets additional file attribtues (optional) of the source file.- Parameters:
sourceFileAttributes- File attributes of the source file (optional)
-
getSourceFile
- Returns:
- Name of the source file(s)
-
setSourceFile
Sets the name of the source file(s), thereby using the directory, folder or ID FileTransfer with wildcard characters. The wildcard characters "*" and "?" may be used to transfer several files. "*" stands for any characters and "?" for exactly one. Fixed parts of the file name and wildcard characters form a filter which may be used to determine the files that are to be transferred. In OS/390, the wildcard character "*" must only be used once.- Parameters:
sourceFile- Name of the source file(s)
-
getDestinationFile
- Returns:
- Destination file name
-
setDestinationFile
Destination of the FileTransfer Specify where the file should be stored, thereby indicating the directory, folder or ID. A file name is also to be specified. It may so be renamed.
FileTransfer with wildcard charactersThe file name specification must include the wildcard character "*" once. The name for the file to be transferred is structured as shown below:
Source file specification with one wildcard character: In the file name, this wildcard character is replaced by the retrieved characters.Examples:
Source specification: UC4*.TXT File corresponding to the filter: UC4_LOGG_01.TXT Destination specification: UC4*.TXT Name of the destination file: UC4_LOGG_01.TXT Source specification: UC4*.TXT File corresponding to the filter: UC4_LOGG_01.TXT Destination specification: TEST*23.TXT Name of the destination file: TEST_LOGG_0123.TXT
Source file specification with several wildcard characters: The wildcard character in the file name is also replaced by the retrieved characters. As the source specification includes several wildcard characters. The FileTransfer uses the string that starts with the first wildcard and ends with the last wildcard character.Example:
Source specification: ?C_SERVER_*_01.TXT File corresponding to the filter: UC_SERVER_LOGG_01.TXT Destination specification: TEST_*_A.TXT Name of the destination file: TEST_UC_SERVER_LOGG_A.TXT
- Parameters:
destinationFile- Name of the destination file
-
getCompression
public int getCompression()Returns an integer containing compression setting.Value Description -1 Default 0 None 1 Normal 2 Strong - Returns:
- Compression level
-
setCompression
public void setCompression(int compress) Sets the compression level.Value Description -1 Default 0 No 1 Yes - Parameters:
compress- Compression level
-
getSourceCodeTable
- Returns:
- CodeTable for all source files
-
setSourceCodeTable
Sets the CodeTable for all source files.- Parameters:
sourceCodeTable- Name of the CodeTable Object
-
getDestinationCodeTable
- Returns:
- CodeTable for all destination files
-
setDestinationCodeTable
Sets the CodeTable for all destination files.- Parameters:
destinationCodeTable- Name of the CodeTable Object
-
getSourceHost
- Returns:
- Name of the Source Agent
-
setSourceHost
Sets the source host.- Parameters:
sourceHost- Name of the source Agent
-
getDestinationHost
- Returns:
- Name of the Destination Agent
-
setDestinationHost
Sets the destination host.- Parameters:
destinationHost- Name of the Destination Agent
-
getSourceLogin
- Returns:
- Name of the Login Object used by the source Agent.
-
setSourceLogin
Sets the name fo the Login Object which should be used by source Agent.- Parameters:
sourceLogin- Name of the Login Objects
-
getDestinationLogin
- Returns:
- Name of the Login Object used by the destination Agent
-
setDestinationLogin
Sets the name fo the Login Object which should be used by source Agent.- Parameters:
destinationLogin- Name of the Login Objects
-
isTransferFolderStructure
public boolean isTransferFolderStructure()- Returns:
Trueif the complete folder structure should be transfered, false otherwise
-
setTransferFolderStructure
public void setTransferFolderStructure(boolean transferCompleteFolderStructure) Set this flag to transfer the complete folder structure with a wildcard transfere. Only available if both platforms support this function and the options "Use wildcards" and "Include sub-directories" are selected.- Parameters:
transferCompleteFolderStructure- True if complete folder structure should be transfered
-