Class SftpUrlConnection

  • Direct Known Subclasses:
    Sftp3gppUrlConnection

    public class SftpUrlConnection
    extends java.net.URLConnection
    The class for managing SFTP URL Connection.

    The default connection timeout is 30 seconds.

    Author:
    Alejandro Galue
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEFAULT_TIMEOUT
      The Constant default timeout in milliseconds.
      • Fields inherited from class java.net.URLConnection

        allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected SftpUrlConnection​(java.net.URL url)
      Instantiates a new SFTP URL connection.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void connect()  
      void disconnect()
      Disconnect.
      com.jcraft.jsch.ChannelSftp getChannel()
      Gets the channel.
      java.io.InputStream getInputStream()  
      protected java.lang.String getPath()
      Gets the path.
      • Methods inherited from class java.net.URLConnection

        addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentLengthLong, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, 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, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • DEFAULT_TIMEOUT

        public static final int DEFAULT_TIMEOUT
        The Constant default timeout in milliseconds.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SftpUrlConnection

        protected SftpUrlConnection​(java.net.URL url)
        Instantiates a new SFTP URL connection.
        Parameters:
        url - the URL
    • Method Detail

      • connect

        public void connect()
                     throws java.io.IOException
        Specified by:
        connect in class java.net.URLConnection
        Throws:
        java.io.IOException
      • disconnect

        public void disconnect()
                        throws java.io.IOException
        Disconnect.
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.
      • getChannel

        public com.jcraft.jsch.ChannelSftp getChannel()
                                               throws java.io.IOException
        Gets the channel.
        Returns:
        the channel
        Throws:
        java.io.IOException
      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Overrides:
        getInputStream in class java.net.URLConnection
        Throws:
        java.io.IOException