com.afrigis.services.impl.GenericResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
Core Java library to ease use of AfriGIS Services
package com.afrigis.services.impl;
import java.util.ArrayList;
import java.util.List;
import com.afrigis.services.exceptions.AfriGISServicesException;
/**
*
* Default "dumb" response.
*
*
* It will essentially slurp in the server response, and store it as a byte
* array. Retrieve it with {@link #getByteArray()}
*
*
* No further attempt is made to interpret or parse the receive response entity.
*
*
* @author hendrikc
* @see GenericRequest
*
*/
public class GenericResponse extends AbstractResponse {
/**
*
* This object has no specific entity object associated with it, so we have nothing to return.
*
* @return an empty list
*/
@Override
public List listResults() {
return new ArrayList<>();
}
@Override
protected void completeBuild(byte[] input) {
//Empty impl, we only give you bytes and a string
if (isError()) {
throw new AfriGISServicesException(getError());
}
}
}