public class FileDataMonitor extends ErrorMessageMgr
Modifier and Type | Field and Description |
---|---|
static byte[] |
ERROR_ARRAY
Empty array used to indicate error.
|
static byte[] |
NO_FILE_ARRAY |
Constructor and Description |
---|
FileDataMonitor(java.lang.String fNameStr)
Creates a file-data-monitor object.
|
FileDataMonitor(java.lang.String fNameStr,
boolean allowMissingFlag)
Creates a file-data-monitor object.
|
Modifier and Type | Method and Description |
---|---|
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.
|
clearErrorMessageString, clearFetchedErrorMessage, enterErrorMessageString, getErrorMessageFlag, getErrorMessageString, getUnfetchedMessageFlag, setErrorMessageString
public static final byte[] ERROR_ARRAY
public static final byte[] NO_FILE_ARRAY
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.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()