|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.safs.logging.LogItem
org.safs.logging.FileLogItem
public abstract class FileLogItem
This class is an abstract representation of SAFS log files. In addition to
attributes common to all LogItems, FileLogItem
supports two more attributes: file spec and parent directory. File spec is
the name (with or without path) of the file. It can be specified in absolute
or relative form. When a relative path is specified, it is used together with
parent directory to determine the full path of the file. If file spec is
absolute, the parent directory is ignored.
| Field Summary |
|---|
| Fields inherited from class org.safs.logging.LogItem |
|---|
closed, enabled, level, mode, name |
| Constructor Summary | |
|---|---|
FileLogItem(long mode,
java.lang.String parent,
java.lang.String file)
Creates a disabled FileLogItem with file name as the name,
and sets its log level to LOGLEVEL_INFO. |
|
FileLogItem(java.lang.String name,
long mode,
boolean enabled,
java.lang.String parent,
java.lang.String file)
Creates a FileLogItem and sets its log level to
LOGLEVEL_INFO. |
|
FileLogItem(java.lang.String name,
long mode,
int level,
boolean enabled,
java.lang.String parent,
java.lang.String file)
Creates a FileLogItem. |
|
| Method Summary | |
|---|---|
boolean |
fileExists()
Tests if the file represented by this log item exists. |
java.lang.String |
getAbsolutePath()
Returns the full path to the file represented by this log item. |
java.lang.String |
getFileSpec()
Returns the file spec for this log. |
java.lang.String |
getParentDir()
Returns the parent directory for this log. |
boolean |
isFileSpecAbsolute()
Tests if the file spec of this log is absolute or relative. |
void |
setParentDir(java.lang.String dir)
Sets the parent directory for this log. |
| Methods inherited from class org.safs.logging.LogItem |
|---|
close, dateTime, isClosed, logMessage |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileLogItem(java.lang.String name,
long mode,
int level,
boolean enabled,
java.lang.String parent,
java.lang.String file)
FileLogItem.
name - the name of this log item. If null, it is
set to the file name.mode - the type of this log (LOGMODE constant
defined by AbstractLogFacility).level - the log level for this log.enabled - true to enable this log; false
to disable.parent - the parent directory of this log.file - the file spec of this log.
public FileLogItem(java.lang.String name,
long mode,
boolean enabled,
java.lang.String parent,
java.lang.String file)
FileLogItem and sets its log level to
LOGLEVEL_INFO.
name - the name of this log item. If null, it is
set to the file name.mode - the type of this log (LOGMODE constant
defined by AbstractLogFacility).enabled - true to enable this log; false
to disable.parent - the parent directory of this log.file - the file spec of this log.
public FileLogItem(long mode,
java.lang.String parent,
java.lang.String file)
FileLogItem with file name as the name,
and sets its log level to LOGLEVEL_INFO.
mode - the type of this log (LOGMODE constant
defined by AbstractLogFacility).parent - the parent directory of this log.file - the file spec of this log.| Method Detail |
|---|
public java.lang.String getFileSpec()
public boolean isFileSpecAbsolute()
true if the file spec is absolute;
false if it is relative.public java.lang.String getParentDir()
public void setParentDir(java.lang.String dir)
dir - the new parent directory.public java.lang.String getAbsolutePath()
public boolean fileExists()
true if getAbsolutePath points to an
existing file; false otherwise.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||