SmartFrog 3.10.000

org.smartfrog.services.filesystem.filestore
Class AddedFilestore

java.lang.Object
  extended by org.smartfrog.services.filesystem.filestore.AddedFilestore

public class AddedFilestore
extends java.lang.Object

cache of files added to the filestore. When cleaned up, files are deleted.


Constructor Summary
AddedFilestore(java.io.File directory)
          Constructor.
 
Method Summary
 FileEntry createNewFile(java.lang.String prefix, java.lang.String suffix)
          create new file
 boolean delete(java.io.File file)
          Delete a file in the filestore, and remove it from the list of file entries
 boolean delete(java.net.URI uri)
          Delete a file in the filestore, and remove it from the list of file entries
 void deleteAllEntries()
          Delete all entries, reset the cache
 java.io.File getDirectory()
          Get directory.
 java.util.Collection getEntries()
          Get all the entries
 FileEntry lookup(java.io.File file)
          get an entry
 FileEntry lookup(java.net.URI uri)
          look up an entry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddedFilestore

public AddedFilestore(java.io.File directory)
Constructor.

Parameters:
directory - directory
Method Detail

createNewFile

public FileEntry createNewFile(java.lang.String prefix,
                               java.lang.String suffix)
                        throws java.io.IOException
create new file

Parameters:
prefix - file prefix
suffix - file suffix
Returns:
FileEntry
Throws:
java.io.IOException - for IO error

delete

public boolean delete(java.io.File file)
Delete a file in the filestore, and remove it from the list of file entries

Parameters:
file - file to delete
Returns:
true if deletion went ahead

delete

public boolean delete(java.net.URI uri)
Delete a file in the filestore, and remove it from the list of file entries

Parameters:
uri - uri of entry
Returns:
true if deletion went ahead

getDirectory

public java.io.File getDirectory()
Get directory.

Returns:
File

deleteAllEntries

public void deleteAllEntries()
Delete all entries, reset the cache


lookup

public FileEntry lookup(java.io.File file)
get an entry

Parameters:
file - file to lookup
Returns:
file or null

lookup

public FileEntry lookup(java.net.URI uri)
look up an entry

Parameters:
uri - of entry
Returns:
file entry or null

getEntries

public java.util.Collection getEntries()
Get all the entries

Returns:
a collection to iterate over

SmartFrog CORE 3.10.000

(C) Copyright 1998-2006 Hewlett-Packard Development Company, LP