This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mycompany.myappp.config; | |
import org.apache.commons.io.IOUtils; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.http.HttpInputMessage; | |
import org.springframework.http.HttpOutputMessage; | |
import org.springframework.http.MediaType; | |
import org.springframework.http.converter.AbstractHttpMessageConverter; | |
import org.springframework.http.converter.HttpMessageConverter; | |
import org.springframework.http.converter.HttpMessageNotReadableException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Collection; | |
import java.util.Iterator; | |
import java.util.concurrent.LinkedTransferQueue; | |
import java.util.concurrent.ThreadPoolExecutor; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.TransferQueue; | |
import java.util.concurrent.locks.ReentrantLock; | |
public final class ScalableThreadPoolExecutor extends ThreadPoolExecutor { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Adds support for application/octet-stream through a RestController using streams. | |
*/ | |
@Configuration | |
class WebConfig extends WebMvcConfigurationSupport { | |
@Override | |
protected void configureMessageConverters(List<HttpMessageConverter<?>> converters) { | |
converters.add(new AbstractHttpMessageConverter<InputStream>(MediaType.APPLICATION_OCTET_STREAM) { | |
protected boolean supports(Class<?> clazz) { | |
return InputStream.isAssignableFrom(clazz) |