use of org.eclipse.ecf.example.collab.share.io.FileTransferParams in project ecf by eclipse.
the class ChatComposite method readStreamAndSend.
protected void readStreamAndSend(java.io.InputStream local, String fileName, Date startDate, ID target, final boolean launch) {
try {
final ID eclipseStageID = IDFactory.getDefault().createStringID(org.eclipse.ecf.example.collab.share.EclipseCollabSharedObject.ID);
final java.io.BufferedInputStream ins = new java.io.BufferedInputStream(local);
final java.io.File remoteFile = new File((new File(fileName)).getName());
final FileTransferParams sp = new FileTransferParams(remoteFile, getChunkPreference(), getDelayPreference(), null, true, -1, null);
final Object[] args = { view, target, ins, sp, eclipseStageID };
// Do it
new Thread(new Runnable() {
public void run() {
if (launch) {
ChatComposite.this.view.createObject(null, org.eclipse.ecf.example.collab.share.io.EclipseFileTransferAndLaunch.class.getName(), new String[] { FileSenderUI.class.getName(), ID.class.getName(), java.io.InputStream.class.getName(), FileTransferParams.class.getName(), ID.class.getName() }, args);
} else {
ChatComposite.this.view.createObject(null, org.eclipse.ecf.example.collab.share.io.EclipseFileTransfer.class.getName(), new String[] { FileSenderUI.class.getName(), ID.class.getName(), java.io.InputStream.class.getName(), FileTransferParams.class.getName(), ID.class.getName() }, args);
}
}
}, "FileRepObject creator").start();
} catch (final Exception e) {
if (this.view.lch != null)
// $NON-NLS-1$
this.view.lch.chatException(e, "readStreamAndSend()");
}
}
Aggregations