|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.isti.util.ErrorMessageMgr com.isti.util.FileDataMonitor
public class FileDataMonitor
Class FileDataMonitor reads in the data from a file and then monitors the file for changes. The last-modified date on the file is used to detect when its data has changed. The file may be specified as a local pathname or as a remote URL. The file is accessed via a separate thread (using a timeout) to prevent the possibility of having the calling thread held up because of an indefinite I/O block.
Field Summary | |
---|---|
static byte[] |
ERROR_ARRAY
Empty array used to indicate error. |
static byte[] |
NO_FILE_ARRAY
|
Constructor Summary | |
---|---|
FileDataMonitor(java.lang.String fNameStr)
Creates a file-data-monitor object. |
|
FileDataMonitor(java.lang.String fNameStr,
boolean allowMissingFlag)
Creates a file-data-monitor object. |
Method Summary | |
---|---|
byte[] |
checkReadFileData(int timeOutMs,
long maxReadBytesLimit)
Checks if the file has been modified and returns its contents if so. |
byte[] |
checkReadFileData(int timeOutMs,
long maxReadBytesLimit,
boolean forceFileReadFlag)
Checks if the file has been modified and returns its contents if so. |
java.net.URL |
getFileAccessUrlObj()
Returns the URL used to access the file in the last call to the 'checkReadFileData()' method. |
long |
getFileLastModifiedTimeMs()
Returns the last-modified time for the file in the last call to the 'checkReadFileData()' method. |
java.lang.String |
getFileNameString()
Returns the name of the file being monitored. |
long |
getPrevFileLastModTimeMs()
Returns the previous last-modified time for the file in the last call to the 'checkReadFileData()' method. |
Methods inherited from class com.isti.util.ErrorMessageMgr |
---|
clearErrorMessageString, clearFetchedErrorMessage, enterErrorMessageString, getErrorMessageFlag, getErrorMessageString, getUnfetchedMessageFlag, setErrorMessageString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte[] ERROR_ARRAY
public static final byte[] NO_FILE_ARRAY
Constructor Detail |
---|
public FileDataMonitor(java.lang.String fNameStr, boolean allowMissingFlag)
fNameStr
- name of file to be read and monitored.allowMissingFlag
- true to allow the file to be missing (and
not generate an error); false to generate an error when the file
is missing (the default).public FileDataMonitor(java.lang.String fNameStr)
fNameStr
- name of file to be read and monitored.Method Detail |
---|
public byte[] checkReadFileData(int timeOutMs, long maxReadBytesLimit, boolean forceFileReadFlag)
timeOutMs
- timeout value for file access, or 0 for infinite.maxReadBytesLimit
- maximum number of bytes to read from file,
or 0 for no limit.forceFileReadFlag
- true to force reading of file data; false
to only read file data if file-modified time changed.
public byte[] checkReadFileData(int timeOutMs, long maxReadBytesLimit)
timeOutMs
- timeout value for file access, or 0 for infinite.maxReadBytesLimit
- maximum number of bytes to read from file,
or 0 for no limit.
public java.lang.String getFileNameString()
public java.net.URL getFileAccessUrlObj()
public long getFileLastModifiedTimeMs()
public long getPrevFileLastModTimeMs()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |