Class FileStreamStrategy
- java.lang.Object
-
- com.thoughtworks.xstream.persistence.AbstractFilePersistenceStrategy
-
- com.thoughtworks.xstream.persistence.FileStreamStrategy
-
- All Implemented Interfaces:
PersistenceStrategy
,StreamStrategy
public class FileStreamStrategy extends AbstractFilePersistenceStrategy implements StreamStrategy
Deprecated.As of 1.3.1, use FilePersistenceStrategyPersistenceStrategy to assign string based keys to objects persisted in files. The file naming strategy is based on the key's type name and its toString method. It escapes non digit, non a-z and A-Z characters. In order to change the escaping/unescaping algorithm, simply extend this class and rewrite its getName/extractKey methods. Note, this implementation silently implies that the keys actually are Strings, since the keys will be turned into string keys at deserialization time.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.thoughtworks.xstream.persistence.AbstractFilePersistenceStrategy
AbstractFilePersistenceStrategy.ValidFilenameFilter, AbstractFilePersistenceStrategy.XmlMapEntriesIterator
-
-
Constructor Summary
Constructors Constructor Description FileStreamStrategy(java.io.File baseDirectory)
Deprecated.FileStreamStrategy(java.io.File baseDirectory, XStream xstream)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected java.lang.String
escape(java.lang.String key)
Deprecated.protected java.lang.Object
extractKey(java.lang.String name)
Deprecated.Given a filename, the unescape method returns the key which originated it.protected java.lang.String
getName(java.lang.Object key)
Deprecated.Given a key, the escape method returns the filename which shall be used.protected java.lang.String
unescape(java.lang.String name)
Deprecated.-
Methods inherited from class com.thoughtworks.xstream.persistence.AbstractFilePersistenceStrategy
containsKey, get, getConverterLookup, getMapper, isValid, iterator, put, remove, size
-
-
-
-
Constructor Detail
-
FileStreamStrategy
public FileStreamStrategy(java.io.File baseDirectory)
Deprecated.
-
FileStreamStrategy
public FileStreamStrategy(java.io.File baseDirectory, XStream xstream)
Deprecated.
-
-
Method Detail
-
extractKey
protected java.lang.Object extractKey(java.lang.String name)
Deprecated.Given a filename, the unescape method returns the key which originated it.- Specified by:
extractKey
in classAbstractFilePersistenceStrategy
- Parameters:
name
- the filename- Returns:
- the original key
-
unescape
protected java.lang.String unescape(java.lang.String name)
Deprecated.
-
getName
protected java.lang.String getName(java.lang.Object key)
Deprecated.Given a key, the escape method returns the filename which shall be used.- Specified by:
getName
in classAbstractFilePersistenceStrategy
- Parameters:
key
- the key- Returns:
- the desired and escaped filename
-
escape
protected java.lang.String escape(java.lang.String key)
Deprecated.
-
-