Package com.sshtools.common.sshd.config
Class Entry.AbstractEntryBuilder<T>
java.lang.Object
com.sshtools.common.sshd.config.Entry.AbstractEntryBuilder<T>
- Direct Known Subclasses:
MatchEntry.MatchEntryBuilder,SshdConfigFile.SshdConfigFileBuilder
- Enclosing class:
- Entry
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SshdConfigFileCursorprotected SshdConfigFileprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddBeginingComment(CommentEntry commentEntry) Will add a comment entry at the beginning of the section.addComment(String comment) Will add a comment entry at current location.addCommentForEntry(String key, CommentEntry commentEntry) Will add a comment entry before the entry with the given key.addCommentForEntry(String key, String comment) Will add a comment entry before the entry with the given key.addEntry(SshdConfigFileEntry sshdConfigFileEntry) Will add entry after last non blank, non comment entry in a section (Global, Match) Note: Use while operating on file after loading it.appendEntry(SshdConfigFileEntry sshdConfigFileEntry) Will add entry to the end of section.cursor()deleteEntry(String key) Will delete the entry for the given key.entryMatches(String key, Collection<String> patterns) entryMatches(String key, Collection<String> patterns, Entry.AbstractEntryBuilder.Result<Boolean> result) findEntryAtIndex(int index) intfindEntryIndex(String key) findEntryIndex(String key, Entry.AbstractEntryBuilder.Result<Integer> result) findEntryToEdit(String key) protected abstract EntryupdateEntry(String key, String value) Will update the value for the given key with new entry.
-
Field Details
-
cursor
-
pointer
protected int pointer -
file
-
-
Constructor Details
-
AbstractEntryBuilder
public AbstractEntryBuilder()
-
-
Method Details
-
getManagedInstance
-
updateEntry
Will update the value for the given key with new entry.- Parameters:
key-entry-- Returns:
-
deleteEntry
Will delete the entry for the given key.- Parameters:
key-- Returns:
-
addComment
Will add a comment entry at current location.- Parameters:
commentEntry-- Returns:
-
addCommentForEntry
Will add a comment entry before the entry with the given key. Note: Multiple calls will add calls in reverse.addCommentForEntry(....1) addCommentForEntry(....2) addCommentForEntry(....3)Above will end up as first 3, then 2 finally 1. All entries are made at index at which the entry is found.- Parameters:
comment-
-
addCommentForEntry
Will add a comment entry before the entry with the given key. Note: Multiple calls will add calls in reverse.addCommentForEntry(....1) addCommentForEntry(....2) addCommentForEntry(....3)Above will end up as first 3, then 2 finally 1. All entries are made at index at which the entry is found.- Parameters:
commentEntry-
-
addBeginingComment
Will add a comment entry at the beginning of the section. Note: Multiple calls will add calls in reverse.addBeginingComment(....1) addBeginingComment(....2) addBeginingComment(....3)Above will end up as first 3, then 2 finally 1. All entries are made at index 0.- Parameters:
commentEntry-
-
addEntry
Will add entry after last non blank, non comment entry in a section (Global, Match) Note: Use while operating on file after loading it.- Parameters:
sshdConfigFileEntry-- Returns:
-
appendEntry
Will add entry to the end of section. Note: Use while writing a file.- Parameters:
sshdConfigFileEntry-- Returns:
-
findEntry
-
findEntry
-
entryMatches
public T entryMatches(String key, Collection<String> patterns, Entry.AbstractEntryBuilder.Result<Boolean> result) -
entryMatches
-
findEntryIndex
-
findEntryAtIndex
-
findEntryIndex
-
findEntryToEdit
-
resetPointer
-
cursor
-