-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Merge pull request #705 from clj-commons/add-brotli-and-zstd-…
- Loading branch information
1 parent
c905153
commit 6a84128
Showing
4 changed files
with
71 additions
and
48 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package aleph.http; | ||
|
||
import io.netty.handler.codec.compression.BrotliOptions; | ||
import io.netty.handler.codec.compression.DeflateOptions; | ||
import io.netty.handler.codec.compression.GzipOptions; | ||
import io.netty.handler.codec.compression.SnappyOptions; | ||
import io.netty.handler.codec.compression.StandardCompressionOptions; | ||
import io.netty.handler.codec.compression.ZstdOptions; | ||
|
||
/** | ||
* {@link AlephCompressionOptions} exists because the Clojure compiler cannot | ||
* distinguish between static fields and static methods without reflection. | ||
* | ||
* This is a problem when using Netty's StandardCompressionOptions, because | ||
* reflection triggers a load of all the methods referencing optional classes, | ||
* which may not exist in the classpath, resulting in a ClassNotFoundException. | ||
*/ | ||
public class AlephCompressionOptions { | ||
private AlephCompressionOptions() { | ||
// Prevent outside initialization | ||
} | ||
|
||
public static BrotliOptions brotli() { | ||
return StandardCompressionOptions.brotli(); | ||
} | ||
|
||
public static ZstdOptions zstd() { | ||
return StandardCompressionOptions.zstd(); | ||
} | ||
|
||
public static SnappyOptions snappy() { | ||
return StandardCompressionOptions.snappy(); | ||
} | ||
|
||
public static GzipOptions gzip() { | ||
return StandardCompressionOptions.gzip(); | ||
} | ||
|
||
public static DeflateOptions deflate() { | ||
return StandardCompressionOptions.deflate(); | ||
} | ||
} |
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