public class

FileStreamStrategy

extends AbstractFilePersistenceStrategy
implements StreamStrategy
java.lang.Object
   ↳ com.thoughtworks.xstream.persistence.AbstractFilePersistenceStrategy
     ↳ com.thoughtworks.xstream.persistence.FileStreamStrategy

This class is deprecated.
since 1.3.1, use FilePersistenceStrategy

Class Overview

PersistenceStrategy 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.

Summary

Public Constructors
FileStreamStrategy(File baseDirectory)
FileStreamStrategy(File baseDirectory, XStream xstream)
Protected Methods
String escape(String key)
Object extractKey(String name)
Given a filename, the unescape method returns the key which originated it.
String getName(Object key)
Given a key, the escape method returns the filename which shall be used.
String unescape(String name)
[Expand]
Inherited Methods
From class com.thoughtworks.xstream.persistence.AbstractFilePersistenceStrategy
From class java.lang.Object
From interface com.thoughtworks.xstream.persistence.PersistenceStrategy

Public Constructors

public FileStreamStrategy (File baseDirectory)

public FileStreamStrategy (File baseDirectory, XStream xstream)

Protected Methods

protected String escape (String key)

protected Object extractKey (String name)

Given a filename, the unescape method returns the key which originated it.

Parameters
name the filename
Returns
  • the original key

protected String getName (Object key)

Given a key, the escape method returns the filename which shall be used.

Parameters
key the key
Returns
  • the desired and escaped filename

protected String unescape (String name)