@Override public ProbeResult probeContent(StorageConnector connector) throws DataStoreException { return new ProbeResult(false, null, null); }
/** * Returns the value to be returned by {@link StoreProvider#probeContent(StorageConnector)} * for the given WKT keyword. This method changes the case to match the one used in the keywords map, * then verify if the keyword that we found is one of the known WKT keywords. Keywords with the "CRS" * suffix are WKT 2 while keywords with the "CS" suffix are WKT 1. */ @Override protected ProbeResult forKeyword(final char[] keyword, final int length) { if (length >= MIN_LENGTH) { int pos = length; int version = 1; keyword[ 0] &= ~0x20; // Make upper-case (valid only for characters in the a-z range). keyword[--pos] &= ~0x20; if ((keyword[--pos] &= ~0x20) == 'R') { keyword[--pos] &= ~0x20; // Make "CRS" suffix in upper case (otherwise, was "CS" suffix) version = 2; } while (--pos != 0) { if (keyword[pos] != '_') { keyword[pos] |= 0x20; // Make lower-case. } } if (keywords.contains(String.valueOf(keyword, 0, length))) { return new ProbeResult(true, MIME_TYPE, Version.valueOf(version)); } } return ProbeResult.UNSUPPORTED_STORAGE; } }
/** * Returns the value to be returned by {@link StoreProvider#probeContent(StorageConnector)} * for the given WKT keyword. This method changes the case to match the one used in the keywords map, * then verify if the keyword that we found is one of the known WKT keywords. Keywords with the "CRS" * suffix are WKT 2 while keywords with the "CS" suffix are WKT 1. */ @Override protected ProbeResult forKeyword(final char[] keyword, final int length) { if (length >= MIN_LENGTH) { int pos = length; int version = 1; keyword[ 0] &= ~0x20; // Make upper-case (valid only for characters in the a-z range). keyword[--pos] &= ~0x20; if ((keyword[--pos] &= ~0x20) == 'R') { keyword[--pos] &= ~0x20; // Make "CRS" suffix in upper case (otherwise, was "CS" suffix) version = 2; } while (--pos != 0) { if (keyword[pos] != '_') { keyword[pos] |= 0x20; // Make lower-case. } } if (keywords.contains(String.valueOf(keyword, 0, length))) { return new ProbeResult(true, MIME_TYPE, Version.valueOf(version)); } } return ProbeResult.UNSUPPORTED_STORAGE; } }
switch (buffer.getShort(p + Short.BYTES)) { case GeoTIFF.CLASSIC: case GeoTIFF.BIG_TIFF: return new ProbeResult(true, MIME_TYPE, VERSION);
/** * Wraps the call to {@link #getMimeType()} for catching {@link IOException} and for * instantiating the {@link ProbeResult}. */ final ProbeResult probeContent() throws DataStoreException { boolean isSupported = true; String mimeType; try { mimeType = getMimeType(); } catch (IOException e) { throw new DataStoreException(e); } if (mimeType == null) { if (insufficientBytes) { return ProbeResult.INSUFFICIENT_BYTES; } isSupported = false; mimeType = StoreProvider.MIME_TYPE; } return new ProbeResult(isSupported, mimeType, null); } }
/** * Wraps the call to {@link #getMimeType()} for catching {@link IOException} and for * instantiating the {@link ProbeResult}. */ final ProbeResult probeContent() throws DataStoreException { boolean isSupported = true; String mimeType; try { mimeType = getMimeType(); } catch (IOException e) { throw new DataStoreException(e); } if (mimeType == null) { if (insufficientBytes) { return ProbeResult.INSUFFICIENT_BYTES; } isSupported = false; mimeType = StoreProvider.MIME_TYPE; } return new ProbeResult(isSupported, mimeType, null); } }
return new ProbeResult(isSupported, MIME_TYPE, Version.valueOf(version)); return isSupported ? new ProbeResult(true, MIME_TYPE, null) : ProbeResult.UNSUPPORTED_STORAGE;
return new ProbeResult(isSupported, MIME_TYPE, Version.valueOf(version)); return isSupported ? new ProbeResult(true, MIME_TYPE, null) : ProbeResult.UNSUPPORTED_STORAGE;