John W. Campbell
This class provides a mechanism to set up logical names to point to
directories. It is intended to assist with the input or output of files for
applets where the standard Java based file chooser cannot be used
because of security restrictions. The logical names must be defined
in a file called .java.lfp.txt in the directory pointed to by the Java
System Property "user.home". For each required logical name, a line
is given with the logical name followed by the required path e.g.
IMAGES C:\Documents and Settings\JOHN\My Documents\image_data
When used from an applet, permission will need to be given to access:-
- The system property "user.home".
- The file ".java.lfp.txt".
- Files in the paths pointed to by the logical names defined
in the file ".java.lfp.txt".
Class, constructor and methods:
Class Details
Accessible Fields
Constructor
Methods
- Package:
- Jdl.JdlLib;
- Class name:
- JdlLogicalFilePaths
- Class definition:
- public class JdlLogicalFilePaths
- Extends:
- Object
- Implements:
- none
- Actions:
- none
No fields with public, package or protected access defined.
A single constructor is available.
Constructor:
Default constructor
Constructs a JdlLogicalFilePaths object by reading in the entries from
the file .java.lfp.txt in the directory pointed to by the Java
System Property "user.home".
- Constructor Definition:
- public JdlLogicalFilePaths()
- Parameters List:
- none
This section contains methods to process the logical names and to
return status information.
Methods:
See if paths defined - pathsDefined
Get full file name - fullFileName
Was name expanded - wasExpanded
This method tests whether or not any logical name paths have been
set up.
- Method Definition:
- public boolean pathsDefined()
- Parameters List:
- none
- Method Return:
-
Returns true if logical names have been defined in the required
file or false if they have not.
This method expands the file name to give the full file path name
from the name specified using the logical name.
- Method Definition:
- public String fullFileName (String filename)
- Parameters List:
- filename
- The name of the file containing the logical name. If
no logical name us given (or one that has not been defined) the file
name will be returned unchanged e.g.
IMAGE\lys.mar based on a logical name defined as IMAGE.
- Method Return:
-
Returns the expanded file name (or the unmodified file name if
a valid logical name was not found).
Returns a flag indicating whether or not a file name was expanded on
the previous call to fullFileName(..).
- Method Definition:
- public boolean wasExpanded()
- Parameters List:
- none
- Method Return:
-
Returns true if the file name was expanded, otherwise false.
⇑ Up 2
⇑ Up 1
⇑ Top of this