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 intThe 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 StringThe expected keyword after spaces removal.private static final StringThe expected keyword after spaces removal.private intprivate static final intThe 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 intThe 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 ProbeResultforKeyword(char[] keyword, int length) Returns the value to be returned byLandsatStoreProvider.probeContent(StorageConnector)for the given keyword.protected PathgetAuxiliaryPath(StorageConnector connector) Returns the path to the metadata file relative to the directory specified by user.protected intisKeywordChar(int c) ReturnsACCEPTif the given character is valid for a keyword.protected booleanisPostKeyword(int c) Returnstrueif 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:
getAuxiliaryPathin 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
nullif it does not exist. - Throws:
DataStoreException- if an error occurred while determining the auxiliary file.
-
isKeywordChar
protected int isKeywordChar(int c) ReturnsACCEPTif the given character is valid for a keyword.- Overrides:
isKeywordCharin classFirstKeywordPeek- Parameters:
c- the character to test.- Returns:
FirstKeywordPeek.ACCEPTif the given character should be accepted,FirstKeywordPeek.REJECTif the character is not valid for the keyword, orFirstKeywordPeek.IGNOREif the character should be accepted but not stored.
-
isPostKeyword
protected boolean isPostKeyword(int c) Returnstrueif 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:
isPostKeywordin classFirstKeywordPeek- Parameters:
c- the first non-white character after the keyword, or -1 if we reached the end of stream.- Returns:
trueif 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:
forKeywordin classFirstKeywordPeek- Parameters:
keyword- the first keyword found in the input. May benulliflengthis zero.length- number of valid characters inkeyword.- Returns:
ProbeResult.SUPPORTEDif the given storage seems to be readable.
-