private OWS determineOWSByPathQuirk( HttpServletRequest request ) throws OWSException { OWS ows = null; String pathInfo = request.getPathInfo(); if ( pathInfo != null ) { // remove start "/" String serviceId; // nice hack to work around the most stupid WFS 1.1.0 CITE tests // I'm sure there are a bazillion clients around that send out broken URLs, then validate the exception // responses, see the error of their ways and then send a proper request... if ( pathInfo.indexOf( "#" ) != -1 ) { serviceId = pathInfo.substring( 1, pathInfo.indexOf( "#" ) ); } else if ( pathInfo.indexOf( "=" ) != -1 ) { serviceId = pathInfo.substring( 1, pathInfo.indexOf( "=" ) ); } else { serviceId = pathInfo.substring( 1 ); } ows = workspace.getNewWorkspace().getResource( OWSProvider.class, serviceId ); if ( ows == null && serviceConfiguration.isSingleServiceConfigured() ) { ows = serviceConfiguration.getSingleConfiguredService(); } if ( ows == null ) { String msg = "No service with identifier '" + serviceId + "' available."; throw new OWSException( msg, NOT_FOUND ); } } return ows; }
private OWS determineOWSByPath( HttpServletRequest request ) throws OWSException { OWS ows = null; String pathInfo = request.getPathInfo(); if ( pathInfo != null ) { // remove start "/" String serviceId = pathInfo.substring( 1 ); ows = workspace.getNewWorkspace().getResource( OWSProvider.class, serviceId ); if ( ows == null && serviceConfiguration.isSingleServiceConfigured() ) { ows = serviceConfiguration.getSingleConfiguredService(); } if ( ows == null ) { String msg = "No service with identifier '" + serviceId + "' available."; throw new OWSException( msg, NOT_FOUND ); } } return ows; }