}
return headerParams;
}
protected IParameterProvider createPathParamProvider() throws IOException {
SimpleParameterProvider pathParams = null;
if ( StringUtils.isEmpty( httpServletRequest.getPathInfo() ) ) {
httpServletResponse.sendError( 403 );
} else {
pathParams = new SimpleParameterProvider();
pathParams.setParameter( "query", httpServletRequest.getQueryString() ); //$NON-NLS-1$
List<String> mediaTypes = new ArrayList<String>( acceptableMediaTypes.size() );
for ( MediaType type : acceptableMediaTypes ) {
mediaTypes.add( type.toString() );
}
pathParams.setParameter( "acceptableMediaTypes", mediaTypes ); //$NON-NLS-1$
if ( mediaTypes.size() > 0 ) {
pathParams.setParameter( "contentType", acceptableMediaTypes.get( 0 ) ); //$NON-NLS-1$
}
pathParams.setParameter( "inputstream", httpServletRequest.getInputStream() ); //$NON-NLS-1$
pathParams.setParameter( "httpresponse", httpServletResponse ); //$NON-NLS-1$
pathParams.setParameter( "httprequest", httpServletRequest ); //$NON-NLS-1$
pathParams.setParameter( "remoteaddr", httpServletRequest.getRemoteAddr() ); //$NON-NLS-1$
if ( file != null ) {
pathParams.setParameter( "path", URLEncoder.encode( file.getPath(), "UTF-8" ) ); //$NON-NLS-1$
pathParams.setParameter( "file", file ); //$NON-NLS-1$
}
if ( command != null ) {
// path beyond that which matched the GeneratorResource
pathParams.setParameter( "cmd", command ); //$NON-NLS-1$
}
}
return pathParams;
}