org.gcube.contentmanagement.baselayer.streamutils
Class DeleteContentAction

java.lang.Object
  extended by org.gcube.contentmanagement.baselayer.streamutils.DeleteContentAction
All Implemented Interfaces:
FinishingAction

public class DeleteContentAction
extends java.lang.Object
implements FinishingAction

This action deletes some defined content using the given content manager.


Constructor Summary
DeleteContentAction(RawFileContentManager manager, RawContentLocation locationToDelete, BasicStorageHints hints, boolean deleteIfStreamUnread)
          Constructs a new action
 
Method Summary
 void finish(FinishingActionStream fas)
          This method needs to be implemeted according to whatever task should be performed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeleteContentAction

public DeleteContentAction(RawFileContentManager manager,
                           RawContentLocation locationToDelete,
                           BasicStorageHints hints,
                           boolean deleteIfStreamUnread)
Constructs a new action

Parameters:
manager - the manager to use
locationToDelete - the location to delete
hints - the hints to be used
deleteIfStreamUnread - if set to false, the content will only get deleted, if at least one byte has been read; if set to true, the content will get removed no matter if the stream was read or not as soon as the stream gets closed.
Method Detail

finish

public void finish(FinishingActionStream fas)
            throws java.io.IOException
This method needs to be implemeted according to whatever task should be performed.

Specified by:
finish in interface FinishingAction
Parameters:
fas - the stream operate on, normally this is invoked inside a FinishingActionStream.finish(this);
Throws:
java.io.IOException - in order to comlpy with the streams used by Java, only IOExceptions can be thrown from stream operations.