com.partnersoft.io.store
Class PreferencesCogStore

java.lang.Object
  extended by com.partnersoft.io.store.PreferencesCogStore
All Implemented Interfaces:
CogStore

public class PreferencesCogStore
extends java.lang.Object
implements CogStore

A CogStore that stores stuff in Java preferences.

Author:
Paul Reavis Copyright 2005 Partner Software, Inc.

Field Summary
 
Fields inherited from interface com.partnersoft.io.store.CogStore
BIN, COG, NOT_FOUND
 
Constructor Summary
PreferencesCogStore()
           
 
Method Summary
 int examine(java.lang.String path)
          Returns type of node for path - either NOT_FOUND, COG, or BIN.
 boolean isWritable()
          Returns true if you can write to this store.
 java.lang.String[] listContents(java.lang.String binPath)
          Lists the contents for the given bin node.
 Cog retrieveCog(java.lang.String path)
          Retreives a cog from storage.
 Cog retrieveCogOrNull(java.lang.String path)
          Retreives a cog from storage.
 void storeCog(java.lang.String path, Cog cog)
          Stores a cog, replacing the current one at that location and creating any missing bins needed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreferencesCogStore

public PreferencesCogStore()
Method Detail

isWritable

public boolean isWritable()
Returns true if you can write to this store.

Specified by:
isWritable in interface CogStore

retrieveCog

public Cog retrieveCog(java.lang.String path)
                throws java.io.IOException
Retreives a cog from storage.

Specified by:
retrieveCog in interface CogStore
Throws:
java.io.IOException

retrieveCogOrNull

public Cog retrieveCogOrNull(java.lang.String path)
                      throws java.io.IOException
Retreives a cog from storage. Returns null (rather than FileNotFound) if it's not there.

Specified by:
retrieveCogOrNull in interface CogStore
Throws:
java.io.IOException

storeCog

public void storeCog(java.lang.String path,
                     Cog cog)
              throws java.io.IOException
Stores a cog, replacing the current one at that location and creating any missing bins needed.

Specified by:
storeCog in interface CogStore
Throws:
java.io.IOException

examine

public int examine(java.lang.String path)
            throws java.io.IOException
Returns type of node for path - either NOT_FOUND, COG, or BIN.

Specified by:
examine in interface CogStore
Throws:
java.io.IOException

listContents

public java.lang.String[] listContents(java.lang.String binPath)
                                throws java.io.IOException
Lists the contents for the given bin node. Throws IllegalArgumentException if it's not a bin.

Specified by:
listContents in interface CogStore
Throws:
java.io.IOException