Package org.apache.catalina.session
Class FileStore
java.lang.Object
org.apache.catalina.util.LifecycleBase
org.apache.catalina.session.StoreBase
org.apache.catalina.session.FileStore
Concrete implementation of the Store interface that utilizes a file per saved Session in a configured
 directory. Sessions that are saved are still subject to being expired based on inactivity.
- Author:
- Craig R. McClanahan
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.catalina.LifecycleLifecycle.SingleUse
- 
Field SummaryFields inherited from interface org.apache.catalina.LifecycleAFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclear()Remove all of the Sessions in this Store.intgetSize()Return the number of Sessions present in this Store.Return the name for this Store, used for logging.String[]keys()Return an array containing the session identifiers of all Sessions currently saved in this Store.Load and return the Session associated with the specified session identifier from this Store, without removing it.voidRemove the Session with the specified session identifier from this Store, if present.voidSave the specified Session into this Store.voidsetDirectory(String path) Set the directory path for this Store.Methods inherited from class org.apache.catalina.session.StoreBaseaddPropertyChangeListener, destroyInternal, expiredKeys, getManager, getObjectInputStream, initInternal, processExpires, removePropertyChangeListener, setManager, startInternal, stopInternal, toStringMethods inherited from class org.apache.catalina.util.LifecycleBaseaddLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop
- 
Constructor Details- 
FileStorepublic FileStore()
 
- 
- 
Method Details- 
getDirectory- Returns:
- The directory path for this Store.
 
- 
setDirectorySet the directory path for this Store.- Parameters:
- path- The new directory path
 
- 
getThreadName- Returns:
- The thread name for this Store.
 
- 
getStoreNameReturn the name for this Store, used for logging.- Overrides:
- getStoreNamein class- StoreBase
- Returns:
- the name for this Store, used for logging.
 
- 
getSizeReturn the number of Sessions present in this Store.- Returns:
- the number of Sessions present in this Store.
- Throws:
- IOException- if an input/output error occurs
 
- 
clearRemove all of the Sessions in this Store.- Throws:
- IOException- if an input/output error occurs
 
- 
keysReturn an array containing the session identifiers of all Sessions currently saved in this Store. If there are no such Sessions, a zero-length array is returned.- Returns:
- an array containing the session identifiers of all Sessions currently saved in this Store. If there are no such Sessions, a zero-length array is returned.
- Throws:
- IOException- if an input/output error occurred
 
- 
loadLoad and return the Session associated with the specified session identifier from this Store, without removing it. If there is no such stored Session, returnnull.- Parameters:
- id- Session identifier of the session to load
- Returns:
- the loaded Session instance
- Throws:
- ClassNotFoundException- if a deserialization error occurs
- IOException- if an input/output error occurs
 
- 
removeRemove the Session with the specified session identifier from this Store, if present. If no such Session is present, this method takes no action.- Parameters:
- id- Session identifier of the Session to be removed
- Throws:
- IOException- if an input/output error occurs
 
- 
saveSave the specified Session into this Store. Any previously saved information for the associated session identifier is replaced.- Parameters:
- session- Session to be saved
- Throws:
- IOException- if an input/output error occurs
 
 
-