org.eclipse.ecf.provider.filetransfer.outgoing
Class AbstractUrlConnectionOutgoingFileTransfer

java.lang.Object
  extended by org.eclipse.ecf.provider.filetransfer.outgoing.AbstractOutgoingFileTransfer
      extended by org.eclipse.ecf.provider.filetransfer.outgoing.AbstractUrlConnectionOutgoingFileTransfer
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, IIdentifiable, IFileTransfer, IOutgoingFileTransfer, ISendFileTransferContainerAdapter, ISendFileTransfer

public abstract class AbstractUrlConnectionOutgoingFileTransfer
extends AbstractOutgoingFileTransfer
implements ISendFileTransfer


Field Summary
protected  int httpVersion
           
protected  long lastModifiedTime
           
protected  int responseCode
           
protected  java.lang.String responseMessage
           
protected  java.net.URLConnection urlConnection
           
 
Fields inherited from class org.eclipse.ecf.provider.filetransfer.outgoing.AbstractOutgoingFileTransfer
buff_length, bytesSent, connectContext, DEFAULT_BUF_LENGTH, done, exception, fileTransferInfo, job, listener, localFileContents, options, proxy, remoteFileContents, remoteFileID, remoteFileURL
 
Constructor Summary
AbstractUrlConnectionOutgoingFileTransfer()
           
 
Method Summary
protected abstract  void connect()
          Setup and connect.
 int getResponseCode()
           
protected  void hardClose()
           
protected  boolean isConnected()
           
protected  void openStreams()
          Open incoming and outgoing streams associated with this file transfer.
protected  void setupProxy(Proxy proxy2)
           
 
Methods inherited from class org.eclipse.ecf.provider.filetransfer.outgoing.AbstractOutgoingFileTransfer
addListener, cancel, createJobName, fireSendStartEvent, fireTransferSendDataEvent, fireTransferSendDoneEvent, getAdapter, getBytesSent, getException, getFileLength, getFileTransferInfo, getFinalStatus, getID, getListener, getOptions, getOutgoingNamespace, getPercentComplete, getRemoteFileURL, isDone, removeListener, selectProxyFromProxies, sendOutgoingRequest, sendOutgoingRequest, setConnectContextForAuthentication, setInputStream, setOutputStream, setProxy, setupAndScheduleJob, setupProxies
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ecf.filetransfer.ISendFileTransferContainerAdapter
addListener, getOutgoingNamespace, removeListener, sendOutgoingRequest, sendOutgoingRequest, setConnectContextForAuthentication, setProxy
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

urlConnection

protected java.net.URLConnection urlConnection

lastModifiedTime

protected long lastModifiedTime

httpVersion

protected int httpVersion

responseCode

protected int responseCode

responseMessage

protected java.lang.String responseMessage
Constructor Detail

AbstractUrlConnectionOutgoingFileTransfer

public AbstractUrlConnectionOutgoingFileTransfer()
Method Detail

connect

protected abstract void connect()
                         throws java.io.IOException
Setup and connect. Subclasses should override as appropriate. After calling is complete, the urlConnection member variable should be non-null, and ready to have it's getInputStream() method called.

Throws:
java.io.IOException - if the connection cannot be opened.

isConnected

protected boolean isConnected()

getResponseCode

public int getResponseCode()

setupProxy

protected void setupProxy(Proxy proxy2)
Specified by:
setupProxy in class AbstractOutgoingFileTransfer
Parameters:
proxy2 - the ECF proxy to setup

openStreams

protected void openStreams()
                    throws SendFileTransferException
Description copied from class: AbstractOutgoingFileTransfer
Open incoming and outgoing streams associated with this file transfer. Subclasses must implement this method to open input and output streams. The remoteFileContents and localFileContent must be non-null after successful completion of the implementation of this method.

Specified by:
openStreams in class AbstractOutgoingFileTransfer
Throws:
SendFileTransferException

hardClose

protected void hardClose()
Overrides:
hardClose in class AbstractOutgoingFileTransfer