Package com.hierynomus.smbj
Class SMBClient
java.lang.Object
com.hierynomus.smbj.SMBClient
- All Implemented Interfaces:
Closeable
,AutoCloseable
Server Message Block Client API.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SMBEventBus
private SmbConfig
private Map
<String, Connection> static final int
The default TCP port for SMBprivate static final org.slf4j.Logger
private ServerList
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Connect to the host atConnect to the host atprivate void
connectionClosed
(ConnectionClosed event) private Connection
getEstablishedOrConnect
(String hostname, int port)
-
Field Details
-
DEFAULT_PORT
public static final int DEFAULT_PORTThe default TCP port for SMB- See Also:
-
connectionTable
-
serverList
-
config
-
bus
-
logger
private static final org.slf4j.Logger logger
-
-
Constructor Details
-
SMBClient
public SMBClient() -
SMBClient
-
SMBClient
-
-
Method Details
-
connect
Connect to the host athostname
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
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:
IOException
- If the connection could not be established.
-
getEstablishedOrConnect
- Throws:
IOException
-
connectionClosed
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
getServerList
-