agave-apps/apps-core/src/main/java/org/iplantc/service/apps/util/ServiceUtils.java
/**
	 * Used to wrap all output from the service in a JSON object with two
	 * attributes "status" and "message." the former is success or failure. The
	 * latter is the output from a service invocation or the error message.
	 * 
	 * @param status the stats result of the request. "success" or "error"
	 * @param message the message ton include in the response
	 * @param json the json string to wrap in a success message wrapper
	 * @return the wrapped json result
	 */
Used to wrap all output from the service in a JSON object with two
attributes "status" and "message." the former is success or failure. The
latter is the output from a service invocation or the error message.

@param status the stats result of the request. "success" or "error"
@param message the message ton include in the response
@param json the json string to wrap in a success message wrapper
@return the wrapped json result
Used to wrap all output from the service in a JSON object with two attributes " status " and " message . " the former is success or failure . The latter is the output from a service invocation or the error message . @param status the stats result of the request . " success " or " error " @param message the message ton include in the response @param json the json string to wrap in a success message wrapper @return the wrapped json result
private static String wrapOutput(String status, String message, String json)
	{
		JSONWriter writer = new JSONStringer();
		try
		{
			writer.object().key("status").value(status).key("message").value(
					message).key("result").value(json).endObject();
		}
		catch (Exception e)
		{
			try
			{
				writer.object().key("status").value("error").key("message")
						.value(e.getMessage()).endObject();
			}
			catch (Exception e1)
			{
			}
		}
		return writer.toString();
	}
private static String wrapOutput ( String status , String message , String json ) { JSONWriter writer = new JSONStringer ( ) ; try { writer . object ( ) . key ( "status" ) . value ( status ) . key ( "message" ) . value ( message ) . key ( "result" ) . value ( json ) . endObject ( ) ; } catch ( Exception e ) { try { writer . object ( ) . key ( "status" ) . value ( "error" ) . key ( "message" ) . value ( e . getMessage ( ) ) . endObject ( ) ; } catch ( Exception e1 ) { } } return writer . toString ( ) ; }
Used to wrap all output from the service in a JSON object with two
 attributes "status" and "message."
Used to wrap all output from the service in a JSON object with two attributes " status " and " message . "