org.netbeans.lib.collab
Interface ReceiverFileStreamingProfile

All Superinterfaces:
ReceiverStreamingProfile

public interface ReceiverFileStreamingProfile
extends ReceiverStreamingProfile

Since:
version 0.1

Field Summary
static int INTEGRITY_COMPROMISED
          The integrity of the streamed file was compromised.
static int INTEGRITY_OK
          The integrity of the streamed file was maintained.
static int INTEGRITY_UNKNOWN
          The integrity of the streamed file cannot be determined.
 
Method Summary
 void addOutput(java.io.File f)
          Used to store the streamed data into the file.
 int checkIntegrity()
          Checks the integrity of the file after the streaming is successfully completed.
 java.lang.String getDescription()
          Get the description associated with the stream
 byte[] getHash()
          Gets the MD5 hash of the file for the streaming
 long getLastModified()
          Gets the last modified date of the file being streamed
 long getLength()
          Gets the length of the file to be transferred
 java.lang.String getName()
          Get the name associated with this profile
 long getOffset()
          Gets the offset for the file transfer.
 void setLength(long length)
          Sets the length of the bytes from the offset that needs to be transferred.
 void setOffset(long offset)
          Sets the offset for the file transfer.
 long size()
          Gets the size of the file to be streamed
 
Methods inherited from interface org.netbeans.lib.collab.ReceiverStreamingProfile
addOutput, getMimeType
 

Field Detail

INTEGRITY_OK

public static final int INTEGRITY_OK
The integrity of the streamed file was maintained.

See Also:
Constant Field Values

INTEGRITY_COMPROMISED

public static final int INTEGRITY_COMPROMISED
The integrity of the streamed file was compromised.

See Also:
Constant Field Values

INTEGRITY_UNKNOWN

public static final int INTEGRITY_UNKNOWN
The integrity of the streamed file cannot be determined.

See Also:
Constant Field Values
Method Detail

getName

public java.lang.String getName()
Get the name associated with this profile

Returns:
The name of the file associated with the profile

getDescription

public java.lang.String getDescription()
Get the description associated with the stream

Returns:
Description

size

public long size()
Gets the size of the file to be streamed

Returns:
The size of the stream if it is defined otherwise returns -1

getHash

public byte[] getHash()
Gets the MD5 hash of the file for the streaming

Returns:
The MD5 hash

getLastModified

public long getLastModified()
Gets the last modified date of the file being streamed

Returns:
date The date on which the file was last modified

getOffset

public long getOffset()
Gets the offset for the file transfer.

Returns:
offset. The default value is 0.

setOffset

public void setOffset(long offset)
Sets the offset for the file transfer. The offset should be set before accepting the stream

Parameters:
offset - The offset from which the file should be streamed

getLength

public long getLength()
Gets the length of the file to be transferred

Returns:
length The length of bytes from the offset to be transferred. The default value is same as the file size.

setLength

public void setLength(long length)
Sets the length of the bytes from the offset that needs to be transferred. The length should be set before accepting the stream

Parameters:
length - The length of bytes from offset that needs to be transferred

addOutput

public void addOutput(java.io.File f)
Used to store the streamed data into the file.

Parameters:
f - The file where the data needs to be stored. If f represents a directory then a file will be created in that directory with name as returned by getName.

checkIntegrity

public int checkIntegrity()
Checks the integrity of the file after the streaming is successfully completed. The integrity is checked by comparing the hash value sent by the sender of the stream with the file being received. This method should be called only if the streamed data was stored in a file using the addOutput(java.io.File) method.

Returns:
The result of the integrity check as defined in ReceiverFileStreamingProfile
Throws:
java.lang.IllegalStateException - when this method is called before the streaming is successfully completed or when the streamed data was not stored into a file.