src/org/ohmage/jee/servlet/RequestServlet.java
@Override
	protected final void doGet(HttpServletRequest httpRequest, HttpServletResponse httpResponse) {
		if(RequestBuilder.getInstance().getApiAudioRead().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiConfigRead().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiImageRead().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiImageBatchZipRead().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiDocumentReadContents().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiVisualization().equals(httpRequest.getRequestURI()) |
				RequestBuilder.getInstance().getApiUserActivate().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiRegistrationRead().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiStreamRead().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiUserWhoAmI().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiOmhRead().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiSurveyResponseRead().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiVideoRead().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiMediaRead().equals(httpRequest.getRequestURI())
			) {
			
			processRequest(httpRequest, httpResponse);
		}
		else {
			LOGGER.info("GET attempted and denied.");
			try {
				httpResponse.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
			}
			catch(IOException e) {
				LOGGER.error("Error while attempting to respond.", e);
			}
			return;
		}
	}
/**
	 * Processes a GET request. Only certain APIs may make a GET request. This
	 * should be handled in a different way than hard-coding the allowed GET
	 * APIs. 
	 */
Processes a GET request. Only certain APIs may make a GET request. This
should be handled in a different way than hard-coding the allowed GET
APIs.
Processes a GET request . Only certain APIs may make a GET request . This should be handled in a different way than hard - coding the allowed GET APIs .
@Override
	protected final void doGet(HttpServletRequest httpRequest, HttpServletResponse httpResponse) {
		if(RequestBuilder.getInstance().getApiAudioRead().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiConfigRead().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiImageRead().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiImageBatchZipRead().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiDocumentReadContents().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiVisualization().equals(httpRequest.getRequestURI()) |
				RequestBuilder.getInstance().getApiUserActivate().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiRegistrationRead().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiStreamRead().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiUserWhoAmI().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiOmhRead().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiSurveyResponseRead().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiVideoRead().equals(httpRequest.getRequestURI()) ||
				RequestBuilder.getInstance().getApiMediaRead().equals(httpRequest.getRequestURI())
			) {
			processRequest(httpRequest, httpResponse);
		}
		else {
			LOGGER.info("GET attempted and denied.");
			try {
				httpResponse.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
			}
			catch(IOException e) {
				LOGGER.error("Error while attempting to respond.", e);
			}
			return;
		}
	}
@ Override protected final void doGet ( HttpServletRequest httpRequest , HttpServletResponse httpResponse ) { if ( RequestBuilder . getInstance ( ) . getApiAudioRead ( ) . equals ( httpRequest . getRequestURI ( ) ) || RequestBuilder . getInstance ( ) . getApiConfigRead ( ) . equals ( httpRequest . getRequestURI ( ) ) || RequestBuilder . getInstance ( ) . getApiImageRead ( ) . equals ( httpRequest . getRequestURI ( ) ) || RequestBuilder . getInstance ( ) . getApiImageBatchZipRead ( ) . equals ( httpRequest . getRequestURI ( ) ) || RequestBuilder . getInstance ( ) . getApiDocumentReadContents ( ) . equals ( httpRequest . getRequestURI ( ) ) || RequestBuilder . getInstance ( ) . getApiVisualization ( ) . equals ( httpRequest . getRequestURI ( ) ) | RequestBuilder . getInstance ( ) . getApiUserActivate ( ) . equals ( httpRequest . getRequestURI ( ) ) || RequestBuilder . getInstance ( ) . getApiRegistrationRead ( ) . equals ( httpRequest . getRequestURI ( ) ) || RequestBuilder . getInstance ( ) . getApiStreamRead ( ) . equals ( httpRequest . getRequestURI ( ) ) || RequestBuilder . getInstance ( ) . getApiUserWhoAmI ( ) . equals ( httpRequest . getRequestURI ( ) ) || RequestBuilder . getInstance ( ) . getApiOmhRead ( ) . equals ( httpRequest . getRequestURI ( ) ) || RequestBuilder . getInstance ( ) . getApiSurveyResponseRead ( ) . equals ( httpRequest . getRequestURI ( ) ) || RequestBuilder . getInstance ( ) . getApiVideoRead ( ) . equals ( httpRequest . getRequestURI ( ) ) || RequestBuilder . getInstance ( ) . getApiMediaRead ( ) . equals ( httpRequest . getRequestURI ( ) ) ) { processRequest ( httpRequest , httpResponse ) ; } else { LOGGER . info ( "GET attempted and denied." ) ; try { httpResponse . sendError ( HttpServletResponse . SC_METHOD_NOT_ALLOWED ) ; } catch ( IOException e ) { LOGGER . error ( "Error while attempting to respond." , e ) ; } return ; } }
Processes a GET request.
Processes a GET request .