org.semwebcentral.sweetrules.infrastructure
Class SweetFileKBDescriptor

java.lang.Object
  extended byorg.semwebcentral.sweetrules.infrastructure.AbstractSweetKBDescriptor
      extended byorg.semwebcentral.sweetrules.infrastructure.SweetFileKBDescriptor
All Implemented Interfaces:
java.lang.Cloneable, ISweetKBDescriptor

public class SweetFileKBDescriptor
extends AbstractSweetKBDescriptor

The generalized KB descriptor provided by SWEET for Local files

Author:
Shashidhara K Ganjugunte, Dr. Benjamin Grosof, Dr. Said Tabet, Chitravanu Neogy, Sumit Bhansali

Field Summary
 
Fields inherited from class org.semwebcentral.sweetrules.infrastructure.AbstractSweetKBDescriptor
kbLocation, krDescriptor
 
Constructor Summary
SweetFileKBDescriptor(java.lang.String location, ISweetKRDescriptor descriptor)
          Constructor for the KB descriptor
 
Method Summary
 java.lang.String getFilePath()
          Returns the local file path
 java.lang.String readData()
          Reads the data from the KB and returns it
 void writeData(java.lang.String data)
          Writes the data to the specified KB
 
Methods inherited from class org.semwebcentral.sweetrules.infrastructure.AbstractSweetKBDescriptor
clone, equals, getKBLocation, getKRDescriptor, haveSameLocation, setKBLocation, setKRDescriptor
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SweetFileKBDescriptor

public SweetFileKBDescriptor(java.lang.String location,
                             ISweetKRDescriptor descriptor)
Constructor for the KB descriptor

Parameters:
location - The location of the knowledge base (full path)
descriptor - The KR descriptor of the KB
Method Detail

readData

public java.lang.String readData()
                          throws SweetException
Description copied from interface: ISweetKBDescriptor
Reads the data from the KB and returns it

Returns:
The data from the KB
Throws:
SweetException - if read fails

writeData

public void writeData(java.lang.String data)
               throws SweetException
Description copied from interface: ISweetKBDescriptor
Writes the data to the specified KB

Parameters:
data - The data to be written
Throws:
SweetException - if an error occurs

getFilePath

public java.lang.String getFilePath()
Returns the local file path

Returns:
The local file path