Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.thoughtworks.xstream.persistence
Class FileStreamStrategy

    java.lang.Object
      com.thoughtworks.xstream.persistence.AbstractFilePersistenceStrategy
          com.thoughtworks.xstream.persistence.FileStreamStrategy

All Implemented Interfaces:
  PersistenceStrategy, StreamStrategy

Deprecated. since 1.3.1, use FilePersistenceStrategy

    public class FileStreamStrategy

extends AbstractFilePersistenceStrategy
implements StreamStrategy

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.

Author:
  Guilherme Silveira

Nested Class Summary

Nested classes/interfaces inherited from class com.thoughtworks.xstream.persistence.AbstractFilePersistenceStrategy
`AbstractFilePersistenceStrategy.ValidFilenameFilter, AbstractFilePersistenceStrategy.XmlMapEntriesIterator`

Constructor Summary
`FileStreamStrategy(File baseDirectory)` Deprecated.
`FileStreamStrategy(File baseDirectory, XStream xstream)` Deprecated.

Method Summary
`protected String` | `escape(String key)` Deprecated.
`protected Object` | `extractKey(String name)` Deprecated. Given a filename, the unescape method returns the key which originated it.
`protected String` | `getName(Object key)` Deprecated. Given a key, the escape method returns the filename which shall be used.
`protected String` | `unescape(String name)` Deprecated.

Methods inherited from class com.thoughtworks.xstream.persistence.AbstractFilePersistenceStrategy
`containsKey, get, getConverterLookup, getMapper, isValid, iterator, put, remove, size`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface com.thoughtworks.xstream.persistence.PersistenceStrategy
`get, iterator, put, remove, size`

Constructor Detail

### FileStreamStrategy

    public FileStreamStrategy(File baseDirectory)

  Deprecated.

### FileStreamStrategy

    public FileStreamStrategy(File baseDirectory,
                              XStream xstream)

  Deprecated.

Method Detail

### extractKey

    protected Object extractKey(String name)

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

  Specified by:
    `extractKey` in class `AbstractFilePersistenceStrategy`
  Parameters:
    `name` - the filename
  Returns:
    the original key

### unescape

    protected String unescape(String name)

  Deprecated.

### getName

    protected String getName(Object key)

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

  Specified by:
    `getName` in class `AbstractFilePersistenceStrategy`
  Parameters:
    `key` - the key
  Returns:
    the desired and escaped filename

### escape

    protected String escape(String key)

  Deprecated.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2008 XStream. All Rights Reserved.