Class SMBClient
java.lang.Object
com.hierynomus.smbj.SMBClient
- All Implemented Interfaces:
Closeable, AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SMBEventBusprivate SmbConfigprivate Map<String, Connection> static final intThe default TCP port for SMBprivate static final org.slf4j.Loggerprivate ServerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Connect to the host atConnect to the host atprivate voidconnectionClosed(ConnectionClosed event) private ConnectiongetEstablishedOrConnect(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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getServerList
-