com.partnersoft.io.formats.xml.cog
Class XMLCogStore

java.lang.Object
  extended by com.partnersoft.io.formats.xml.cog.XMLCogStore
All Implemented Interfaces:
CogStore

public class XMLCogStore
extends java.lang.Object
implements CogStore

This is an implementation of CogStore that uses a file system and XML format to store and retrieve cog files. It allows both reading and writing, but you must turn on writing ability.

Author:
Paul Reavis Copyright 2003 Partner Software, Inc.

Field Summary
 
Fields inherited from interface com.partnersoft.io.store.CogStore
BIN, COG, NOT_FOUND
 
Constructor Summary
XMLCogStore(VFS vfs)
           
 
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 path)
          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

XMLCogStore

public XMLCogStore(VFS vfs)
Method Detail

isWritable

public boolean isWritable()
Description copied from interface: CogStore
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
Description copied from interface: CogStore
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
Description copied from interface: CogStore
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
Description copied from interface: CogStore
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
Description copied from interface: CogStore
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 path)
                                throws java.io.IOException
Description copied from interface: CogStore
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