src/org/ohmage/request/mobility/MobilityUploadRequest.java
@Override
	public void respond(HttpServletRequest httpRequest, HttpServletResponse httpResponse) {
		LOGGER.info("Responding to the Mobility upload request.");
		
		if(isFailed()) {
			super.respond(httpRequest, httpResponse, null);
		}
		else if(streamUploadRequest.isFailed()) {
			streamUploadRequest.respond(httpRequest, httpResponse);
		}
		else {
			JSONObject response = new JSONObject();
			
			try {
				response.put(JSON_KEY_INVALID_INDICIES, invalidPointsMap);
				response.put(JSON_KEY_ACCEPTED_IDS, validIds);
			}
			catch(JSONException e) {
				LOGGER.error("Error creating the response.", e);
				setFailed();
			}
			
			super.respond(httpRequest, httpResponse, response);
		}
	}
/**
	 * Responds to the request with either a success message or a failure 
	 * message that contains an error code and an error text.
	 */
Responds to the request with either a success message or a failure
message that contains an error code and an error text.
Responds to the request with either a success message or a failure message that contains an error code and an error text .
@Override
	public void respond(HttpServletRequest httpRequest, HttpServletResponse httpResponse) {
		LOGGER.info("Responding to the Mobility upload request.");
		if(isFailed()) {
			super.respond(httpRequest, httpResponse, null);
		}
		else if(streamUploadRequest.isFailed()) {
			streamUploadRequest.respond(httpRequest, httpResponse);
		}
		else {
			JSONObject response = new JSONObject();
			try {
				response.put(JSON_KEY_INVALID_INDICIES, invalidPointsMap);
				response.put(JSON_KEY_ACCEPTED_IDS, validIds);
			}
			catch(JSONException e) {
				LOGGER.error("Error creating the response.", e);
				setFailed();
			}
			super.respond(httpRequest, httpResponse, response);
		}
	}
@ Override public void respond ( HttpServletRequest httpRequest , HttpServletResponse httpResponse ) { LOGGER . info ( "Responding to the Mobility upload request." ) ; if ( isFailed ( ) ) { super . respond ( httpRequest , httpResponse , null ) ; } else if ( streamUploadRequest . isFailed ( ) ) { streamUploadRequest . respond ( httpRequest , httpResponse ) ; } else { JSONObject response = new JSONObject ( ) ; try { response . put ( JSON_KEY_INVALID_INDICIES , invalidPointsMap ) ; response . put ( JSON_KEY_ACCEPTED_IDS , validIds ) ; } catch ( JSONException e ) { LOGGER . error ( "Error creating the response." , e ) ; setFailed ( ) ; } super . respond ( httpRequest , httpResponse , response ) ; } }
Responds to the request with either a success message or a failure
 message that contains an error code and an error text.
Responds to the request with either a success message or a failure message that contains an error code and an error text .