Package com.hierynomus.smbj
Class SMBClient
- java.lang.Object
-
- com.hierynomus.smbj.SMBClient
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class SMBClient extends java.lang.Object implements java.io.Closeable
Server Message Block Client API.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_PORT
The default TCP port for SMB
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Connection
connect(java.lang.String hostname)
Connect to the host atConnection
connect(java.lang.String hostname, int port)
Connect to the host atServerList
getServerList()
-
-
-
Field Detail
-
DEFAULT_PORT
public static final int DEFAULT_PORT
The default TCP port for SMB- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SMBClient
public SMBClient()
-
SMBClient
public SMBClient(SmbConfig config)
-
SMBClient
public SMBClient(SmbConfig config, SMBEventBus bus)
-
-
Method Detail
-
connect
public Connection connect(java.lang.String hostname) throws java.io.IOException
Connect to the host athostname
on the default port (445)- Parameters:
hostname
- The hostname to connect to.- Returns:
- An established connection.
- Throws:
java.io.IOException
- If the connection could not be established.
-
connect
public Connection connect(java.lang.String hostname, int port) throws java.io.IOException
Connect to the host athostname
on the given port- Parameters:
hostname
- The hostname to connect to.port
- The port to connect to- Returns:
- An established connection.
- Throws:
java.io.IOException
- If the connection could not be established.
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
getServerList
public ServerList getServerList()
-
-