|
Remote System Explorer DataStore Release 3.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.dstore.core.model.ByteStreamHandler
public class ByteStreamHandler
The ByteStreamHandler class is used to abstract file read and write operations across the network. By default this is used for sending and receiving files on the client and the server. The class can be extended if the default byte stream implementations are not sufficient for a particular platform or use.
If ByteStreamHandler is extended, you need to tell the DataStore to use the
extended implementation. To do that, call DataStore.setByteStreamHandler(ByteStreamHandler)
.
Field Summary | |
---|---|
protected DataStore |
_dataStore
|
protected DataElement |
_log
|
protected static String |
FILEMSG_REMOTE_SAVE_FAILED
|
Constructor Summary | |
---|---|
ByteStreamHandler(DataStore dataStore,
DataElement log)
Contructor |
Method Summary | |
---|---|
protected DataElement |
findStatusFor(String remotePath)
|
String |
getId()
Returns the unique ID for this bytestream handler |
protected void |
internalSendAppendBytes(String path,
byte[] bytes,
int size,
boolean binary)
Called by sendBytes to either append the bytes to a local file or transmit
them and append them to a remote file. |
protected void |
internalSendBytes(String path,
byte[] bytes,
int size,
boolean binary)
Called by sendBytes to either save the bytes to a local file or transmit
them to a remote file. |
void |
receiveAppendedBytes(String remotePath,
byte[] buffer,
int size,
boolean binary)
Append a bytes to a file at a specified location. |
void |
receiveBytes(String remotePath,
byte[] buffer,
int size,
boolean binary)
Save a file in the specified location. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DataStore _dataStore
protected DataElement _log
protected static final String FILEMSG_REMOTE_SAVE_FAILED
Constructor Detail |
---|
public ByteStreamHandler(DataStore dataStore, DataElement log)
dataStore
- the DataStore instanceMethod Detail |
---|
public String getId()
IByteStreamHandler
getId
in interface IByteStreamHandler
public void receiveBytes(String remotePath, byte[] buffer, int size, boolean binary)
receiveBytes
in interface IByteStreamHandler
remotePath
- the path where to save the filebuffer
- the bytes to insert in the filesize
- the number of bytes to insertbinary
- indicates whether to save the bytes as binary or textpublic void receiveAppendedBytes(String remotePath, byte[] buffer, int size, boolean binary)
receiveAppendedBytes
in interface IByteStreamHandler
remotePath
- the path where to save the filebuffer
- the bytes to append in the filesize
- the number of bytes to append in the filebinary
- indicates whether to save the bytes as binary or textprotected void internalSendBytes(String path, byte[] bytes, int size, boolean binary)
sendBytes
to either save the bytes to a local file or transmit
them to a remote file.
path
- the path of the filebytes
- the bytes of the filesize
- the size of the filebinary
- indicates whether the bytes are to be sent as binary or textprotected void internalSendAppendBytes(String path, byte[] bytes, int size, boolean binary)
sendBytes
to either append the bytes to a local file or transmit
them and append them to a remote file.
path
- the path of the filebytes
- the bytes of the filesize
- the size of the filebinary
- indicates whether the bytes are to be sent as binary or textprotected DataElement findStatusFor(String remotePath)
|
Remote System Explorer DataStore Release 3.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |