In addition to the normal methods defined by {@link Map}, this class offers the following convenience methods:
Inspired by {@link com.sun.net.httpserver.Headers}. @author Arjen Poutsma @since 3.0
102103104105106107108109110111112113
public void setRestTemplate(RestTemplate rt) { this.rt = rt; } private HttpHeaders getHeaders() { HttpHeaders headers = new HttpHeaders(); headers.add("Accept", "application/json"); headers.add("Content-Type", "application/json"); headers.add("Zencoder-Api-Key", api_key); headers.add("User-Agent", "zencoder-java-2.0"); return headers; }
131132133134135136137138139140141
throw new ZencoderClientException( "Unable to serialize ZencoderCreateJobRequest as JSON", e); } HttpHeaders headers = getHeaders(); @SuppressWarnings("rawtypes") HttpEntity entity = new HttpEntity<String>(body, headers); ResponseEntity<String> response = null; try {
193194195196197198199200201202203
per_page = 50; } url = url + "?page=" + page + "&per_page=" + per_page; } HttpHeaders headers = getHeaders(); @SuppressWarnings("rawtypes") HttpEntity entity = new HttpEntity<String>("", headers); ResponseEntity<String> response = null; try {
242243244245246247248249250251252
* @throws ZencoderClientException */ public ZencoderJobDetail getZencoderJob(String id) throws ZencoderClientException { String url = api_url + "/jobs/" + id + ".json"; HttpHeaders headers = getHeaders(); @SuppressWarnings("rawtypes") HttpEntity entity = new HttpEntity<String>("", headers); ResponseEntity<String> response = null; try {
283284285286287288289290291292293
* @throws ZencoderClientException */ public ZencoderJobProgress getJobProgress(String id) throws ZencoderClientException { String url = api_url + "/jobs/" + id + "/progress.json"; HttpHeaders headers = getHeaders(); @SuppressWarnings("rawtypes") HttpEntity entity = new HttpEntity<String>("", headers); ResponseEntity<String> response = null; try {
324325326327328329330331332333334
* @throws ZencoderClientException */ public ZencoderInputOutputProgress getInputProgress(String id) throws ZencoderClientException { String url = api_url + "/inputs/" + id + "/progress.json"; HttpHeaders headers = getHeaders(); @SuppressWarnings("rawtypes") HttpEntity entity = new HttpEntity<String>("", headers); ResponseEntity<String> response = null; try {
365366367368369370371372373374375
* @throws ZencoderClientException */ public ZencoderInputOutputProgress getOutputProgress(String id) throws ZencoderClientException { String url = api_url + "/outputs/" + id + "/progress.json"; HttpHeaders headers = getHeaders(); @SuppressWarnings("rawtypes") HttpEntity entity = new HttpEntity<String>("", headers); ResponseEntity<String> response = null; try {
407408409410411412413414415416417
* @throws ZencoderClientException */ public ZencoderMediaFile getInputDetails(String id) throws ZencoderClientException { String url = api_url + "/inputs/" + id + ".json"; HttpHeaders headers = getHeaders(); @SuppressWarnings("rawtypes") HttpEntity entity = new HttpEntity<String>("", headers); ResponseEntity<String> response = null; try {
450451452453454455456457458459460
* @throws ZencoderClientException */ public ZencoderMediaFile getOutputDetails(String id) throws ZencoderClientException { String url = api_url + "/outputs/" + id + ".json"; HttpHeaders headers = getHeaders(); @SuppressWarnings("rawtypes") HttpEntity entity = new HttpEntity<String>("", headers); ResponseEntity<String> response = null; try {
492493494495496497498499500501502
* @throws ZencoderClientException */ public void resubmitJob(String id) throws ZencoderClientException { String url = api_url + "/jobs/" + id + "/resubmit.json"; HttpHeaders headers = getHeaders(); @SuppressWarnings("rawtypes") HttpEntity entity = new HttpEntity<String>("", headers); try { rt.exchange(