Class SmbDirectoryLister

    • Field Detail

      • m_Host

        protected String m_Host
        the SMB host.
      • m_Domain

        protected String m_Domain
        the SMB domain.
      • m_User

        protected String m_User
        the SMB user to use.
      • m_Password

        protected BasePassword m_Password
        the SMB password to use.
      • m_Authentication

        protected transient jcifs.smb.NtlmPasswordAuthentication m_Authentication
        the authentication to use.
    • Constructor Detail

      • SmbDirectoryLister

        public SmbDirectoryLister()
    • Method Detail

      • 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
      • setDomain

        public void setDomain​(String value)
        Sets the domain to use.
        Parameters:
        value - the domain
      • getDomain

        public String getDomain()
        Returns the domain to use.
        Returns:
        the domain
      • 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
      • setAuthenticationProvider

        public void setAuthenticationProvider​(SMBAuthenticationProvider value)
        Sets the authentication provider to use.
        Parameters:
        value - the provider
      • getAuthenticationProvider

        public SMBAuthenticationProvider getAuthenticationProvider()
        Returns the authentication provider to use.
        Returns:
        the provider
      • isLocal

        public boolean isLocal()
        Returns whether the directory lister operates locally or remotely.
        Specified by:
        isLocal in interface DirectoryLister
        Returns:
        true if local lister
      • hasParentDirectory

        public boolean hasParentDirectory()
        Returns whether the watch directory has a parent directory.
        Specified by:
        hasParentDirectory in interface DirectoryLister
        Returns:
        true if parent directory available
      • newDirectory

        public SmbFileObject newDirectory​(String dir)
        Returns a new directory relative to the watch directory.
        Specified by:
        newDirectory in interface DirectoryLister
        Parameters:
        dir - the directory name
        Returns:
        the new wrapper
      • newDirectory

        public SmbFileObject newDirectory​(String parent,
                                          String dir)
        Returns a new directory relative to the watch directory.
        Specified by:
        newDirectory in interface DirectoryLister
        Parameters:
        dir - the directory name
        parent - the parent directory
        Returns:
        the new wrapper
      • search

        protected void search​(jcifs.smb.SmbFile context,
                              List<SortContainer> files,
                              int depth)
                       throws Exception
        Performs the recursive search. Search goes deeper if != 0 (use -1 to start with for infinite search).
        Parameters:
        context - the context to use
        files - the files collected so far
        depth - the depth indicator (searched no deeper, if 0)
        Throws:
        Exception - if listing fails
      • search

        public List<SmbFileObject> search​(jcifs.smb.SmbFile context)
                                   throws Exception
        Returns the list of files/directories in the watched directory. In case the execution gets stopped, this method returns empty list.
        Parameters:
        context - the context
        Returns:
        the list of absolute file/directory names
        Throws:
        Exception - if listing fails
      • list

        public String[] list()
        Returns the list of files/directories in the watched directory. In case the execution gets stopped, this method returns a 0-length array.
        Specified by:
        list in interface DirectoryLister
        Returns:
        the list of absolute file/directory names
      • listObjects

        public SmbFileObject[] listObjects()
        Returns the list of files/directories in the watched directory. In case the execution gets stopped, this method returns a 0-length array.
        Specified by:
        listObjects in interface DirectoryLister
        Returns:
        the list of file/directory wrappers