A new temporary File. TemporaryFiles may be used within resource expressions:

try (tempFile = temporaryDirectory.TemporaryFile()) {
    // ...
}

If possible, a TemporaryFile will be deleted upon invocation of its Destroyable.destroy() method.

no subtypes hierarchy

Initializer
TemporaryFile(String? prefix, String? suffix)
Parameters:
  • prefix

    The leading part of the temporary file name to use, or null for the system default.

  • suffix

    The trailing part of the temporary file name to use, or null for the system default.

Throws
  • Exception

    If the prefix or suffix cannot be used to generate a file name, an I/O error occurs, or a parent directory is not specified and a suitable temporary directory cannot be determined.

Inherited Attributes
Attributes inherited from: Object
Attributes inherited from: ExistingResource
Attributes inherited from: File
Attributes inherited from: Resource
Inherited Methods
Methods inherited from: Object
Methods inherited from: Destroyable
Methods inherited from: ExistingResource
Methods inherited from: File