Static Public Member Functions

alma.acs.util.AcsCWD Class Reference

List of all members.

Static Public Member Functions

static File getCWD ()
static synchronized void setCWD (String cwd)
static synchronized File createTempFileInCWD (String prefix, String suffix) throws IOException

Detailed Description

Class that gives access to the current working directory, effectively encapsulating the "user.dir" property. This feature was requested in Feb. 2005 by Lindsey, Brian, et.al.

Note that using files goes very much against ALMA's idea of location transparency of component locations, and against having a central archive to store data. This class should only be used in exceptional situations, such as for offline data reduction, or for other inevitable temporary file storage, where a component creates and deletes the files within its life cycle. Files should almost never be used for inter-component communication!

Note that on a diskless machine, the file created may well be located on a RAM disk and does not survive machine rebooting.

Author:
hsommer
Since:
ACS 5.0

Member Function Documentation

static synchronized File alma.acs.util.AcsCWD.createTempFileInCWD ( String  prefix,
String  suffix 
) throws IOException [static]

Creates a temp file in the current working dir.

Parameters:
prefix The prefix string to be used in generating the file's name; must be at least three characters long
suffix The suffix string to be used in generating the file's name; may be null, in which case the suffix ".tmp" will be used
Returns:
a newly created file.
Exceptions:
IOException 
See also:
File.createTempFile(java.lang.String, java.lang.String, java.io.File)

References alma.acs.util.AcsCWD.getCWD().

static File alma.acs.util.AcsCWD.getCWD (  )  [static]

Gets the current working directory.

Returns:
File object which represents the directory.

Referenced by alma.acs.util.AcsCWD.createTempFileInCWD().

static synchronized void alma.acs.util.AcsCWD.setCWD ( String  cwd  )  [static]

Sets the current working directory.

Parameters:
cwd 

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties