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.CloseableServer Message Block Client API.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_PORTThe default TCP port for SMB
-
Method Summary
Modifier and Type Method Description voidclose()Connectionconnect(java.lang.String hostname)Connect to the host atConnectionconnect(java.lang.String hostname, int port)Connect to the host atServerListgetServerList()
-
-
-
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:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
getServerList
public ServerList getServerList()
-
-