Class AbstractFilePersistenceStrategy

    • Constructor Detail

      • AbstractFilePersistenceStrategy

        public AbstractFilePersistenceStrategy​(java.io.File baseDirectory,
                                               XStream xstream,
                                               java.lang.String encoding)
    • Method Detail

      • getMapper

        protected Mapper getMapper()
      • isValid

        protected boolean isValid​(java.io.File dir,
                                  java.lang.String name)
      • extractKey

        protected abstract java.lang.Object extractKey​(java.lang.String name)
        Given a filename, the unescape method returns the key which originated it.
        Parameters:
        name - the filename
        Returns:
        the original key
      • getName

        protected abstract java.lang.String getName​(java.lang.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
      • put

        public java.lang.Object put​(java.lang.Object key,
                                    java.lang.Object value)
        Specified by:
        put in interface PersistenceStrategy
      • containsKey

        public boolean containsKey​(java.lang.Object key)
      • get

        public java.lang.Object get​(java.lang.Object key)
        Specified by:
        get in interface PersistenceStrategy