Class SMBClient

java.lang.Object
com.hierynomus.smbj.SMBClient
All Implemented Interfaces:
Closeable, AutoCloseable

public class SMBClient extends Object implements Closeable
Server Message Block Client API.
  • Field Details

    • DEFAULT_PORT

      public static final int DEFAULT_PORT
      The default TCP port for SMB
      See Also:
  • Constructor Details

  • Method Details

    • connect

      public Connection connect(String hostname) throws IOException
      Connect to the host at
      hostname
      on the default port (445)
      Parameters:
      hostname - The hostname to connect to.
      Returns:
      An established connection.
      Throws:
      IOException - If the connection could not be established.
    • connect

      public Connection connect(String hostname, int port) throws IOException
      Connect to the host at
      hostname
      on the given port
      Parameters:
      hostname - The hostname to connect to.
      port - The port to connect to
      Returns:
      An established connection.
      Throws:
      IOException - If the connection could not be established.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • getServerList

      public ServerList getServerList()