private static class LegacyLogManagerImpl.SequencedFileNameMatcher
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
(package private) java.lang.String |
ext
The file extension, might not be present.
|
(package private) java.lang.String |
nameNoSequenceNoExt
The name prefix before the sequence number.
|
(package private) java.util.regex.Pattern |
sequencedNamePattern
Pattern to match the sequence number in the log file name.
|
| Constructor and Description |
|---|
SequencedFileNameMatcher(java.io.File file)
Package private constructor to create an instance of SequencedFileNameMatcher.
|
SequencedFileNameMatcher(java.lang.String nameNoSequenceNoExt,
java.lang.String ext)
Package private constructor to create an instance of SequencedFileNameMatcher.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) int |
findSequenceNumber(java.lang.String fileName)
Finds the sequence number in the log file name that matches the pattern.
|
(package private) java.lang.String |
getNoSequenceName()
Returns the file name without the number sequence, keeping the base name (prefix) and ext if
available.
|
private void |
initialize(java.lang.String nameNoSequenceNoExt,
java.lang.String ext)
Common logic for all constructors.
|
(package private) boolean |
matches(java.lang.String fileName)
Returns if the file name matches the pattern of the matcher.
|
java.lang.String nameNoSequenceNoExt
java.lang.String ext
java.util.regex.Pattern sequencedNamePattern
SequencedFileNameMatcher(java.io.File file)
file - The file.SequencedFileNameMatcher(java.lang.String nameNoSequenceNoExt,
java.lang.String ext)
nameNoSequenceNoExt - The file name without number sequence and extension.ext - The file extension.boolean matches(java.lang.String fileName)
fileName - The file name to match against the pattern.true if the file name matches the pattern of the matcher,
false otherwise.int findSequenceNumber(java.lang.String fileName)
fileName - The file name to match against the pattern.0 if no match found.java.lang.String getNoSequenceName()
private void initialize(java.lang.String nameNoSequenceNoExt,
java.lang.String ext)
nameNoSequenceNoExt - The file name without number sequence and extension.ext - The file extension.