public class DDDriverFileCommands
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLOSEFILE_KEYWORD
"CloseFile"
|
static java.lang.String |
COPYFILE_KEYWORD
"CopyFile"
|
static java.lang.String |
COPYMATCHINGFILES_KEYWORD
"CopyMatchingFiles"
|
static java.lang.String |
CREATEDIRECTORY_KEYWORD
"CreateDirectory"
|
static java.lang.String |
CREATEFILE_KEYWORD
"CreateFile"
|
static java.lang.String |
DELETEDIRECTORY_KEYWORD
"DeleteDirectory"
|
static java.lang.String |
DELETEDIRECTORYCONTENTS_KEYWORD
"DeleteDirectoryContents"
|
static java.lang.String |
DELETEFILE_KEYWORD
"DeleteFile"
|
static java.lang.String |
FILTERIMAGE_KEYWORD
"FilterImage"
|
static java.lang.String |
FILTERTEXTFILE_KEYWORD
"FilterTextFile"
|
static java.lang.String |
FINDSQAFILE_KEYWORD
"FindSqaFile"
|
static java.lang.String |
GETFILEDATETIME_KEYWORD
"GetFileDateTime"
|
static java.lang.String |
GETFILEPROTECTIONS_KEYWORD
"GetFileProtections"
|
static java.lang.String |
GETFILES_KEYWORD
"GetFiles"
|
static java.lang.String |
GETFILESIZE_KEYWORD
"GetFileSize"
|
static java.lang.String |
GETINIFILEVALUE_KEYWORD
"GetINIFileValue"
|
static java.lang.String |
GETSTRINGCOUNTINFILE_KEYWORD
"GetStringCountInFile"
|
static java.lang.String |
GETSUBSTRINGSINFILE_KEYWORD
"GetSubstringsInFile"
|
static java.lang.String |
GETTEXTFROMIMAGE_KEYWORD
"GetTextFromImage"
|
static java.lang.String |
IFEXISTDIR_KEYWORD
"IfExistDir"
|
static java.lang.String |
IFEXISTFILE_KEYWORD
"IfExistFile"
|
static java.lang.String |
ISENDOFFILE_KEYWORD
"IsEndOfFile"
|
static java.lang.String |
OPENFILE_KEYWORD
"OpenFile"
|
static java.lang.String |
OPENUTF8FILE_KEYWORD
"OpenUTF8File"
|
static java.lang.String |
PRINTTOFILE_KEYWORD
"PrintToFile"
|
static java.lang.String |
READFILECHARS_KEYWORD
"ReadFileChars"
|
static java.lang.String |
READFILELINE_KEYWORD
"ReadFileLine"
|
static java.lang.String |
READFILESTRING_KEYWORD
"ReadFileString"
|
static java.lang.String |
RENAMEFILE_KEYWORD
"RenameFile"
|
static java.lang.String |
SAVETEXTFROMIMAGE_KEYWORD
"SaveTextFromImage"
|
static java.lang.String |
SETFILEPROTECTIONS_KEYWORD
"SetFileProtections"
|
static java.lang.String |
WRITEFILECHARS_KEYWORD
"WriteFileChars"
|
Modifier and Type | Method and Description |
---|---|
static DriverCommand |
closeFile(java.lang.String fileNumber)
Close the open file with the file number provided
|
static DriverCommand |
copyFile(java.lang.String[] parameters)
Copy the specified filename to the target filename.
|
static DriverCommand |
copyFile(java.lang.String fromFileName,
java.lang.String toFileName)
Copy the specified filename to the target filename.
|
static DriverCommand |
copyMatchingFiles(java.lang.String[] parameters)
Copy multiple files/sub-directories, based on matching the provided pattern, from one directory to another.
|
static DriverCommand |
copyMatchingFiles(java.lang.String fromDirectoryName,
java.lang.String toDirectoryName,
java.lang.String pattern,
java.lang.String filterMode)
Copy multiple files/sub-directories, based on matching the provided pattern, from one directory to another.
|
static DriverCommand |
createDirectory(java.lang.String directoryName)
Create the directory for the provided directory pathname
|
static DriverCommand |
createFile(java.lang.String[] parameters)
Open a new file with the filename, mode and access provided.
|
static DriverCommand |
createFile(java.lang.String fileName,
java.lang.String mode,
java.lang.String access,
java.lang.String fileNumberVariable,
java.lang.String fileNumber)
Open a new file with the filename, mode and access provided.
|
static DriverCommand |
deleteDirectory(java.lang.String directoryName)
Delete the directory for the provided directory pathname
|
static DriverCommand |
deleteDirectoryContents(java.lang.String[] parameters)
Delete the contents (files and sub-directories) of a provided directory and optionally,
the directory itself.
|
static DriverCommand |
deleteDirectoryContents(java.lang.String directoryName,
java.lang.String deleteDir)
Delete the contents (files and sub-directories) of a provided directory and optionally,
the directory itself.
|
static DriverCommand |
deleteFile(java.lang.String[] parameters)
Delete the file for the file name provided
|
static DriverCommand |
deleteFile(java.lang.String fileName,
java.lang.String noVerify)
Delete the file for the file name provided
|
static DriverCommand |
filterImage(java.lang.String[] parameters)
Filter out specific parts of an image.
|
static DriverCommand |
filterImage(java.lang.String inputFilename,
java.lang.String outputFilename,
java.lang.String filterMode,
java.lang.String coords)
Filter out specific parts of an image.
|
static DriverCommand |
filterTextFile(java.lang.String[] parameters)
Filter a text file based on the given parameters.
|
static DriverCommand |
filterTextFile(java.lang.String file,
java.lang.String filterMode,
java.lang.String filterOptions,
java.lang.String encoding)
Filter a text file based on the given parameters.
|
static DriverCommand |
findSqaFile(java.lang.String[] parameters)
Find the file for the SQA relative path and file name provided.
|
static DriverCommand |
findSqaFile(java.lang.String fileName,
java.lang.String filePathVariable)
Find the file for the SQA relative path and file name provided.
|
static DriverCommand |
getFileDateTime(java.lang.String[] parameters)
Determine the date and time the file created/last changed/last accessed for file name provided and assign it to a DDV variable.
|
static DriverCommand |
getFileDateTime(java.lang.String fileName,
java.lang.String fileDateVariable,
java.lang.String getMilitaryTime,
java.lang.String dateTimeType)
Determine the date and time the file created/last changed/last accessed for file name provided and assign it to a DDV variable.
|
static DriverCommand |
getFileProtections(java.lang.String[] parameters)
Save the file attributes for the file name to the variable provided.
|
static DriverCommand |
getFileProtections(java.lang.String fileName,
java.lang.String varName)
Save the file attributes for the file name to the variable provided.
|
static DriverCommand |
getFiles(java.lang.String[] parameters)
Search the directory provided for files according to possible attribute and write the list of filenames found into the output file.
|
static DriverCommand |
getFiles(java.lang.String directory,
java.lang.String fileName,
java.lang.String fileAttributes)
Search the directory provided for files according to possible attribute and write the list of filenames found into the output file.
|
static DriverCommand |
getFileSize(java.lang.String[] parameters)
Determine the file size for file name provided and assign it to a DDV variable.
|
static DriverCommand |
getFileSize(java.lang.String fileName,
java.lang.String fileSizeVariable)
Determine the file size for file name provided and assign it to a DDV variable.
|
static DriverCommand |
getINIFileValue(java.lang.String[] parameters)
Get value from INI file.
|
static DriverCommand |
getINIFileValue(java.lang.String fileName,
java.lang.String section,
java.lang.String item,
java.lang.String variable)
Get value from INI file.
|
static DDDriverFileCommands |
getInstance()
public Singleton to access class static methods via instance
|
static DriverCommand |
getStringCountInFile(java.lang.String[] parameters)
Count the number of occurrences of a target string in a File.
|
static DriverCommand |
getStringCountInFile(java.lang.String file,
java.lang.String string,
java.lang.String varName,
java.lang.String caseSensitive,
java.lang.String encoding)
Count the number of occurrences of a target string in a File.
|
static DriverCommand |
getSubstringsInFile(java.lang.String[] parameters)
Extract dynamic substrings from a file using regular expressions.
|
static DriverCommand |
getSubstringsInFile(java.lang.String file,
java.lang.String regexstart,
java.lang.String regexstop,
java.lang.String rootname)
Extract dynamic substrings from a file using regular expressions.
|
static DriverCommand |
getTextFromImage(java.lang.String[] parameters)
Incorporate OCR technology to detect the text in an image file and save the text to a variable.
|
static DriverCommand |
getTextFromImage(java.lang.String imageFile,
java.lang.String variableName,
java.lang.String oCRId,
java.lang.String langId,
java.lang.String scaleRatio)
Incorporate OCR technology to detect the text in an image file and save the text to a variable.
|
static DriverCommand |
ifExistDir(java.lang.String[] parameters)
If the specified directory exists, then execute the following driver command.
|
static DriverCommand |
ifExistDir(java.lang.String directoryName,
java.lang.String thenDriverCommand)
If the specified directory exists, then execute the following driver command.
|
static DriverCommand |
ifExistFile(java.lang.String[] parameters)
If the specified file exists, then execute the following driver command.
|
static DriverCommand |
ifExistFile(java.lang.String fileName,
java.lang.String thenDriverCommand)
If the specified file exists, then execute the following driver command.
|
static DriverCommand |
isEndOfFile(java.lang.String[] parameters)
If the specified file is at the end of file, a 'variable' gets true assigned, otherwise it gets false
|
static DriverCommand |
isEndOfFile(java.lang.String fileNumber,
java.lang.String variable)
If the specified file is at the end of file, a 'variable' gets true assigned, otherwise it gets false
|
static DriverCommand |
openFile(java.lang.String[] parameters)
Open an existing file with the filename, mode and access provided.
|
static DriverCommand |
openFile(java.lang.String fileName,
java.lang.String mode,
java.lang.String access,
java.lang.String fileNumberVariable,
java.lang.String fileNumber)
Open an existing file with the filename, mode and access provided.
|
static DriverCommand |
openUTF8File(java.lang.String[] parameters)
Open an existing UTF-8 file with the filename, mode and access provided.
|
static DriverCommand |
openUTF8File(java.lang.String fileName,
java.lang.String mode,
java.lang.String access,
java.lang.String fileNumberVariable,
java.lang.String fileNumber)
Open an existing UTF-8 file with the filename, mode and access provided.
|
static DriverCommand |
printToFile(java.lang.String[] parameters)
Write output to a sequential file already opened for writing.
|
static DriverCommand |
printToFile(java.lang.String fileNumber,
java.lang.String expressionListVariable,
java.lang.String printOutputPlacement)
Write output to a sequential file already opened for writing.
|
static DriverCommand |
readFileChars(java.lang.String[] parameters)
Read the number of characters from the file defined by file number
and assign a string containing the characters read to a DDV variable.
|
static DriverCommand |
readFileChars(java.lang.String fileNumber,
java.lang.String numberOfChar,
java.lang.String variableName)
Read the number of characters from the file defined by file number
and assign a string containing the characters read to a DDV variable.
|
static DriverCommand |
readFileLine(java.lang.String[] parameters)
Read a line from the file defined by file number and assign a string containing the line read to a DDV variable.
|
static DriverCommand |
readFileLine(java.lang.String fileNumber,
java.lang.String variableName)
Read a line from the file defined by file number and assign a string containing the line read to a DDV variable.
|
static DriverCommand |
readFileString(java.lang.String[] parameters)
Read a comma-separated value from a file and store it in a DDVariable.
|
static DriverCommand |
readFileString(java.lang.String fileNumber,
java.lang.String variableName)
Read a comma-separated value from a file and store it in a DDVariable.
|
static DriverCommand |
renameFile(java.lang.String[] parameters)
Rename the file from the old file name to the new filename
|
static DriverCommand |
renameFile(java.lang.String oldFileName,
java.lang.String newFileName,
java.lang.String noVerify)
Rename the file from the old file name to the new filename
|
static DriverCommand |
saveTextFromImage(java.lang.String[] parameters)
Incorporate OCR technology to detect the text in an image file and save the text to a text file.
|
static DriverCommand |
saveTextFromImage(java.lang.String imageFile,
java.lang.String outputFile,
java.lang.String oCRId,
java.lang.String langId,
java.lang.String scaleRatio)
Incorporate OCR technology to detect the text in an image file and save the text to a text file.
|
static DriverCommand |
setFileProtections(java.lang.String[] parameters)
Change the file attribute for the file name provided to the value of the new file protection provided.
|
static DriverCommand |
setFileProtections(java.lang.String fileName,
java.lang.String fileProtection)
Change the file attribute for the file name provided to the value of the new file protection provided.
|
static DriverCommand |
writeFileChars(java.lang.String[] parameters)
Write the specified number of characters to a file already opened for writing.
|
static DriverCommand |
writeFileChars(java.lang.String fileNumber,
java.lang.String numberOfChars,
java.lang.String expressionList)
Write the specified number of characters to a file already opened for writing.
|
public static final java.lang.String CLOSEFILE_KEYWORD
public static final java.lang.String COPYFILE_KEYWORD
public static final java.lang.String COPYMATCHINGFILES_KEYWORD
public static final java.lang.String CREATEDIRECTORY_KEYWORD
public static final java.lang.String CREATEFILE_KEYWORD
public static final java.lang.String DELETEDIRECTORY_KEYWORD
public static final java.lang.String DELETEDIRECTORYCONTENTS_KEYWORD
public static final java.lang.String DELETEFILE_KEYWORD
public static final java.lang.String FILTERIMAGE_KEYWORD
public static final java.lang.String FILTERTEXTFILE_KEYWORD
public static final java.lang.String FINDSQAFILE_KEYWORD
public static final java.lang.String GETFILEDATETIME_KEYWORD
public static final java.lang.String GETFILEPROTECTIONS_KEYWORD
public static final java.lang.String GETFILES_KEYWORD
public static final java.lang.String GETFILESIZE_KEYWORD
public static final java.lang.String GETINIFILEVALUE_KEYWORD
public static final java.lang.String GETSTRINGCOUNTINFILE_KEYWORD
public static final java.lang.String GETSUBSTRINGSINFILE_KEYWORD
public static final java.lang.String GETTEXTFROMIMAGE_KEYWORD
public static final java.lang.String IFEXISTDIR_KEYWORD
public static final java.lang.String IFEXISTFILE_KEYWORD
public static final java.lang.String ISENDOFFILE_KEYWORD
public static final java.lang.String OPENFILE_KEYWORD
public static final java.lang.String OPENUTF8FILE_KEYWORD
public static final java.lang.String PRINTTOFILE_KEYWORD
public static final java.lang.String READFILECHARS_KEYWORD
public static final java.lang.String READFILELINE_KEYWORD
public static final java.lang.String READFILESTRING_KEYWORD
public static final java.lang.String RENAMEFILE_KEYWORD
public static final java.lang.String SAVETEXTFROMIMAGE_KEYWORD
public static final java.lang.String SETFILEPROTECTIONS_KEYWORD
public static final java.lang.String WRITEFILECHARS_KEYWORD
public static DDDriverFileCommands getInstance()
public static DriverCommand closeFile(java.lang.String fileNumber)
Close the open file with the file number providedSupporting Engines:
fileNumber
- Optional:NO
The file number for the file to be closed.public static DriverCommand copyFile(java.lang.String fromFileName, java.lang.String toFileName)
Copy the specified filename to the target filename. For the Java-based engines--RJ, TID, and SDC: If the filenames provided are not full absolute paths then we will attempt to deduce a full Project-relative or Datapool\Test-relative path from the relative path provided. If the relative path already contains path separators (ex: "\subpath\filename.ext") then we attempt to deduce a fullpath relative to the SAFS Project. If no path separators exist (ex: "filename.txt") then we attempt to deduce a fullpath relative to the project's Datapool\Test directory. We do not actually attempt to see if the directories or files exists before executing the command.Supporting Engines:
fromFileName
- Optional:NO
The file path and file name for the file to be copied.toFileName
- Optional:NO
The file path and file name to copy the file to.public static DriverCommand copyFile(java.lang.String[] parameters)
Copy the specified filename to the target filename. For the Java-based engines--RJ, TID, and SDC: If the filenames provided are not full absolute paths then we will attempt to deduce a full Project-relative or Datapool\Test-relative path from the relative path provided. If the relative path already contains path separators (ex: "\subpath\filename.ext") then we attempt to deduce a fullpath relative to the SAFS Project. If no path separators exist (ex: "filename.txt") then we attempt to deduce a fullpath relative to the project's Datapool\Test directory. We do not actually attempt to see if the directories or files exists before executing the command.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand copyMatchingFiles(java.lang.String fromDirectoryName, java.lang.String toDirectoryName, java.lang.String pattern, java.lang.String filterMode)
Copy multiple files/sub-directories, based on matching the provided pattern, from one directory to another. Note: This is a very powerful DriverCommand, please use with caution!Supporting Engines:
fromDirectoryName
- Optional:NO
The directory name where the files are located.toDirectoryName
- Optional:NO
The directory name where the files are copied.pattern
- Optional:NO
The pattern used to distinguish the files/sub-directories to be copied.filterMode
- Optional:YES
The filter mode used for matching the files/sub-directories to be copied.
Default is WILDCARD.public static DriverCommand copyMatchingFiles(java.lang.String[] parameters)
Copy multiple files/sub-directories, based on matching the provided pattern, from one directory to another. Note: This is a very powerful DriverCommand, please use with caution!Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand createDirectory(java.lang.String directoryName)
Create the directory for the provided directory pathnameSupporting Engines:
directoryName
- Optional:NO
The full directory path name for the directory to be created.public static DriverCommand createFile(java.lang.String fileName, java.lang.String mode, java.lang.String access, java.lang.String fileNumberVariable, java.lang.String fileNumber)
Open a new file with the filename, mode and access provided. TID Note: Three ways to create a file: Mode=Input, Access=Read Mode=Output, Access=Write Mode=Append, Access=WriteSupporting Engines:
fileName
- Optional:NO
The full path file name of the file to be opened.mode
- Optional:NO
Mode to be used to create and open the file, Input, Output or Append. Random and Binary not supportedaccess
- Optional:NO
Access to be used to create and open the file. Read, Write or Read Write.fileNumberVariable
- Optional:NO
DDE Variable name of the variable to store the file number.fileNumber
- Optional:Yes
Optional File number to be used to open the file Otherwise next available file number is usedpublic static DriverCommand createFile(java.lang.String[] parameters)
Open a new file with the filename, mode and access provided. TID Note: Three ways to create a file: Mode=Input, Access=Read Mode=Output, Access=Write Mode=Append, Access=WriteSupporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand deleteDirectory(java.lang.String directoryName)
Delete the directory for the provided directory pathnameSupporting Engines:
directoryName
- Optional:NO
The full directory path name for the directory to be deleted.public static DriverCommand deleteDirectoryContents(java.lang.String directoryName, java.lang.String deleteDir)
Delete the contents (files and sub-directories) of a provided directory and optionally, the directory itself. Note: This is a very powerful DriverCommand, please use with caution!Supporting Engines:
directoryName
- Optional:NO
The directory name in which the contents will be deleted.deleteDir
- Optional:YES
Indicate whether you want to also delete the directory with true or false. Default is false.public static DriverCommand deleteDirectoryContents(java.lang.String[] parameters)
Delete the contents (files and sub-directories) of a provided directory and optionally, the directory itself. Note: This is a very powerful DriverCommand, please use with caution!Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand deleteFile(java.lang.String fileName, java.lang.String noVerify)
Delete the file for the file name providedSupporting Engines:
fileName
- Optional:NO
The file name for the file to be deleted. Normally, the full file path is specified.
If a relative path is specified, it is relative to the project directory.noVerify
- Optional:Yes
String Equal to "NOVERIFY" if file is not verified prior to deleting.public static DriverCommand deleteFile(java.lang.String[] parameters)
Delete the file for the file name providedSupporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand filterImage(java.lang.String inputFilename, java.lang.String outputFilename, java.lang.String filterMode, java.lang.String coords)
Filter out specific parts of an image. Filter out specific parts of an image and save to a new or existing image file. The filtered portions of the image are blacked out so as to remove dynamic visible content from the image. The available formats for the input and output files are BITMAP (*.bmp) and JPEG (*.jpg). Specific Notes: This command requires that Java Advanced Imaging (JAI) be installed on the test machine.Supporting Engines:
inputFilename
- Optional:NO
The input image file (FULL PATH)outputFilename
- Optional:NO
The output image file after filtering (FULL PATH)filterMode
- Optional:NO
Mode by which the image is filteredcoords
- Optional:NO
Required parameter for the COORD FilterMode that defines the rectangle(s) of the input image that are to be filtered out.public static DriverCommand filterImage(java.lang.String[] parameters)
Filter out specific parts of an image. Filter out specific parts of an image and save to a new or existing image file. The filtered portions of the image are blacked out so as to remove dynamic visible content from the image. The available formats for the input and output files are BITMAP (*.bmp) and JPEG (*.jpg). Specific Notes: This command requires that Java Advanced Imaging (JAI) be installed on the test machine.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand filterTextFile(java.lang.String file, java.lang.String filterMode, java.lang.String filterOptions, java.lang.String encoding)
Filter a text file based on the given parameters. Filter a text file based on the given parameters. This command can be used to process a text file based on the provided parameters, such as replacing text in a file that matches a specific pattern. This command is experimental. command name/parameters are subject to change without notice.Supporting Engines:
file
- Optional:NO
The file to be filtered.filterMode
- Optional:NO
The filter mode.filterOptions
- Optional:YES
Additional filter options.encoding
- Optional:YES
The encoding to use to read and write file.public static DriverCommand filterTextFile(java.lang.String[] parameters)
Filter a text file based on the given parameters. Filter a text file based on the given parameters. This command can be used to process a text file based on the provided parameters, such as replacing text in a file that matches a specific pattern. This command is experimental. command name/parameters are subject to change without notice.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand findSqaFile(java.lang.String fileName, java.lang.String filePathVariable)
Find the file for the SQA relative path and file name provided. If a full file path is provided the file will be located using the full file path and name.Supporting Engines:
fileName
- Optional:NO
The file path and file name of the file to be found.filePathVariable
- Optional:NO
Name of the DDV variable to be used to store the full file path of the found file. If file not found blank string is assigned to variablepublic static DriverCommand findSqaFile(java.lang.String[] parameters)
Find the file for the SQA relative path and file name provided. If a full file path is provided the file will be located using the full file path and name.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand getFileDateTime(java.lang.String fileName, java.lang.String fileDateVariable, java.lang.String getMilitaryTime, java.lang.String dateTimeType)
Determine the date and time the file created/last changed/last accessed for file name provided and assign it to a DDV variable. Determine the date and time the file created/last changed/last accessed for file name provided and assign it to a DDV variable. This date is in the format MM-DD-YYYY HH:MM:SS, it is in AM-PM 12-hours format (1-12) be default; If you set the third parameter 'GetMilitaryTime' to True, the time will be 24-hours military format (0-23). Use military time is recommanded, as am-pm time has confusion without AM or PM (example: 18:00 and 06:00 will be both 06:00) You can get different date and time by providing a different value to the fourth optional parameter DateTimeType.Supporting Engines:
fileName
- Optional:NO
The file path and file name of the file to get the file date and time.fileDateVariable
- Optional:NO
Name of the DDV variable to be used to store the file date and timegetMilitaryTime
- Optional:YES
If true, the converted time is in 24-hours military time formatdateTimeType
- Optional:YES
You can get different date and time by providing a different value.public static DriverCommand getFileDateTime(java.lang.String[] parameters)
Determine the date and time the file created/last changed/last accessed for file name provided and assign it to a DDV variable. Determine the date and time the file created/last changed/last accessed for file name provided and assign it to a DDV variable. This date is in the format MM-DD-YYYY HH:MM:SS, it is in AM-PM 12-hours format (1-12) be default; If you set the third parameter 'GetMilitaryTime' to True, the time will be 24-hours military format (0-23). Use military time is recommanded, as am-pm time has confusion without AM or PM (example: 18:00 and 06:00 will be both 06:00) You can get different date and time by providing a different value to the fourth optional parameter DateTimeType.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand getFileProtections(java.lang.String fileName, java.lang.String varName)
Save the file attributes for the file name to the variable provided. Save the file attributes for the file name to the variable provided. The variable will be an integer containing the attributes for the file, it may be any combination of them. Here is a description of attributes: 0 - Normal file 1 - Read Only file 2 - Hidden file 4 - System file (Windows OS Only) 16 - Directory 32 - Archive file (Windows OS: attrib with 'A'; Other OS: file suffix is .jar, .tar, .rar, .gz etc.)Supporting Engines:
fileName
- Optional:NO
The file path and file name of the file to get the file attribute.varName
- Optional:NO
variable name to place the attributes inpublic static DriverCommand getFileProtections(java.lang.String[] parameters)
Save the file attributes for the file name to the variable provided. Save the file attributes for the file name to the variable provided. The variable will be an integer containing the attributes for the file, it may be any combination of them. Here is a description of attributes: 0 - Normal file 1 - Read Only file 2 - Hidden file 4 - System file (Windows OS Only) 16 - Directory 32 - Archive file (Windows OS: attrib with 'A'; Other OS: file suffix is .jar, .tar, .rar, .gz etc.)Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand getFiles(java.lang.String directory, java.lang.String fileName, java.lang.String fileAttributes)
Search the directory provided for files according to possible attribute and write the list of filenames found into the output file.Supporting Engines:
directory
- Optional:NO
The full name of the directory to be searched for files.fileName
- Optional:NO
Full file path and name of the file to store list of files found in the directoryfileAttributes
- Optional:YES
Optional File Attributes parameter specifying file attributes to select with Dir directory
search command. Default if unspecified is normal files. It may be any combination of them.public static DriverCommand getFiles(java.lang.String[] parameters)
Search the directory provided for files according to possible attribute and write the list of filenames found into the output file.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand getFileSize(java.lang.String fileName, java.lang.String fileSizeVariable)
Determine the file size for file name provided and assign it to a DDV variable.Supporting Engines:
fileName
- Optional:NO
The file path and file name of the file to get file size.fileSizeVariable
- Optional:NO
Name of the DDV variable to be used to store the file size of the file.public static DriverCommand getFileSize(java.lang.String[] parameters)
Determine the file size for file name provided and assign it to a DDV variable.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand getINIFileValue(java.lang.String fileName, java.lang.String section, java.lang.String item, java.lang.String variable)
Get value from INI file.Supporting Engines:
fileName
- Optional:NO
The name of the file.section
- Optional:NO
The Section of the file to look in.item
- Optional:NO
The item to look for.variable
- Optional:NO
Name of the DDV variable to be used to store the file date and timepublic static DriverCommand getINIFileValue(java.lang.String[] parameters)
Get value from INI file.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand getStringCountInFile(java.lang.String file, java.lang.String string, java.lang.String varName, java.lang.String caseSensitive, java.lang.String encoding)
Count the number of occurrences of a target string in a File. This command opens and reads a file line by line, then sets a specified DDVariable to the number of times the target string is found in the file. String comparisons are case-sensitive by default. The file is assumed to be in the system default encoding unless specified otherwise.Supporting Engines:
file
- Optional:NO
The File to be searched.string
- Optional:NO
The string to match and count in the file.varName
- Optional:YES DefaultVal:GetStringCountInFile
The name of the variable to receive the count.caseSensitive
- Optional:YES
Set to 'CaseInsensitive' so comparisons are NOT case-sensitive.encoding
- Optional:YES
Charset encoding string like "UTF-8", etc...public static DriverCommand getStringCountInFile(java.lang.String[] parameters)
Count the number of occurrences of a target string in a File. This command opens and reads a file line by line, then sets a specified DDVariable to the number of times the target string is found in the file. String comparisons are case-sensitive by default. The file is assumed to be in the system default encoding unless specified otherwise.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand getSubstringsInFile(java.lang.String file, java.lang.String regexstart, java.lang.String regexstop, java.lang.String rootname)
Extract dynamic substrings from a file using regular expressions. This command opens the file, reads it line by line, and sets DDVariables (based on rootname) for each occurrence of string identified by the substring formed between regexstart and regexstop (1 match per line, currently). regexstart and regexstop must both be valid, non-empty strings or no matching substrings will be found. Fully qualified filename is opened and read line by line. Each line is parsed, searching for a match to the substring formed between regexstart and regexstop. When a match is found, the string between regexstart and regexstop is saved in a newly created DDVariable based on rootname and the number of occurrences. There will be one DDVariable for each match found and a unique "Count" variable specifying how many matches were found. The rootname is used as a base to build the DDVariable names which contain the located substring(s) and Count. For example, if rootname is "Chart" and two substring matches are found, then 2 DDVariables are created to store those substrings and another is created to store the count of matches: DDVariable Chart1 contains the first substring, and DDVariable Chart2 contains the second substring. DDVariable ChartCount contains the number of matches found.Supporting Engines:
file
- Optional:NO
Fully-qualified filenameregexstart
- Optional:NO
The starting regular expression. Should not be empty.regexstop
- Optional:NO
The stopping regular expression. Should not be empty.rootname
- Optional:NO
The root name of the returned variable(s).public static DriverCommand getSubstringsInFile(java.lang.String[] parameters)
Extract dynamic substrings from a file using regular expressions. This command opens the file, reads it line by line, and sets DDVariables (based on rootname) for each occurrence of string identified by the substring formed between regexstart and regexstop (1 match per line, currently). regexstart and regexstop must both be valid, non-empty strings or no matching substrings will be found. Fully qualified filename is opened and read line by line. Each line is parsed, searching for a match to the substring formed between regexstart and regexstop. When a match is found, the string between regexstart and regexstop is saved in a newly created DDVariable based on rootname and the number of occurrences. There will be one DDVariable for each match found and a unique "Count" variable specifying how many matches were found. The rootname is used as a base to build the DDVariable names which contain the located substring(s) and Count. For example, if rootname is "Chart" and two substring matches are found, then 2 DDVariables are created to store those substrings and another is created to store the count of matches: DDVariable Chart1 contains the first substring, and DDVariable Chart2 contains the second substring. DDVariable ChartCount contains the number of matches found.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand getTextFromImage(java.lang.String imageFile, java.lang.String variableName, java.lang.String oCRId, java.lang.String langId, java.lang.String scaleRatio)
Incorporate OCR technology to detect the text in an image file and save the text to a variable. Two open-source OCRs are integrated into SAFS. One is TesseractOCR (TOCR) at http://code.google.com/p/tesseract-ocr; the other GOCR at http://jocr.sourceforge.net. TOCR 2.0.4 and GOCR 0.48 are the latest release. They are available in SAFS and only support English. Both two OCR owners claim to support more languages in next release. Chinese, Japanese, and Korean are going to be supported in TOCR's next release 3.00.Supporting Engines:
imageFile
- Optional:NO
The name of the image file used to detect text in it.variableName
- Optional:NO
The name of the variable to receive detected text.oCRId
- Optional:YES
OCRId indicating the OCR used to recognize text.langId
- Optional:YES
Optional LangId representing the language in use for selected OCR to recognize text.scaleRatio
- Optional:YES
Optional ScaleRatio indicating the scale ratio for resizing the original image.public static DriverCommand getTextFromImage(java.lang.String[] parameters)
Incorporate OCR technology to detect the text in an image file and save the text to a variable. Two open-source OCRs are integrated into SAFS. One is TesseractOCR (TOCR) at http://code.google.com/p/tesseract-ocr; the other GOCR at http://jocr.sourceforge.net. TOCR 2.0.4 and GOCR 0.48 are the latest release. They are available in SAFS and only support English. Both two OCR owners claim to support more languages in next release. Chinese, Japanese, and Korean are going to be supported in TOCR's next release 3.00.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand ifExistDir(java.lang.String directoryName, java.lang.String thenDriverCommand)
If the specified directory exists, then execute the following driver command.Supporting Engines:
directoryName
- Optional:NO
The full path name of directory to test forthenDriverCommand
- Optional:NO
Actually, the rest of the parameters include this, which is the driver command to execute if the directory exists, followed by the remaining driver parameters for that commandpublic static DriverCommand ifExistDir(java.lang.String[] parameters)
If the specified directory exists, then execute the following driver command.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand ifExistFile(java.lang.String fileName, java.lang.String thenDriverCommand)
If the specified file exists, then execute the following driver command.Supporting Engines:
fileName
- Optional:NO
The full path name of file to test forthenDriverCommand
- Optional:NO
Actually, the rest of the parameters include this, which is the driver command to execute if the file exists, followed by the remaining driver parameters for that commandpublic static DriverCommand ifExistFile(java.lang.String[] parameters)
If the specified file exists, then execute the following driver command.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand isEndOfFile(java.lang.String fileNumber, java.lang.String variable)
If the specified file is at the end of file, a 'variable' gets true assigned, otherwise it gets falseSupporting Engines:
fileNumber
- Optional:NO
The file number for the file to be closed.variable
- Optional:NO
Variable to assign true or falsepublic static DriverCommand isEndOfFile(java.lang.String[] parameters)
If the specified file is at the end of file, a 'variable' gets true assigned, otherwise it gets falseSupporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand openFile(java.lang.String fileName, java.lang.String mode, java.lang.String access, java.lang.String fileNumberVariable, java.lang.String fileNumber)
Open an existing file with the filename, mode and access provided. TID Note: Multiple ways to open a file: Mode=Input, Access=Read Mode=Output, Access=Write Mode=Append, Access=Write Mode=AppendRaw, Access=WriteSupporting Engines:
fileName
- Optional:NO
The full path file name of the file to be opened.mode
- Optional:NOMode to be used to open the file, Input, Output, Append, and AppendRaw.access
- Optional:NO
Access to be used to open the file. Read, Write or Read Write.fileNumberVariable
- Optional:NO
DDE Variable name of the variable to store the file number.fileNumber
- Optional:Yes
Optional File number to be used to open the file Otherwise next available file number is usedpublic static DriverCommand openFile(java.lang.String[] parameters)
Open an existing file with the filename, mode and access provided. TID Note: Multiple ways to open a file: Mode=Input, Access=Read Mode=Output, Access=Write Mode=Append, Access=Write Mode=AppendRaw, Access=WriteSupporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand openUTF8File(java.lang.String fileName, java.lang.String mode, java.lang.String access, java.lang.String fileNumberVariable, java.lang.String fileNumber)
Open an existing UTF-8 file with the filename, mode and access provided. TID Note: Multiple ways to open a file: Mode=Input, Access=Read Mode=Output, Access=Write Mode=Append, Access=Write Mode=AppendRaw, Access=WriteSupporting Engines:
fileName
- Optional:NO
The full path file name of the UTF-8 file to be opened.mode
- Optional:NOMode to be used to open the file, Input, Output, Append, and AppendRaw.access
- Optional:NO
Access to be used to open the UTF-8 file. Read, Write or Read Write.fileNumberVariable
- Optional:NO
DDE Variable name of the variable to store the file number.fileNumber
- Optional:Yes
Optional File number to be used to open the UTF-8 file,
otherwise, next available file number is used.public static DriverCommand openUTF8File(java.lang.String[] parameters)
Open an existing UTF-8 file with the filename, mode and access provided. TID Note: Multiple ways to open a file: Mode=Input, Access=Read Mode=Output, Access=Write Mode=Append, Access=Write Mode=AppendRaw, Access=WriteSupporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand printToFile(java.lang.String fileNumber, java.lang.String expressionListVariable, java.lang.String printOutputPlacement)
Write output to a sequential file already opened for writing.Supporting Engines:
fileNumber
- Optional:NO
The file number of the file to be written to.expressionListVariable
- Optional:NO
DDV variable name of the variable that contains the "Expression List"; NOTE: for RobotJ it is the Expression List, if it begins with ^ then it is treated as a variable.printOutputPlacement
- Optional:YES
Print Output Placement Parameter determines where the next output to the same file should begin
; will place the output immediately following this print output
, will start output at the next print zone on the same line
Absence of this parameter (Default) will place the next output at the beginning of a new line following a carriage return line feed.public static DriverCommand printToFile(java.lang.String[] parameters)
Write output to a sequential file already opened for writing.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand readFileChars(java.lang.String fileNumber, java.lang.String numberOfChar, java.lang.String variableName)
Read the number of characters from the file defined by file number and assign a string containing the characters read to a DDV variable.Supporting Engines:
fileNumber
- Optional:NO
The file number of the file to be read from.numberOfChar
- Optional:NO
Number of characters to be read from the file
If the number is -1, then the whole content will be read .variableName
- Optional:NO
Name of the DDV variable in which to store the characters read from the filepublic static DriverCommand readFileChars(java.lang.String[] parameters)
Read the number of characters from the file defined by file number and assign a string containing the characters read to a DDV variable.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand readFileLine(java.lang.String fileNumber, java.lang.String variableName)
Read a line from the file defined by file number and assign a string containing the line read to a DDV variable.Supporting Engines:
fileNumber
- Optional:NO
The file number of the file to be read from.variableName
- Optional:NO
Name of the DDV variable in which to store the line read from the filepublic static DriverCommand readFileLine(java.lang.String[] parameters)
Read a line from the file defined by file number and assign a string containing the line read to a DDV variable.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand readFileString(java.lang.String fileNumber, java.lang.String variableName)
Read a comma-separated value from a file and store it in a DDVariable. This command provides old Basic 'Input' style handling of file data. It expects that the file contains comma-separated values and only a single value is read from the specified file for each call.Supporting Engines:
fileNumber
- Optional:NO
The file number of the file to be read from.variableName
- Optional:NO
Name of the DDVariable in which to store the value read from the file.public static DriverCommand readFileString(java.lang.String[] parameters)
Read a comma-separated value from a file and store it in a DDVariable. This command provides old Basic 'Input' style handling of file data. It expects that the file contains comma-separated values and only a single value is read from the specified file for each call.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand renameFile(java.lang.String oldFileName, java.lang.String newFileName, java.lang.String noVerify)
Rename the file from the old file name to the new filenameSupporting Engines:
oldFileName
- Optional:NO
The file path and file name of the file to be renamed.newFileName
- Optional:NO
The new file path and file name of the file.noVerify
- Optional:Yes
String Equal to "NOVERIFY" if file is not verified prior to renaming.public static DriverCommand renameFile(java.lang.String[] parameters)
Rename the file from the old file name to the new filenameSupporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand saveTextFromImage(java.lang.String imageFile, java.lang.String outputFile, java.lang.String oCRId, java.lang.String langId, java.lang.String scaleRatio)
Incorporate OCR technology to detect the text in an image file and save the text to a text file. Two open-source OCRs are integrated into SAFS. One is TesseractOCR (TOCR) at http://code.google.com/p/tesseract-ocr; the other GOCR at http://jocr.sourceforge.net. TOCR 2.0.4 and GOCR 0.48 are the latest release. They are available in SAFS and only support English. Both two OCR owners claim to support more languages in next release. Chinese, Japanese, and Korean are going to be supported in TOCR's next release 3.00.Supporting Engines:
imageFile
- Optional:NO
The name of the image file used to detect text in it.outputFile
- Optional:NO
The name of the text file used to store detected text.oCRId
- Optional:YES
OCRId indicating the OCR used to recognize text.langId
- Optional:YES
Optional LangId representing the language in use for selected OCR to recognize text.scaleRatio
- Optional:YES
Optional ScaleRatio indicating the scale ratio for resizing the original image.public static DriverCommand saveTextFromImage(java.lang.String[] parameters)
Incorporate OCR technology to detect the text in an image file and save the text to a text file. Two open-source OCRs are integrated into SAFS. One is TesseractOCR (TOCR) at http://code.google.com/p/tesseract-ocr; the other GOCR at http://jocr.sourceforge.net. TOCR 2.0.4 and GOCR 0.48 are the latest release. They are available in SAFS and only support English. Both two OCR owners claim to support more languages in next release. Chinese, Japanese, and Korean are going to be supported in TOCR's next release 3.00.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand setFileProtections(java.lang.String fileName, java.lang.String fileProtection)
Change the file attribute for the file name provided to the value of the new file protection provided. Change the file attribute for the file name provided to the value of the new file protection provided. An integer containing the new attributes for the file. Here is a description of attributes that can be modified: 0 Normal file (Windows PC Only) 1 Read-only file 2 Hidden file (Windows PC Only) 4 System file (Windows PC Only) 32 Archive - file has changed since last backup (Windows PC Only) Note: Java-based support like RJ, TID, SDC currently only support setting one file protection at a time--0, 1, 2, 3, 32. They do not yet support Integer values OR'd together to combine settings in a single call. Note: On platforms other than windows we currently only support setting the READ-ONLY attribute.Supporting Engines:
fileName
- Optional:NO
The file path and file name of the file change the file attribute.fileProtection
- Optional:NO
New value of the attribute of the file to be changedpublic static DriverCommand setFileProtections(java.lang.String[] parameters)
Change the file attribute for the file name provided to the value of the new file protection provided. Change the file attribute for the file name provided to the value of the new file protection provided. An integer containing the new attributes for the file. Here is a description of attributes that can be modified: 0 Normal file (Windows PC Only) 1 Read-only file 2 Hidden file (Windows PC Only) 4 System file (Windows PC Only) 32 Archive - file has changed since last backup (Windows PC Only) Note: Java-based support like RJ, TID, SDC currently only support setting one file protection at a time--0, 1, 2, 3, 32. They do not yet support Integer values OR'd together to combine settings in a single call. Note: On platforms other than windows we currently only support setting the READ-ONLY attribute.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
public static DriverCommand writeFileChars(java.lang.String fileNumber, java.lang.String numberOfChars, java.lang.String expressionList)
Write the specified number of characters to a file already opened for writing.Supporting Engines:
fileNumber
- Optional:NO
The file number/identifier of the file to be written to.numberOfChars
- Optional:NO
The number of characters to write to the file; however, if this parameter is equal to 'all' then all of the characters from the expression list are written.expressionList
- Optional:NO
Expression List, if it begins with ^ then it is treated as a variable.public static DriverCommand writeFileChars(java.lang.String[] parameters)
Write the specified number of characters to a file already opened for writing.Supporting Engines:
parameters
- Optional:NO
An array containing the following parameters:
Copyright © SAS Institute. All Rights Reserved.