org.eclipse.jgit.transport
Class UploadPack

java.lang.Object
  extended by org.eclipse.jgit.transport.UploadPack

public class UploadPack
extends java.lang.Object

Implements the server side of a fetch connection, transmitting objects.


Constructor Summary
UploadPack(Repository copyFrom)
          Create a new pack upload for an open repository.
 
Method Summary
 Repository getRepository()
           
 RevWalk getRevWalk()
           
 int getTimeout()
           
 void setTimeout(int seconds)
          Set the timeout before willing to abort an IO call.
 void upload(java.io.InputStream input, java.io.OutputStream output, java.io.OutputStream messages)
          Execute the upload task on the socket.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UploadPack

public UploadPack(Repository copyFrom)
Create a new pack upload for an open repository.

Parameters:
copyFrom - the source repository.
Method Detail

getRepository

public final Repository getRepository()
Returns:
the repository this receive completes into.

getRevWalk

public final RevWalk getRevWalk()
Returns:
the RevWalk instance used by this connection.

getTimeout

public int getTimeout()
Returns:
timeout (in seconds) before aborting an IO operation.

setTimeout

public void setTimeout(int seconds)
Set the timeout before willing to abort an IO call.

Parameters:
seconds - number of seconds to wait (with no data transfer occurring) before aborting an IO read or write operation with the connected client.

upload

public void upload(java.io.InputStream input,
                   java.io.OutputStream output,
                   java.io.OutputStream messages)
            throws java.io.IOException
Execute the upload task on the socket.

Parameters:
input - raw input to read client commands from. Caller must ensure the input is buffered, otherwise read performance may suffer.
output - response back to the Git network client, to write the pack data onto. Caller must ensure the output is buffered, otherwise write performance may suffer.
messages - secondary "notice" channel to send additional messages out through. When run over SSH this should be tied back to the standard error channel of the command execution. For most other network connections this should be null.
Throws:
java.io.IOException