public class SftpUrlConnection extends URLConnection
The default connection timeout is 30 seconds.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_TIMEOUT
The Constant default timeout in milliseconds.
|
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
Modifier | Constructor and Description |
---|---|
protected |
SftpUrlConnection(URL url)
Instantiates a new SFTP URL connection.
|
Modifier and Type | Method and Description |
---|---|
void |
connect() |
void |
disconnect()
Disconnect.
|
com.jcraft.jsch.ChannelSftp |
getChannel()
Gets the channel.
|
InputStream |
getInputStream() |
protected String |
getPath()
Gets the path.
|
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentLengthLong, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFieldLong, getHeaderFields, getIfModifiedSince, getLastModified, getOutputStream, getPermission, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toString
public static final int DEFAULT_TIMEOUT
protected SftpUrlConnection(URL url)
url
- the URLpublic void connect() throws IOException
connect
in class URLConnection
IOException
public void disconnect() throws IOException
IOException
- Signals that an I/O exception has occurred.public com.jcraft.jsch.ChannelSftp getChannel() throws IOException
IOException
public InputStream getInputStream() throws IOException
getInputStream
in class URLConnection
IOException
protected String getPath() throws SftpUrlException
SftpUrlException
- the SFTP URL exceptionCopyright © 2021. All rights reserved.