|
GigaSpaces XAP 9.7.2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.gigaspaces.security.fs.LocalFileService
public class LocalFileService
A FileService
responsible for reading and writing to a file on the local file-system. The
file path can be specified by providing a FILE_PATH_PROPERTY_KEY
property, or defaults
to FILE_PATH_DEFAULT_VAL
if none was specified.
The file-path
property can be either a direct path to a file, or resource in the
classpath.
Field Summary | |
---|---|
static String |
FILE_PATH_DEFAULT_VAL
The default value of the file-path is non was specified |
static String |
FILE_PATH_PROPERTY_KEY
The property key identifying the security file |
Fields inherited from interface com.gigaspaces.security.fs.FileService |
---|
FILE_SERVICE_CLASS_PROPERTY_KEY |
Constructor Summary | |
---|---|
LocalFileService()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String FILE_PATH_PROPERTY_KEY
public static final String FILE_PATH_DEFAULT_VAL
Constructor Detail |
---|
public LocalFileService()
Method Detail |
---|
public void init(Properties properties) throws IOException
FileService
FileService
implementation with the properties supplied to the
SecurityManager
.
init
in interface FileService
IOException
public boolean fileExists()
FileService
fileExists
in interface FileService
true
if and only if the file exists; false
otherwise.public byte[] readFromFile() throws IOException
FileService
readFromFile
in interface FileService
IOException
- If any exception occurred while reading from a file.public void writeToFile(byte[] bytes) throws IOException
FileService
writeToFile
in interface FileService
bytes
- contents as a byte array.
IOException
- If any exception occurred while writing to a file.public long lastModified()
FileService
-1
should be returned to force a refresh. Same value should
be returned to avoid a refresh.
lastModified
in interface FileService
long
value representing the time the file was last modified.
|
GigaSpaces XAP 9.7.2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |