Class TransportSftp
- java.lang.Object
-
- org.eclipse.jgit.transport.Transport
-
- org.eclipse.jgit.transport.TcpTransport
-
- org.eclipse.jgit.transport.SshTransport
-
- org.eclipse.jgit.transport.TransportSftp
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,WalkTransport
public class TransportSftp extends SshTransport implements WalkTransport
Transport over the non-Git aware SFTP (SSH based FTP) protocol.The SFTP transport does not require any specialized Git support on the remote (server side) repository. Object files are retrieved directly through secure shell's FTP protocol, making it possible to copy objects from a remote repository that is available over SSH, but whose remote host does not have Git installed.
Unlike the HTTP variant (see
TransportHttp
) we rely upon being able to list files in directories, as the SFTP protocol supports this function. By listing files through SFTP we can avoid needing to have currentobjects/info/packs
orinfo/refs
files on the remote repository and access the data directly, much as Git itself would.Concurrent pushing over this transport is not supported. Multiple concurrent push operations may cause confusion in the repository state.
- See Also:
WalkFetchConnection
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
TransportSftp.SftpObjectDB
-
Nested classes/interfaces inherited from class org.eclipse.jgit.transport.Transport
Transport.Operation
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static TransportProtocol
PROTO_SFTP
-
Fields inherited from class org.eclipse.jgit.transport.Transport
DEFAULT_FETCH_THIN, DEFAULT_PUSH_THIN, local, protocol, REFSPEC_PUSH_ALL, REFSPEC_TAGS, uri
-
-
Constructor Summary
Constructors Constructor Description TransportSftp(Repository local, URIish uri)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) FtpChannel
newSftp()
FetchConnection
openFetch()
Begins a new connection for fetching from the remote repository.PushConnection
openPush()
Begins a new connection for pushing into the remote repository.-
Methods inherited from class org.eclipse.jgit.transport.SshTransport
close, getSession, getSshSessionFactory, setSshSessionFactory
-
Methods inherited from class org.eclipse.jgit.transport.Transport
applyConfig, fetch, fetch, findRemoteRefUpdatesFor, findRemoteRefUpdatesFor, findRemoteRefUpdatesFor, findRemoteRefUpdatesFor, getCredentialsProvider, getFilterBlobLimit, getFilterSpec, getObjectChecker, getOptionReceivePack, getOptionUploadPack, getPackConfig, getPushOptions, getTagOpt, getTimeout, getTransportProtocols, getURI, isCheckFetchedObjects, isDryRun, isFetchThin, isPushAtomic, isPushThin, isRemoveDeletedRefs, open, open, open, open, open, open, open, openAll, openAll, openAll, openAll, openFetch, push, push, register, setCheckFetchedObjects, setCredentialsProvider, setDryRun, setFetchThin, setFilterBlobLimit, setFilterSpec, setObjectChecker, setOptionReceivePack, setOptionUploadPack, setPackConfig, setPushAtomic, setPushOptions, setPushThin, setRemoveDeletedRefs, setTagOpt, setTimeout, unregister
-
-
-
-
Field Detail
-
PROTO_SFTP
static final TransportProtocol PROTO_SFTP
-
-
Constructor Detail
-
TransportSftp
TransportSftp(Repository local, URIish uri)
-
-
Method Detail
-
openFetch
public FetchConnection openFetch() throws TransportException
Begins a new connection for fetching from the remote repository.If the transport has no local repository, the fetch connection can only be used for reading remote refs.
- Specified by:
openFetch
in classTransport
- Returns:
- a fresh connection to fetch from the remote repository.
- Throws:
TransportException
- the remote connection could not be established.
-
openPush
public PushConnection openPush() throws TransportException
Begins a new connection for pushing into the remote repository.- Specified by:
openPush
in classTransport
- Returns:
- a fresh connection to push into the remote repository.
- Throws:
TransportException
- the remote connection could not be established
-
newSftp
FtpChannel newSftp() throws java.io.IOException
- Throws:
java.io.IOException
-
-