com.ap.store
Class JavaFile

java.lang.Object
  extended bycom.ap.store.JavaFile
All Implemented Interfaces:
java.lang.Comparable, Store
Direct Known Subclasses:
ZipStore

public class JavaFile
extends java.lang.Object
implements Store, java.lang.Comparable


Constructor Summary
JavaFile(java.io.File file)
           
JavaFile(java.lang.String file)
           
 
Method Summary
 Store add(java.lang.String name)
          Creates a new store and adds it as children
 void attach(Store store)
          reserved not yet defined
 Store child(java.lang.String name)
          Returns the child store with the given name
 java.util.Collection children()
           
 int compareTo(java.lang.Object obj)
           
 void create()
          Creates the store regarding to the persistent storage (if applicable)
 boolean delete()
          Deletes the store and its content
 void detach(Store store)
          reserved not yet defined
 boolean exists()
           
 java.lang.String getName()
           
 Store getParent()
           
 java.lang.String getType()
           
 java.io.InputStream input()
           
 java.io.OutputStream output()
           
 java.io.PrintWriter printWriter()
           
 java.io.Reader reader()
           
 boolean remove(java.lang.String name)
          Removes the child with the given name from the children list
 void setParent(Store store)
           
 void sync()
          Flushes, writes, on persistent storage data that need to be saved (if applicable)
 java.lang.String toString()
           
 java.io.Writer writer()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavaFile

public JavaFile(java.io.File file)

JavaFile

public JavaFile(java.lang.String file)
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface Store
Returns:
the name of the store

getType

public java.lang.String getType()
Specified by:
getType in interface Store
Returns:
the type of the content

sync

public void sync()
Description copied from interface: Store
Flushes, writes, on persistent storage data that need to be saved (if applicable)

Specified by:
sync in interface Store

create

public void create()
Description copied from interface: Store
Creates the store regarding to the persistent storage (if applicable)

Specified by:
create in interface Store

exists

public boolean exists()
Specified by:
exists in interface Store
Returns:
true if the store exists

delete

public boolean delete()
Description copied from interface: Store
Deletes the store and its content

Specified by:
delete in interface Store
Returns:
true if deletion was sucessful

input

public java.io.InputStream input()
Specified by:
input in interface Store
Returns:
an InputStream representing the store's content

output

public java.io.OutputStream output()
Specified by:
output in interface Store
Returns:
an OutputStream to write to the store's content

reader

public java.io.Reader reader()
Specified by:
reader in interface Store
Returns:
an Reader representing the store's content

writer

public java.io.Writer writer()
Specified by:
writer in interface Store
Returns:
an Writer to write to the store's content

printWriter

public java.io.PrintWriter printWriter()
Specified by:
printWriter in interface Store
Returns:
an PrintWriter to write to the store's content

getParent

public Store getParent()
Specified by:
getParent in interface Store
Returns:
the parent of this store

setParent

public void setParent(Store store)
Specified by:
setParent in interface Store
Returns:
sets the parent's store

attach

public void attach(Store store)
Description copied from interface: Store
reserved not yet defined

Specified by:
attach in interface Store

detach

public void detach(Store store)
Description copied from interface: Store
reserved not yet defined

Specified by:
detach in interface Store

children

public java.util.Collection children()
Specified by:
children in interface Store
Returns:
all the children of this store, a Collection of Store obejcts

child

public Store child(java.lang.String name)
Description copied from interface: Store
Returns the child store with the given name

Specified by:
child in interface Store
Parameters:
name - of the child to retrieve
Returns:
the this store's child or null if no child was found

add

public Store add(java.lang.String name)
Description copied from interface: Store
Creates a new store and adds it as children

Specified by:
add in interface Store
Parameters:
name - of the new child
Returns:
the new created store object

remove

public boolean remove(java.lang.String name)
Description copied from interface: Store
Removes the child with the given name from the children list

Specified by:
remove in interface Store
Parameters:
name - the name of the child to remove
Returns:
true if the children was removed

compareTo

public int compareTo(java.lang.Object obj)
Specified by:
compareTo in interface java.lang.Comparable

toString

public java.lang.String toString()