Interface Ftp

All Superinterfaces:
java.lang.AutoCloseable, java.io.Closeable
All Known Implementing Classes:
Ftps, Sftp

public interface Ftp
extends java.io.Closeable
ftp
simple ftp class
Author:
PARK Yong Seo
See Also:
com.jcraft.jsch.JSch
  • Method Summary

    Modifier and Type Method Description
    default boolean cd​(java.lang.String pathname)
    change directory
    same method path(), cd()
    void close()
    close
    boolean delete​(java.lang.String filename)
    remove file
    static Ftp ftp​(java.lang.String host, int port)  
    static Ftp ftp​(java.lang.String host, int port, java.lang.String user, java.lang.String pass)  
    static Ftp ftp​(Ftps.FtpOpener opener)  
    static Ftp ftps​(boolean isImplicit, java.lang.String host, int port)  
    static Ftp ftps​(boolean isImplicit, java.lang.String host, int port, java.lang.String user, java.lang.String pass)  
    static Ftp ftps​(Ftps.FtpsOpener opener)  
    boolean hasDirectory​(java.lang.String directoryName)
    has directory in path
    boolean hasFile​(java.lang.String filename)
    has file in path
    java.util.List<java.lang.String> listDirectories()
    get directory list in now path
    java.util.List<java.lang.String> listDirectories​(java.util.function.Predicate<java.lang.String> filter)
    get directory list in now path
    java.util.List<java.lang.String> listFiles()
    get file list in now path
    java.util.List<java.lang.String> listFiles​(java.util.function.Predicate<java.lang.String> filter)
    get file list in now path
    boolean mkdir​(java.lang.String createDirectoryName)
    make new directory
    java.lang.String path()
    get now path
    same method path(), pwd()
    boolean path​(java.lang.String pathname)
    move path
    same method path(), cd()
    default java.lang.String pwd()
    print working directory
    same method path(), pwd()
    boolean recv​(java.lang.String remoteFilename, java.io.File localFile)
    recv file
    default void recv​(java.util.List<java.lang.String> remoteFilenameList, java.io.File localDirectory)
    recv file list
    default boolean send​(java.io.File localFile)
    send file
    boolean send​(java.lang.String saveFilename, java.io.File localFile)
    send file
    static Ftp sftp​(java.lang.String host, int port)  
    static Ftp sftp​(java.lang.String host, int port, java.lang.String user, java.lang.String pass)  
    static Ftp sftp​(java.lang.String host, int port, java.lang.String user, Sftp.SftpOpener opener)  
  • Method Details

    • ftp

      static Ftp ftp​(Ftps.FtpOpener opener) throws java.io.IOException
      Throws:
      java.io.IOException
    • ftp

      static Ftp ftp​(java.lang.String host, int port, java.lang.String user, java.lang.String pass) throws java.io.IOException
      Throws:
      java.io.IOException
    • ftp

      static Ftp ftp​(java.lang.String host, int port) throws java.io.IOException
      Throws:
      java.io.IOException
    • ftps

      static Ftp ftps​(Ftps.FtpsOpener opener) throws java.io.IOException
      Throws:
      java.io.IOException
    • ftps

      static Ftp ftps​(boolean isImplicit, java.lang.String host, int port, java.lang.String user, java.lang.String pass) throws java.io.IOException
      Throws:
      java.io.IOException
    • ftps

      static Ftp ftps​(boolean isImplicit, java.lang.String host, int port) throws java.io.IOException
      Throws:
      java.io.IOException
    • sftp

      static Ftp sftp​(java.lang.String host, int port, java.lang.String user, Sftp.SftpOpener opener) throws java.io.IOException
      Throws:
      java.io.IOException
    • sftp

      static Ftp sftp​(java.lang.String host, int port, java.lang.String user, java.lang.String pass) throws java.io.IOException
      Throws:
      java.io.IOException
    • sftp

      static Ftp sftp​(java.lang.String host, int port) throws java.io.IOException
      Throws:
      java.io.IOException
    • cd

      default boolean cd​(java.lang.String pathname) throws java.io.IOException
      change directory
      same method path(), cd()
      Parameters:
      pathname -
      Returns:
      Throws:
      java.io.IOException
    • path

      boolean path​(java.lang.String pathname) throws java.io.IOException
      move path
      same method path(), cd()
      Parameters:
      pathname -
      Returns:
      Throws:
      java.io.IOException
    • path

      java.lang.String path() throws java.io.IOException
      get now path
      same method path(), pwd()
      Returns:
      Throws:
      java.io.IOException
    • pwd

      default java.lang.String pwd() throws java.io.IOException
      print working directory
      same method path(), pwd()
      Returns:
      Throws:
      java.io.IOException
    • listFiles

      java.util.List<java.lang.String> listFiles​(java.util.function.Predicate<java.lang.String> filter) throws java.io.IOException
      get file list in now path
      Parameters:
      filter - file name filter
      Returns:
      Throws:
      java.io.IOException
    • listFiles

      java.util.List<java.lang.String> listFiles() throws java.io.IOException
      get file list in now path
      Returns:
      Throws:
      java.io.IOException
    • listDirectories

      java.util.List<java.lang.String> listDirectories​(java.util.function.Predicate<java.lang.String> filter) throws java.io.IOException
      get directory list in now path
      Parameters:
      filter - file name filter
      Returns:
      Throws:
      java.io.IOException
    • listDirectories

      java.util.List<java.lang.String> listDirectories() throws java.io.IOException
      get directory list in now path
      Returns:
      Throws:
      java.io.IOException
    • hasFile

      boolean hasFile​(java.lang.String filename) throws java.io.IOException
      has file in path
      Parameters:
      filename -
      Returns:
      Throws:
      java.io.IOException
    • hasDirectory

      boolean hasDirectory​(java.lang.String directoryName) throws java.io.IOException
      has directory in path
      Parameters:
      directoryName -
      Returns:
      Throws:
      java.io.IOException
    • delete

      boolean delete​(java.lang.String filename) throws java.io.IOException
      remove file
      Parameters:
      filename -
      Returns:
      Throws:
      java.io.IOException
    • send

      boolean send​(java.lang.String saveFilename, java.io.File localFile) throws java.io.IOException
      send file
      Parameters:
      saveFilename -
      localFile -
      Returns:
      Throws:
      java.io.IOException
    • send

      default boolean send​(java.io.File localFile) throws java.io.IOException
      send file
      Parameters:
      localFile -
      Returns:
      Throws:
      java.io.IOException
    • recv

      boolean recv​(java.lang.String remoteFilename, java.io.File localFile) throws java.io.IOException
      recv file
      Parameters:
      remoteFilename -
      localFile -
      Returns:
      Throws:
      java.io.IOException
    • recv

      default void recv​(java.util.List<java.lang.String> remoteFilenameList, java.io.File localDirectory) throws java.io.IOException
      recv file list
      Parameters:
      remoteFilenameList -
      localDirectory -
      Throws:
      java.io.IOException
    • mkdir

      boolean mkdir​(java.lang.String createDirectoryName) throws java.io.IOException
      make new directory
      Parameters:
      createDirectoryName -
      Returns:
      Throws:
      java.io.IOException
    • close

      void close()
      close
      Specified by:
      close in interface java.lang.AutoCloseable
      Specified by:
      close in interface java.io.Closeable