Example usage for org.springframework.http MediaType ALL_VALUE

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

Introduction

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

Prototype

String ALL_VALUE

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

Click Source Link

Document

A String equivalent of MediaType#ALL .

Usage

From source file:nl.dtls.fairdatapoint.api.controller.utils.HttpHeadersUtils.java

public static RDFFormat getRequestedAcceptHeader(String contentType) {
    RDFFormat requesetedContentType = null;
    if (contentType == null || contentType.isEmpty()) {
        requesetedContentType = RDFFormat.TURTLE;
    } else if (contentType.contentEquals(RDFFormat.TURTLE.getDefaultMIMEType())
            || contentType.contains(MediaType.ALL_VALUE)) {
        requesetedContentType = RDFFormat.TURTLE;
    } else if (contentType.contentEquals(RDFFormat.JSONLD.getDefaultMIMEType())) {
        requesetedContentType = RDFFormat.JSONLD;
    } else if (contentType.contentEquals(RDFFormat.N3.getDefaultMIMEType())) {
        requesetedContentType = RDFFormat.N3;
    } else if (contentType.contentEquals(RDFFormat.RDFXML.getDefaultMIMEType())) {
        requesetedContentType = RDFFormat.RDFXML;
    }//from   w  ww  .j  a va 2s.c o m
    return requesetedContentType;
}

From source file:org.cloudfoundry.identity.uaa.error.ConvertingExceptionView.java

@Override
public String getContentType() {
    return MediaType.ALL_VALUE;
}

From source file:com.jl.crm.web.OAuthTest.java

@Test
public void formLoginForContentAll() throws Exception {
    request.addHeader("Accept", MediaType.ALL_VALUE);

    springSecurityFilterChain.doFilter(request, response, chain);

    assertEquals(HttpServletResponse.SC_MOVED_TEMPORARILY, response.getStatus());
}

From source file:springfox.documentation.spring.web.scanners.MediaTypeReader.java

@Override
public void apply(OperationContext context) {

    Set<String> consumesList = toSet(context.consumes());
    Set<String> producesList = toSet(context.produces());

    if (handlerMethodHasFileParameter(context)) {
        consumesList = newHashSet(MediaType.MULTIPART_FORM_DATA_VALUE);
    }/*  ww w .j a v  a2 s .  c o m*/

    if (producesList.isEmpty()) {
        producesList.add(MediaType.ALL_VALUE);
    }
    if (consumesList.isEmpty()) {
        consumesList.add(MediaType.APPLICATION_JSON_VALUE);
    }
    context.operationBuilder().consumes(consumesList);
    context.operationBuilder().produces(producesList);
}

From source file:com.ns.retailmgr.controller.ShopController.java

@ApiOperation(consumes = MediaType.ALL_VALUE, produces = MediaType.APPLICATION_JSON_VALUE, httpMethod = "GET", value = "", response = ShopDetails.class, notes = "Find List of nearby shops for the provided latitude and longitude", responseContainer = "List")
@ApiImplicitParams({/* ww  w.  java2s  .  co  m*/
        @ApiImplicitParam(name = "customerLatitude", value = "Laitude of Customer's location", required = true, dataType = "string", paramType = "query"),
        @ApiImplicitParam(name = "customerLongitude", value = "Longitude of Customer's location", required = true, dataType = "string", paramType = "query") })
@RequestMapping(method = RequestMethod.GET, consumes = MediaType.ALL_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> getNearByShops(
        @RequestParam(required = true, name = "customerLatitude") String customerLatitude,
        @RequestParam(required = true, name = "customerLongitude") String customerLongitude) {
    LOGGER.debug("Started endpoint method {}, params - {}", "getNearByShops",
            new Object[] { customerLatitude, customerLongitude });
    List<ShopDetails> output = null;
    try {
        output = shopService.findShopNearByLatLng(customerLatitude, customerLongitude);
    } catch (Exception e) {
        LOGGER.error("Exception {}", e);
        return new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
    }
    return new ResponseEntity<>(output, HttpStatus.OK);
}

From source file:com.gisnet.cancelacion.web.controller.JCobranzaController.java

@RequestMapping(value = "/archivoss/{id}/{filename}", method = RequestMethod.GET, produces = MediaType.ALL_VALUE)
public @ResponseBody byte[] descargar(@PathVariable long id, @PathVariable String filename,
        HttpServletResponse response) {//  w w  w.j a  v  a  2 s .c  om
    FindResponse<CancelacionArchivoInfo> file = cancelacionArchivoService.findBy(new FindByRequest(id));
    if (file.getInfo() == null) {
        response.setContentType("text/plain");
        return "Archivo no encontrado.".getBytes();
    }
    CancelacionArchivoInfo info = file.getInfo();
    response.setContentType(info.getMimetype());
    return info.getArchivo();
}

From source file:org.cateproject.test.functional.mockmvc.HtmlUnitRequestBuilder.java

private void contentType(MockHttpServletRequest result) {
    String contentType = header("Content-Type");
    result.setContentType(contentType == null ? MediaType.ALL_VALUE.toString() : contentType);
}