File (Class)
File class
Warning:
Access via file APIs is limited to the var, sftp and temporary folders of Adobe Campaign.
Here is an example of how to use the class to read and process all the lines of a file in sequence.
var file = new File("/tmp/test.txt")
file.open()
for each(var line in file)
logInfo(line)
file.close()
Methods
Creates a new object associated with a file. | |
Closes the file. | |
Copies a file. | |
Frees the resources used by the object. | |
Forces writing on the disk | |
Lists the content of a directory. | |
Creates a directory with the path of the current object. | |
Opens the file in read or write mode. | |
Deletes the file. | |
Renames a file. | |
Reads a line of the text file. | |
Deletes the directory (not in cascade). | |
Writes a line of text to the file. |
Properties
Returns true if the file can be read. | |
Returns true if the file can be modified. | |
Returns true if there is a file or folder with this name. | |
Returns the name of the file in absolute. | |
Returns true if the file is a directory. | |
Returns true if the file exists and is a file. | |
Returns true if the file is open. | |
Returns the last modification date in the form of a Date object. | |
Returns the name of the file with the extension, but without the path. | |
Returns the complete path of the file ended by the separator. | |
Returns the size of the file in bytes. |
Features
Available in:
- Content management
- Delivery properties
- Typology rule
- JSSP
- SOAP Method
- WebApp
- Workflow