Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When a service thread starts, a call to the JSMManager.clearTemporaryDirectory method is performed to make sure no previous temporary files from a previous thread with the same hash code exist.

Get Temporary Directory

The static method JSMManager.getTemporaryDirectory returns the temporary directory of the current service as a java.io.File object.

The temporary directory is not created by this method.

The name of this temporary directory is the job number and hash code of the service thread.

Example

File     File directory = JSMManager.getTemporaryDirectory () ;

Create Temporary Directory

The static method JSMManager.createTemporaryDirectory returns the temporary directory of the current service as a java.io.File object.

The temporary directory is created by this method.

The name of this temporary directory is the job number and hash code of the service thread.

Example

File     File directory = JSMManager.createTemporaryDirectory () ;

Create Temporary File

The static method JSMManager.createTemporaryFile returns the temporary file as a java.io.File object.

If the temporary directory does not exist then it is created, but the temporary file is not created.

...

To read and write to the file use the FileInputStream and FileOutputStream classes.

Example

File     File file = JSMManager.createTemporaryFile ( filename ) ;

Clear Temporary Directory and Files

The static method JSMManager.clearTemporaryDirectory deletes all files in the temporary directory and then deletes the temporary directory.

There is no need for the programmer to clear the temporary directory.

Example

boolean     boolean ok = JSMManager.clearTemporaryDirectory () ;