Package adams.gui.chooser
Class SmbRemoteDirectorySetup
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.chooser.SmbRemoteDirectorySetup
-
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,SMBSessionProvider
,OptionHandler
,PasswordSupporter
,SizeOfHandler
,RemoteDirectorySetup
,Serializable
public class SmbRemoteDirectorySetup extends AbstractOptionHandler implements SMBSessionProvider, RemoteDirectorySetup, PasswordSupporter
For configuring an SMB connection and remote directory.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected com.hierynomus.smbj.SMBClient
m_Client
the SMB client.protected com.hierynomus.smbj.connection.Connection
m_Connection
the SMB connection.protected String
m_Domain
the domain.protected String
m_Host
the host.protected boolean
m_ListHidden
whether to list hidden files/dirs.protected BasePassword
m_Password
the SMB password to use.protected String
m_RemoteDir
the directory to list.protected com.hierynomus.smbj.session.Session
m_Session
the SMB authentication context.protected String
m_Share
the share to access.protected String
m_User
the SMB user to use.-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description SmbRemoteDirectorySetup()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanUp()
Cleans up after the execution has finished.protected void
cleanUpSmb()
Cleans up the SMB components.void
defineOptions()
Adds options to the internal list of options.String
domainTipText()
Returns the tip text for this property.String
getDomain()
Returns the domain to connect to.String
getHost()
Returns the host to connect to.boolean
getListHidden()
Returns whether to list hidden files/dirs.BasePassword
getPassword()
Returns the SMB password to use.String
getRemoteDir()
Returns the remote directory.com.hierynomus.smbj.session.Session
getSession()
Returns the SMB authentication.String
getShare()
Returns the share to access.String
getUser()
Returns the SMB user name to use.String
globalInfo()
Returns a string describing the object.String
hostTipText()
Returns the tip text for this property.String
listHiddenTipText()
Returns the tip text for this property.com.hierynomus.smbj.session.Session
newSession()
Returns a new SMB authentication.String
passwordTipText()
Returns the tip text for this property.String
remoteDirTipText()
Returns the tip text for this property.boolean
requiresInitialization()
Returns whether the setup needs to be configured by the user or whether it can be used straight away.protected void
reset()
Resets the scheme.void
setDomain(String value)
Sets the domain to connect to.void
setHost(String value)
Sets the host to connect to.void
setListHidden(boolean value)
Sets whether to list hidden files/dirs.void
setPassword(BasePassword value)
Sets the SMB password to use.void
setRemoteDir(String value)
Sets the remote directory.void
setShare(String value)
Sets the share to access.void
setUser(String value)
Sets the SMB user to use.String
shareTipText()
Returns the tip text for this property.String
userTipText()
Returns the tip text for this property.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
m_Domain
protected String m_Domain
the domain.
-
m_Share
protected String m_Share
the share to access.
-
m_User
protected String m_User
the SMB user to use.
-
m_Password
protected BasePassword m_Password
the SMB password to use.
-
m_Host
protected String m_Host
the host.
-
m_RemoteDir
protected String m_RemoteDir
the directory to list.
-
m_ListHidden
protected boolean m_ListHidden
whether to list hidden files/dirs.
-
m_Client
protected transient com.hierynomus.smbj.SMBClient m_Client
the SMB client.
-
m_Connection
protected transient com.hierynomus.smbj.connection.Connection m_Connection
the SMB connection.
-
m_Session
protected transient com.hierynomus.smbj.session.Session m_Session
the SMB authentication context.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
reset
protected void reset()
Resets the scheme.- Overrides:
reset
in classAbstractOptionHandler
-
setHost
public void setHost(String value)
Sets the host to connect to.- Parameters:
value
- the host name/ip
-
getHost
public String getHost()
Returns the host to connect to.- Returns:
- the host name/ip
-
hostTipText
public String hostTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setDomain
public void setDomain(String value)
Sets the domain to connect to.- Parameters:
value
- the domain name
-
getDomain
public String getDomain()
Returns the domain to connect to.- Returns:
- the domain name
-
domainTipText
public String domainTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setShare
public void setShare(String value)
Sets the share to access.- Parameters:
value
- the share
-
getShare
public String getShare()
Returns the share to access.- Returns:
- the share
-
shareTipText
public String shareTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setUser
public void setUser(String value)
Sets the SMB user to use.- Parameters:
value
- the user name
-
getUser
public String getUser()
Returns the SMB user name to use.- Returns:
- the user name
-
userTipText
public String userTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setPassword
public void setPassword(BasePassword value)
Sets the SMB password to use.- Specified by:
setPassword
in interfacePasswordSupporter
- Parameters:
value
- the password
-
getPassword
public BasePassword getPassword()
Returns the SMB password to use.- Specified by:
getPassword
in interfacePasswordSupporter
- Returns:
- the password
-
passwordTipText
public String passwordTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setRemoteDir
public void setRemoteDir(String value)
Sets the remote directory.- Parameters:
value
- the remote directory
-
getRemoteDir
public String getRemoteDir()
Returns the remote directory.- Returns:
- the remote directory.
-
remoteDirTipText
public String remoteDirTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setListHidden
public void setListHidden(boolean value)
Sets whether to list hidden files/dirs.- Parameters:
value
- true if to list
-
getListHidden
public boolean getListHidden()
Returns whether to list hidden files/dirs.- Returns:
- true if to list
-
listHiddenTipText
public String listHiddenTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getSession
public com.hierynomus.smbj.session.Session getSession()
Returns the SMB authentication.- Specified by:
getSession
in interfaceSMBSessionProvider
- Returns:
- the SMB authentication, null if not connected
-
newSession
public com.hierynomus.smbj.session.Session newSession()
Returns a new SMB authentication.- Specified by:
newSession
in interfaceSMBSessionProvider
- Returns:
- the SMB authentication
-
requiresInitialization
public boolean requiresInitialization()
Returns whether the setup needs to be configured by the user or whether it can be used straight away.- Specified by:
requiresInitialization
in interfaceRemoteDirectorySetup
- Returns:
- true if user needs to configure first
-
cleanUpSmb
protected void cleanUpSmb()
Cleans up the SMB components.
-
cleanUp
public void cleanUp()
Cleans up after the execution has finished. Also removes graphical components.- Specified by:
cleanUp
in interfaceCleanUpHandler
-
-