List of usage examples for org.springframework.util MimeTypeUtils TEXT_PLAIN_VALUE
String TEXT_PLAIN_VALUE
To view the source code for org.springframework.util MimeTypeUtils TEXT_PLAIN_VALUE.
Click Source Link
From source file:com.reactivetechnologies.platform.rest.depre.SimpleHttpServerBean.java
/** * Send a text response with HTTP 400//from ww w .ja v a 2 s . c o m * @param message * @return */ protected static Response invalid(String message) { return newFixedLengthResponse(Status.BAD_REQUEST, MimeTypeUtils.TEXT_PLAIN_VALUE, message); }
From source file:com.reactivetechnologies.platform.rest.depre.SimpleHttpServerBean.java
/** * Send a text message with HTTP 500//w w w.java 2s .c o m * @param message * @return */ protected static Response error(String message) { return newFixedLengthResponse(Status.INTERNAL_ERROR, MimeTypeUtils.TEXT_PLAIN_VALUE, message); }
From source file:com.reactivetechnologies.platform.rest.depre.SimpleHttpServerBean.java
@Override public Response serve(IHTTPSession session) { Method m = session.getMethod(); switch (m) {// w ww. j a v a2 s . c o m case GET: return doGet(session); case POST: return doPost(session); default: return newFixedLengthResponse(Status.NOT_IMPLEMENTED, MimeTypeUtils.TEXT_PLAIN_VALUE, "HTTP " + m); } }
From source file:com.reactivetechnologies.platform.rest.depre.SimpleHttpServerBean.java
/** * Send a text message with HTTP 404//from ww w . jav a 2 s .c o m * @param message * @return */ protected static Response notFound(String message) { return newFixedLengthResponse(Status.NOT_FOUND, MimeTypeUtils.TEXT_PLAIN_VALUE, message); }
From source file:com.reactivetechnologies.platform.rest.depre.SimpleHttpServerBean.java
/** * Send a text message with HTTP 401/* w w w . ja va 2 s .c o m*/ * @param message * @return */ protected static Response unauthorized(String message) { return newFixedLengthResponse(Status.UNAUTHORIZED, MimeTypeUtils.TEXT_PLAIN_VALUE, message); }
From source file:com.reactivetechnologies.platform.rest.depre.SimpleHttpServerBean.java
/** * Send a text message with HTTP 403/*from w w w . j a v a2 s. c o m*/ * @param message * @return */ protected static Response forbidden(String message) { return newFixedLengthResponse(Status.FORBIDDEN, MimeTypeUtils.TEXT_PLAIN_VALUE, message); }
From source file:org.springframework.cloud.stream.binder.AbstractBinderTests.java
@Test public void testSendAndReceiveNoOriginalContentType() throws Exception { Binder binder = getBinder();// w ww .j av a2s.c om BindingProperties producerBindingProperties = createProducerBindingProperties(createProducerProperties()); DirectChannel moduleOutputChannel = createBindableChannel("output", producerBindingProperties); QueueChannel moduleInputChannel = new QueueChannel(); Binding<MessageChannel> producerBinding = binder.bindProducer("bar.0", moduleOutputChannel, producerBindingProperties.getProducer()); Binding<MessageChannel> consumerBinding = binder.bindConsumer("bar.0", "test", moduleInputChannel, createConsumerProperties()); binderBindUnbindLatency(); Message<?> message = MessageBuilder.withPayload("foo").build(); moduleOutputChannel.send(message); Message<?> inbound = receive(moduleInputChannel); assertThat(inbound).isNotNull(); assertThat(inbound.getPayload()).isEqualTo("foo"); assertThat(inbound.getHeaders().get(BinderHeaders.BINDER_ORIGINAL_CONTENT_TYPE)).isNull(); assertThat(inbound.getHeaders().get(MessageHeaders.CONTENT_TYPE)).isEqualTo(MimeTypeUtils.TEXT_PLAIN_VALUE); producerBinding.unbind(); consumerBinding.unbind(); }