org.crosswire.jsword.book.sword.state
Class RawFileBackendState
java.lang.Object
org.crosswire.jsword.book.sword.state.AbstractOpenFileState
org.crosswire.jsword.book.sword.state.RawBackendState
org.crosswire.jsword.book.sword.state.RawFileBackendState
- All Implemented Interfaces:
- Closeable, OpenFileState
public class RawFileBackendState
- extends RawBackendState
Stores the random access files required for processing the passage request
The caller is required to close to correctly free resources and avoid File
pointer leaks
- Author:
- DM Smith
- See Also:
The GNU Lesser General Public License for details.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INCFILE
public static final String INCFILE
- See Also:
- Constant Field Values
incfile
private File incfile
incfileValue
private int incfileValue
log
private static final org.slf4j.Logger log
- The log stream
RawFileBackendState
RawFileBackendState(SwordBookMetaData bookMetaData)
throws BookException
- This is default package access for forcing the use of the
OpenFileStateManager to manage the creation. Not doing so may result in
new instances of OpenFileState being created for no reason, and as a
result, if they are released to the OpenFileStateManager by mistake this
would result in leakage
- Parameters:
bookMetaData
- the appropriate metadata for the book
- Throws:
BookException
isWritable
public boolean isWritable()
- Overrides:
isWritable
in class RawBackendState
existsAndCanReadAndWrite
private boolean existsAndCanReadAndWrite(File file)
- Returns true if the file exists, can be read and can be written to.
- Parameters:
file
- the file
- Returns:
- true, if successful
readIncfile
private int readIncfile()
throws IOException
- Throws:
IOException
initIncFile
private void initIncFile()
getIncfileValue
public int getIncfileValue()
- Returns:
- the incfileValue
setIncfileValue
public void setIncfileValue(int incValue)
getIncfile
public File getIncfile()
- Returns:
- the incfile
setIncfile
public void setIncfile(File incfile)
- Parameters:
incfile
- the incfile to set