OpenWGA 7.10 - TMLScript reference

WGA
Object:

WGA.TempFile(filename)

Description

Creates a TempFile object

This object is available since version 7.7.2

Retrieval WGA.TempFile(filename)
Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events
Inherits from object WGA.File()
Properties and methods
Name Purpose
addToDownloads() Adds the file to the temporary download area for this http session and returns the download-URL
append(text, [encoding]) inherited Appends the content to the referenced file.
asString([encoding]) inherited Returns the content of the referenced file as String
asXMLDocument([encoding]) inherited Returns the content of the referenced file as DOM4J XML document.
cleanDir() inherited Remove all files and subdirectories but does not delete the directory itself
copy(InputStream)
copy(WGDocument | TMLContext, attachmentname)
inherited
Copies filedata from an imput steam or content attachment to the file.
createDir() inherited Creates a directory if it does not already exists
createZipStream() inherited Creates a ZipStream object to generate zip files.
deleteDir() inherited Deletes the directory and its content if it exists including the referenced directory itself.

See also cleanDir().

exists() inherited Tests if a file or folder exists in the file system
file inherited Gets (or sets) the wrapped java.io.File object
inputStream inherited Gets the input stream of the wrapped java.io.File object
isDirectory() inherited Tests if the wrapped java.io.File object is a directory.
isFile() inherited Tests if the wrapped java.io.File object is a file.
list() inherited Returns directory list as WGAFile objects including subdirectories
listFiles([filter]) inherited List all files in the referenced folder optional filtered by a filter function.
listFolders([filter]) inherited List all subfolders in the referenced folder optional filtered by a filter function.

Available since version 7.10.5

mimeType inherited Gets the mime type of the wrapped java.io.File object
name inherited Returns the name of the file
setPosixFilePermissions(permissions) inherited Sets the file permissions for existing files.
write(text | XMLDocument, [encoding]) inherited Writes the given content to the file.