/** * Checks if the {@link File} with the given content-type could be compressed. */ private boolean canBeCompressed(final File cacheFile, final String contentType) { switch (compressionConfig.getCompressionMode()) { case FORCE: return true; case OFF: return false; case ON: { if (cacheFile.length() < compressionConfig.getCompressionMinSize()) { return false; } return compressionConfig.checkMimeType(contentType); } default: throw new IllegalStateException("Unknown mode"); } }
/** * Checks if the {@link File} with the given content-type could be compressed. */ private boolean canBeCompressed(final File cacheFile, final String contentType) { switch (compressionConfig.getCompressionMode()) { case FORCE: return true; case OFF: return false; case ON: { if (cacheFile.length() < compressionConfig.getCompressionMinSize()) { return false; } return compressionConfig.checkMimeType(contentType); } default: throw new IllegalStateException("Unknown mode"); } }
/** * Checks if the {@link File} with the given content-type could be compressed. */ private boolean canBeCompressed(final File cacheFile, final String contentType) { switch (compressionConfig.getCompressionMode()) { case FORCE: return true; case OFF: return false; case ON: { if (cacheFile.length() < compressionConfig.getCompressionMinSize()) { return false; } return compressionConfig.checkMimeType(contentType); } default: throw new IllegalStateException("Unknown mode"); } }
/** * Checks if the {@link File} with the given content-type could be compressed. */ private boolean canBeCompressed(final File cacheFile, final String contentType) { switch (compressionConfig.getCompressionMode()) { case FORCE: return true; case OFF: return false; case ON: { if (cacheFile.length() < compressionConfig.getCompressionMinSize()) { return false; } return compressionConfig.checkMimeType(contentType); } default: throw new IllegalStateException("Unknown mode"); } }
/** * Checks if the {@link File} with the given content-type could be compressed. */ private boolean canBeCompressed(final File cacheFile, final String contentType) { switch (compressionConfig.getCompressionMode()) { case FORCE: return true; case OFF: return false; case ON: { if (cacheFile.length() < compressionConfig.getCompressionMinSize()) { return false; } return compressionConfig.checkMimeType(contentType); } default: throw new IllegalStateException("Unknown mode"); } }
/** * Checks if the {@link File} with the given content-type could be compressed. */ private boolean canBeCompressed(final File cacheFile, final String contentType) { switch (compressionConfig.getCompressionMode()) { case FORCE: return true; case OFF: return false; case ON: { if (cacheFile.length() < compressionConfig.getCompressionMinSize()) { return false; } return compressionConfig.checkMimeType(contentType); } default: throw new IllegalStateException("Unknown mode"); } }
/** * Checks if the {@link File} with the given content-type could be compressed. */ private boolean canBeCompressed(final File cacheFile, final String contentType) { switch (compressionConfig.getCompressionMode()) { case FORCE: return true; case OFF: return false; case ON: { if (cacheFile.length() < compressionConfig.getCompressionMinSize()) { return false; } return compressionConfig.checkMimeType(contentType); } default: throw new IllegalStateException("Unknown mode"); } }
/** * Checks if the {@link File} with the given content-type could be compressed. */ private boolean canBeCompressed(final File cacheFile, final String contentType) { switch (compressionConfig.getCompressionMode()) { case FORCE: return true; case OFF: return false; case ON: { if (cacheFile.length() < compressionConfig.getCompressionMinSize()) { return false; } return compressionConfig.checkMimeType(contentType); } default: throw new IllegalStateException("Unknown mode"); } }
/** * Checks if the {@link File} with the given content-type could be compressed. */ private boolean canBeCompressed(final File cacheFile, final String contentType) { switch (compressionConfig.getCompressionMode()) { case FORCE: return true; case OFF: return false; case ON: { if (cacheFile.length() < compressionConfig.getCompressionMinSize()) { return false; } return compressionConfig.checkMimeType(contentType); } default: throw new IllegalStateException("Unknown mode"); } }
/** * Checks if the {@link File} with the given content-type could be compressed. */ private boolean canBeCompressed(final File cacheFile, final String contentType) { switch (compressionConfig.getCompressionMode()) { case FORCE: return true; case OFF: return false; case ON: { if (cacheFile.length() < compressionConfig.getCompressionMinSize()) { return false; } return compressionConfig.checkMimeType(contentType); } default: throw new IllegalStateException("Unknown mode"); } }
/** * Checks if the {@link File} with the given content-type could be compressed. */ private boolean canBeCompressed(final File cacheFile, final String contentType) { switch (compressionConfig.getCompressionMode()) { case FORCE: return true; case OFF: return false; case ON: { if (cacheFile.length() < compressionConfig.getCompressionMinSize()) { return false; } return compressionConfig.checkMimeType(contentType); } default: throw new IllegalStateException("Unknown mode"); } }
|| contentLength >= compressionConfig.getCompressionMinSize()) { if (compressionConfig.checkMimeType(response.getContentType())) { response.setChunked(true); response.setContentLength(-1);
|| contentLength >= compressionConfig.getCompressionMinSize()) { if (compressionConfig.checkMimeType(response.getContentType())) { response.setChunked(true); response.setContentLength(-1);
|| contentLength >= compressionConfig.getCompressionMinSize()) { if (compressionConfig.checkMimeType(response.getContentType())) { response.setChunked(true); response.setContentLength(-1);
|| contentLength >= compressionConfig.getCompressionMinSize()) { if (compressionConfig.checkMimeType(response.getContentType())) { response.setChunked(true); response.setContentLength(-1);
|| contentLength >= compressionConfig.getCompressionMinSize()) { if (compressionConfig.checkMimeType(response.getContentType())) { response.setChunked(true); response.setContentLength(-1);
|| contentLength >= compressionConfig.getCompressionMinSize()) { if (compressionConfig.checkMimeType(response.getContentType())) { response.setChunked(true); response.setContentLength(-1);
|| contentLength >= compressionConfig.getCompressionMinSize()) { if (compressionConfig.checkMimeType(response.getContentType())) { response.setChunked(true); response.setContentLength(-1);
|| contentLength >= compressionConfig.getCompressionMinSize()) { if (compressionConfig.checkMimeType(response.getContentType())) { response.setChunked(true); response.setContentLength(-1);
|| contentLength >= compressionConfig.getCompressionMinSize()) { if (compressionConfig.checkMimeType(response.getContentType())) { response.setChunked(true); response.setContentLength(-1);