Class Entry

java.lang.Object
com.sshtools.common.sshd.config.Entry
Direct Known Subclasses:
GlobalConfiguration

public class Entry extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • getKeyEntriesOrderedMap

      protected ListOrderedMap<String,SshdConfigFileEntry> getKeyEntriesOrderedMap()
    • getValue

      public String getValue(String key)
    • getEntry

      public SshdConfigFileEntry getEntry(String key)
    • getKeyEntries

      public Map<String,SshdConfigFileEntry> getKeyEntries()
    • find

      public SshdConfigFileEntry find(String key)
    • enable

      public void enable(String key, String value)
    • disable

      public void disable(String key)
    • findKeyValueEntry

      public SshdConfigKeyValueEntry findKeyValueEntry(String key)
    • findEntryIndex

      public int findEntryIndex(String key)
    • findEntryAtIndex

      public SshdConfigFileEntry findEntryAtIndex(int index)
    • addCommentForEntry

      public void addCommentForEntry(String key, CommentEntry commentEntry)
    • addBeginingComment

      public void addBeginingComment(CommentEntry commentEntry)
      Will add a comment entry at the beginning of the section.
      Parameters:
      commentEntry -
    • updateEntry

      public void updateEntry(String key, String value)
      Will update the value for the given key with new entry
      Parameters:
      key -
      entry -
    • deleteEntry

      public void deleteEntry(String key)
      Will delete the entry for the given key.
      Parameters:
      key -
    • deleteEntry

      public void deleteEntry(String key, String value)
      Will delete the entry for the given key and value (when multiple values exist).
      Parameters:
      key -
    • addEntry

      public int addEntry(int index, SshdConfigFileEntry sshdConfigFileEntry)
      This method would add entry after the past valid entry. If the section ends with a series of blank and comment lines. It will walk backwards from the end of the section, find the valid entry index and add the entry post that.
      Use this when editing an already existing file.
      Parameters:
      index -
      sshdConfigFileEntry -
    • append

      public void append(String key, String value)
    • appendEntry

      public void appendEntry(SshdConfigFileEntry sshdConfigFileEntry)
      This will simply keep adding entries in a section, will not make any decision to check to add new entry after a valid entry.
      Use this to create a fresh file.
      Parameters:
      sshdConfigFileEntry -
    • entryMatches

      public Boolean entryMatches(String key, Collection<String> patterns)
    • getBlankEntryKey

      public String getBlankEntryKey()
    • getCommentEntryKey

      public String getCommentEntryKey()
    • executeRead

      protected <T> T executeRead(Callable<T> callable)
    • executeWrite

      protected <T> T executeWrite(Callable<T> callable)