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

  • 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.
    • getEstablishedOrConnect

      private Connection getEstablishedOrConnect(String hostname, int port) throws IOException
      Throws:
      IOException
    • connectionClosed

      private void connectionClosed(ConnectionClosed event)
    • close

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

      public ServerList getServerList()