public class FileNameDateTimeParser extends java.lang.Object implements SnapshotDateTimeParser
Elements may be separated by a space, dash, or colon. The date and time may additionally be separated by a 'T'. Only the year must have all digits, others may omit padding zeroes.
Valid file name examples:
2019-06-15
2019-06-15 10:20:30
2019-06-15 10:20:30
2019-06-15T10:20:30
2019 06 15 10 20 30
2019-06-15-10-20-30
2019-6-1-1-2-3
Modifier and Type | Method and Description |
---|---|
java.time.ZonedDateTime |
detectDateTime(java.nio.file.Path path)
Attempt to detect an ZonedDateTime from a path.
|
static FileNameDateTimeParser |
getInstance() |
public static FileNameDateTimeParser getInstance()
@Nullable public java.time.ZonedDateTime detectDateTime(java.nio.file.Path path)
SnapshotDateTimeParser
The path is not guaranteed to exist.
detectDateTime
in interface SnapshotDateTimeParser
path
- the path