Example usage for org.springframework.http MediaType ALL

List of usage examples for org.springframework.http MediaType ALL

Introduction

In this page you can find the example usage for org.springframework.http MediaType ALL.

Prototype

MediaType ALL

To view the source code for org.springframework.http MediaType ALL.

Click Source Link

Document

Public constant media type that includes all media ranges (i.e.

Usage

From source file:com.boundlessgeo.geoserver.api.converters.ResourceMessageConverter.java

public ResourceMessageConverter() {
    super(MediaType.ALL);
}

From source file:com.boundlessgeo.geoserver.api.converters.YsldMessageConverter.java

public YsldMessageConverter() {
    super(MediaType.ALL);
}

From source file:cn.cuizuoli.appranking.http.converter.JsoupHttpMessageConverter.java

public JsoupHttpMessageConverter(Charset defaultCharset) {
    super(new MediaType("text", "html", defaultCharset), MediaType.ALL);
    this.defaultCharset = defaultCharset;
    this.availableCharsets = new ArrayList<Charset>(Charset.availableCharsets().values());
}

From source file:com.develcom.cliente.Cliente.java

public void buscarArchivo() throws FileNotFoundException, IOException {

    CodDecodArchivos cda = new CodDecodArchivos();
    RestTemplate restTemplate = new RestTemplate();
    HttpHeaders headers = new HttpHeaders();
    //        Bufer bufer = new Bufer();
    byte[] buffer = null;
    ResponseEntity<byte[]> response;

    restTemplate.getMessageConverters().add(new ByteArrayHttpMessageConverter());
    headers.setAccept(Arrays.asList(MediaType.ALL));
    HttpEntity<String> entity = new HttpEntity<>(headers);

    response = restTemplate.exchange(//  w  w  w .j  a  va  2s  .c o m
            "http://localhost:8080/ServicioDW4J/expediente/buscarFisicoDocumento/21593", HttpMethod.GET, entity,
            byte[].class);

    if (response.getStatusCode().equals(HttpStatus.OK)) {
        buffer = response.getBody();
        FileOutputStream output = new FileOutputStream(new File("c:/documentos/archivo.cod"));
        IOUtils.write(response.getBody(), output);
        cda.decodificar("c:/documentos/archivo.cod", "c:/documentos/archivo.pdf");
    }

}

From source file:com.develcom.reafolder.ClienteBajaArchivo.java

public void buscarArchivo() throws FileNotFoundException, IOException {

    CodDecodArchivos cda = new CodDecodArchivos();
    RestTemplate restTemplate = new RestTemplate();
    HttpHeaders headers = new HttpHeaders();
    Bufer bufer = new Bufer();
    byte[] buffer = null;
    ResponseEntity<byte[]> response;

    restTemplate.getMessageConverters().add(new ByteArrayHttpMessageConverter());
    headers.setAccept(Arrays.asList(MediaType.ALL));
    HttpEntity<String> entity = new HttpEntity<>(headers);

    response = restTemplate.exchange(// w w  w  .  j a v a  2 s.co m
            "http://localhost:8080/ServicioDW4J/expediente/buscarFisicoDocumento/21593", HttpMethod.GET, entity,
            byte[].class);

    if (response.getStatusCode().equals(HttpStatus.OK)) {
        buffer = response.getBody();
        FileOutputStream output = new FileOutputStream(new File("c:/documentos/archivo.cod"));
        IOUtils.write(response.getBody(), output);
        cda.decodificar("c:/documentos/archivo.cod", "c:/documentos/archivo.pdf");
    }

}

From source file:org.cloudfoundry.caldecott.server.converter.ByteBufferHttpMessageConverter.java

public ByteBufferHttpMessageConverter() {
    super(new MediaType("application", "octet-stream"), MediaType.ALL);
}

From source file:cz.muni.fi.mushroomhunter.restclient.LocationCreateSwingWorker.java

@Override
protected Void doInBackground() throws Exception {
    LocationDto locationDto = new LocationDto();
    locationDto.setName(restClient.getTfLocationName().getText());
    locationDto.setDescription(restClient.getTfLocationDescription().getText());
    locationDto.setNearCity(restClient.getTfLocationNearCity().getText());

    HttpHeaders headers = new HttpHeaders();
    headers.setContentType(MediaType.APPLICATION_JSON);
    List<MediaType> mediaTypeList = new ArrayList<>();
    mediaTypeList.add(MediaType.ALL);
    headers.setAccept(mediaTypeList);// ww w .  j  a  v a2  s  .  co m

    ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
    String json = ow.writeValueAsString(locationDto);

    RestTemplate restTemplate = new RestTemplate();

    String plainCreds = RestClient.USER_NAME + ":" + RestClient.PASSWORD;
    byte[] plainCredsBytes = plainCreds.getBytes();
    byte[] base64CredsBytes = Base64.encodeBase64(plainCredsBytes);
    String base64Creds = new String(base64CredsBytes);

    headers.add("Authorization", "Basic " + base64Creds);
    HttpEntity request = new HttpEntity(json, headers);

    Long[] result = restTemplate.postForObject(RestClient.SERVER_URL + "pa165/rest/location", request,
            Long[].class);

    RestClient.getLocationIDs().add(result[0]);
    return null;
}

From source file:com.eu.evaluation.server.mvc.UTF8StringHttpMessageConverter.java

/**
 * A constructor accepting a default charset to use if the requested content
 * type does not specify one.//from  w ww  .  j  a  v  a2  s.  c o  m
 */
public UTF8StringHttpMessageConverter(Charset defaultCharset) {
    super(new MediaType("text", "plain", defaultCharset), MediaType.ALL);
    this.defaultCharset = defaultCharset;
    this.availableCharsets = new ArrayList<Charset>(Charset.availableCharsets().values());
}

From source file:com.nextbook.config.ConfigurableStringHttpMessageConverter.java

public ConfigurableStringHttpMessageConverter() {
    super(new MediaType("text", "plain", StringHttpMessageConverter.DEFAULT_CHARSET), MediaType.ALL);
    defaultCharset = StringHttpMessageConverter.DEFAULT_CHARSET;
    this.availableCharsets = new ArrayList<Charset>(Charset.availableCharsets().values());
}

From source file:org.craftercms.search.utils.StringHttpMessageConverterExtended.java

public StringHttpMessageConverterExtended() {
    super(new MediaType("text", "plain", DEFAULT_CHARSET), MediaType.ALL);
    this.availableCharsets = new ArrayList<Charset>(Charset.availableCharsets().values());
}