public interface FileService
UserDetails
and RoleDetails
stored in a file.
The contents read from the service are cached and refreshed by comparing the last modification time.LocalFileService
,
URLFileService
Modifier and Type | Field and Description |
---|---|
static String |
FILE_SERVICE_CLASS_PROPERTY_KEY
The property key identifying the
FileService implementation class name |
Modifier and Type | Method and Description |
---|---|
boolean |
fileExists()
Checks the existence of the file
|
void |
init(Properties properties)
Initialize the
FileService implementation with the properties supplied to the SecurityManager . |
long |
lastModified()
The last time the file was modified.
|
byte[] |
readFromFile()
Reads from a file, returning a byte array representation of the contents.
|
void |
writeToFile(byte[] bytes)
Write to a file a byte array representation of the contents.
|
static final String FILE_SERVICE_CLASS_PROPERTY_KEY
FileService
implementation class namevoid init(Properties properties) throws IOException
FileService
implementation with the properties supplied to the SecurityManager
.IOException
boolean fileExists()
true
if and only if the file exists; false
otherwise.byte[] readFromFile() throws IOException
IOException
- If any exception occurred while reading from a file.void writeToFile(byte[] bytes) throws IOException
bytes
- contents as a byte array.IOException
- If any exception occurred while writing to a file.long lastModified()
-1
should be returned to force a refresh. Same value should
be returned to avoid a refresh.long
value representing the time the file was last modified.Copyright © GigaSpaces.