public static FeatureType isCdmrfEndpoint ( String endpoint ) throws IOException { HTTPSession httpClient = HTTPFactory . newSession ( endpoint ) ; String url = endpoint + "?req=featureType" ; // get the header try ( HTTPMethod method = HTTPFactory . Get ( httpClient , url ) ) { method . setFollowRedirects ( true ) ; int statusCode = method . execute ( ) ; if ( statusCode != 200 ) return null ; String content = method . getResponseAsString ( ) ; return FeatureType . getType ( content ) ; } catch ( Throwable t ) { t . printStackTrace ( ) ; return null ; } }
all CdmrFeatureDatasets must return their featureType - use as a fail - fast test of the endpoint