GigaSpaces XAP 7.0 API

com.gigaspaces.security.fs
Class URLFileService

java.lang.Object
  extended by com.gigaspaces.security.fs.URLFileService
All Implemented Interfaces:
FileService

public class URLFileService
extends Object
implements FileService

A FileService responsible for reading from a URL. The URL can be specified by providing a URL_PROPERTY_KEY.

The url property is a String to parse as a URL.

Since:
7.0.1
Author:
Moran Avigdor

Field Summary
static String URL_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
URLFileService()
           
 
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

URL_PROPERTY_KEY

public static final String URL_PROPERTY_KEY
The property key identifying the security file

See Also:
Constant Field Values
Constructor Detail

URLFileService

public URLFileService()
Method Detail

init

public void init(Properties properties)
          throws IOException
Description copied from interface: FileService
Initialize the FileService implementation with the properties supplied to the SecurityManager.

Specified by:
init in interface FileService
Throws:
IOException

fileExists

public boolean fileExists()
Description copied from interface: FileService
Checks the existence of the file

Specified by:
fileExists in interface FileService
Returns:
true if and only if the file exists; false otherwise.

readFromFile

public byte[] readFromFile()
                    throws IOException
Description copied from interface: FileService
Reads from a file, returning a byte array representation of the contents.

Specified by:
readFromFile in interface FileService
Returns:
a file as a byte array.
Throws:
IOException - If any exception occurred while reading from a file.

writeToFile

public void writeToFile(byte[] bytes)
                 throws IOException
Description copied from interface: FileService
Write to a file a byte array representation of the contents.

Specified by:
writeToFile in interface FileService
Parameters:
bytes - contents as a byte array.
Throws:
IOException - If any exception occurred while writing to a file.

lastModified

public long lastModified()
Description copied from interface: FileService
The last time the file was modified. This serves as an indication for refreshing internal cache of the file contents. By comparing the last saved modification time and the current modification time. -1 should be returned to force a refresh. Same value should be returned to avoid a refresh.

Specified by:
lastModified in interface FileService
Returns:
A long value representing the time the file was last modified.

GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.