com.googlecode.fascinator.storage.filesystem
Class FileSystemPayload

java.lang.Object
  extended by com.googlecode.fascinator.common.storage.impl.GenericPayload
      extended by com.googlecode.fascinator.storage.filesystem.FileSystemPayload
All Implemented Interfaces:
Payload

public class FileSystemPayload
extends GenericPayload


Constructor Summary
FileSystemPayload(String id, File payloadFile)
           
 
Method Summary
 void close()
          Close the input stream for this payload
 Long lastModified()
          Return the timestamp when the payload was last modified
 InputStream open()
          Gets the input stream to access the content for this payload
 void readExistingMetadata()
          Read metadata from disk into memory if it exists
 Long size()
          Return the size of the payload in byte
 void writeMetadata()
          Write metadata to disk, calculating/retrieving if it is not known yet
 
Methods inherited from class com.googlecode.fascinator.common.storage.impl.GenericPayload
getContentType, getId, getLabel, getType, hasMetaChanged, isLinked, setContentType, setId, setInputStream, setLabel, setLinked, setMetaChanged, setType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileSystemPayload

public FileSystemPayload(String id,
                         File payloadFile)
Method Detail

readExistingMetadata

public void readExistingMetadata()
Read metadata from disk into memory if it exists


writeMetadata

public void writeMetadata()
Write metadata to disk, calculating/retrieving if it is not known yet


open

public InputStream open()
                 throws StorageException
Gets the input stream to access the content for this payload

Specified by:
open in interface Payload
Overrides:
open in class GenericPayload
Returns:
an input stream
Throws:
IOException - if there was an error reading the stream
StorageException

close

public void close()
           throws StorageException
Close the input stream for this payload

Specified by:
close in interface Payload
Overrides:
close in class GenericPayload
Throws:
StorageException - if there was an error closing the stream

lastModified

public Long lastModified()
Return the timestamp when the payload was last modified

Specified by:
lastModified in interface Payload
Overrides:
lastModified in class GenericPayload

size

public Long size()
Return the size of the payload in byte

Specified by:
size in interface Payload
Overrides:
size in class GenericPayload


Copyright © 2009-2011. All Rights Reserved.