Package com.sshtools.common.sshd.config
Class Entry
java.lang.Object
com.sshtools.common.sshd.config.Entry
- Direct Known Subclasses:
GlobalConfiguration
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String,SshdConfigFileEntry> protected SshdConfigFile -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBeginingComment(CommentEntry commentEntry) Will add a comment entry at the beginning of the section.voidaddCommentForEntry(String key, CommentEntry commentEntry) intaddEntry(int index, SshdConfigFileEntry sshdConfigFileEntry) This method would add entry after the past valid entry.voidvoidappendEntry(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.voiddeleteEntry(String key) Will delete the entry for the given key.voiddeleteEntry(String key, String value) Will delete the entry for the given key and value (when multiple values exist).voidvoidentryMatches(String key, Collection<String> patterns) protected <T> TexecuteRead(Callable<T> callable) protected <T> TexecuteWrite(Callable<T> callable) findEntryAtIndex(int index) intfindEntryIndex(String key) findKeyValueEntry(String key) protected ListOrderedMap<String,SshdConfigFileEntry> voidupdateEntry(String key, String value) Will update the value for the given key with new entry
-
Field Details
-
sshdConfigFile
-
keyEntries
-
-
Constructor Details
-
Entry
-
-
Method Details
-
getKeyEntriesOrderedMap
-
getValue
-
getEntry
-
getKeyEntries
-
find
-
enable
-
disable
-
findKeyValueEntry
-
findEntryIndex
-
findEntryAtIndex
-
addCommentForEntry
-
addBeginingComment
Will add a comment entry at the beginning of the section.- Parameters:
commentEntry-
-
updateEntry
Will update the value for the given key with new entry- Parameters:
key-entry-
-
deleteEntry
Will delete the entry for the given key.- Parameters:
key-
-
deleteEntry
Will delete the entry for the given key and value (when multiple values exist).- Parameters:
key-
-
addEntry
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
-
appendEntry
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
-
getBlankEntryKey
-
getCommentEntryKey
-
executeRead
-
executeWrite
-