Package org.apache.sis.storage.landsat
Class LandsatStoreProvider.Peek
java.lang.Object
org.apache.sis.internal.storage.wkt.FirstKeywordPeek
org.apache.sis.storage.landsat.LandsatStoreProvider.Peek
- Enclosing class:
LandsatStoreProvider
The object to use for verifying if the first keyword is the expected one.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
The part in process of being parsed:KEY
(0) for the"GROUP"
keyword,SEPARATOR
(1) for the'='
symbol,VALUE
(2) for the"L1_METADATA_FILE"
value.private static final String
The expected keyword after spaces removal.private static final String
The expected keyword after spaces removal.private int
private static final int
The part in process of being parsed:KEY
(0) for the"GROUP"
keyword,SEPARATOR
(1) for the'='
symbol,VALUE
(2) for the"L1_METADATA_FILE"
value.private static final int
The part in process of being parsed:KEY
(0) for the"GROUP"
keyword,SEPARATOR
(1) for the'='
symbol,VALUE
(2) for the"L1_METADATA_FILE"
value. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ProbeResult
forKeyword
(char[] keyword, int length) Returns the value to be returned byLandsatStoreProvider.probeContent(StorageConnector)
for the given keyword.protected Path
getAuxiliaryPath
(StorageConnector connector) Returns the path to the metadata file relative to the directory specified by user.protected int
isKeywordChar
(int c) ReturnsACCEPT
if the given character is valid for a keyword.protected boolean
isPostKeyword
(int c) Returnstrue
if the given first non-white character after the keyword is one of the expected characters.Methods inherited from class org.apache.sis.internal.storage.wkt.FirstKeywordPeek
probeContent, probeContent
-
Field Details
-
KEYWORD
The expected keyword after spaces removal.- See Also:
-
L1_KEYWORD
The expected keyword after spaces removal.- See Also:
-
KEY
private static final int KEYThe part in process of being parsed:KEY
(0) for the"GROUP"
keyword,SEPARATOR
(1) for the'='
symbol,VALUE
(2) for the"L1_METADATA_FILE"
value.
- See Also:
-
SEPARATOR
private static final int SEPARATORThe part in process of being parsed:KEY
(0) for the"GROUP"
keyword,SEPARATOR
(1) for the'='
symbol,VALUE
(2) for the"L1_METADATA_FILE"
value.
- See Also:
-
VALUE
private static final int VALUEThe part in process of being parsed:KEY
(0) for the"GROUP"
keyword,SEPARATOR
(1) for the'='
symbol,VALUE
(2) for the"L1_METADATA_FILE"
value.
- See Also:
-
part
private int part
-
-
Constructor Details
-
Peek
Peek()Creates a new instance.
-
-
Method Details
-
getAuxiliaryPath
Returns the path to the metadata file relative to the directory specified by user. This method is invoked if the user gave us the directory containing all Landsat files instead of the path to the metadata file.- Overrides:
getAuxiliaryPath
in classFirstKeywordPeek
- Parameters:
connector
- the connector from which to derive the path to auxiliary file to test.- Returns:
- path to the auxiliary file to test, or
null
if it does not exist. - Throws:
DataStoreException
- if an error occurred while determining the auxiliary file.
-
isKeywordChar
protected int isKeywordChar(int c) ReturnsACCEPT
if the given character is valid for a keyword.- Overrides:
isKeywordChar
in classFirstKeywordPeek
- Parameters:
c
- the character to test.- Returns:
FirstKeywordPeek.ACCEPT
if the given character should be accepted,FirstKeywordPeek.REJECT
if the character is not valid for the keyword, orFirstKeywordPeek.IGNORE
if the character should be accepted but not stored.
-
isPostKeyword
protected boolean isPostKeyword(int c) Returnstrue
if the given first non-white character after the keyword is one of the expected characters. This implementation expects the first letter of the"GROUP"
keyword for the first sub-group (unless there is a comment line between them).- Specified by:
isPostKeyword
in classFirstKeywordPeek
- Parameters:
c
- the first non-white character after the keyword, or -1 if we reached the end of stream.- Returns:
true
if the given character is one of the expected post-keyword characters.
-
forKeyword
Returns the value to be returned byLandsatStoreProvider.probeContent(StorageConnector)
for the given keyword.- Specified by:
forKeyword
in classFirstKeywordPeek
- Parameters:
keyword
- the first keyword found in the input. May benull
iflength
is zero.length
- number of valid characters inkeyword
.- Returns:
ProbeResult.SUPPORTED
if the given storage seems to be readable.
-