org.javaswift.joss.instructions
Class SegmentationPlan

java.lang.Object
  extended by org.javaswift.joss.instructions.SegmentationPlan
Direct Known Subclasses:
SegmentationPlanByteArray, SegmentationPlanFile

public abstract class SegmentationPlan
extends Object

The Segmentation plan provides a way to access the underlying data as separate InputStreams for the purpose of uploading in several segments.


Field Summary
protected  Long currentSegment
           
protected  Long segmentationSize
           
 
Constructor Summary
SegmentationPlan(Long segmentationSize)
           
 
Method Summary
abstract  void close()
          Closes the underlying File, if appropriate
protected abstract  InputStream createSegment()
          Creates an InputStream from the current segment
protected  boolean done()
          Checks whether all segments have been done
protected abstract  Long getFileLength()
          Returns the file length of the object
 InputStream getNextSegment()
           
 Long getSegmentNumber()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

segmentationSize

protected Long segmentationSize

currentSegment

protected Long currentSegment
Constructor Detail

SegmentationPlan

public SegmentationPlan(Long segmentationSize)
Method Detail

getSegmentNumber

public Long getSegmentNumber()

getNextSegment

public InputStream getNextSegment()
                           throws IOException
Throws:
IOException

done

protected boolean done()
Checks whether all segments have been done

Returns:
true if the segment can be read

getFileLength

protected abstract Long getFileLength()
Returns the file length of the object

Returns:
file length of the object

createSegment

protected abstract InputStream createSegment()
                                      throws IOException
Creates an InputStream from the current segment

Returns:
the inputstream
Throws:
IOException - thrown if error occurs

close

public abstract void close()
                    throws IOException
Closes the underlying File, if appropriate

Throws:
IOException - thrown if error occurs


Copyright © 2012-2014 42 BV. All Rights Reserved.