Package com.biglybt.core.util
Class HTTPUtils
- java.lang.Object
-
- com.biglybt.core.util.HTTPUtils
-
public class HTTPUtils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Set<java.lang.String>
compression
private static java.lang.String
default_type
private static java.util.Map<java.lang.String,java.lang.String>
file_types
static java.lang.String
NL
-
Constructor Summary
Constructors Constructor Description HTTPUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
canGZIP(java.lang.String accept_encoding)
static java.io.InputStream
decodeChunkedEncoding(java.net.Socket socket)
static java.io.InputStream
decodeChunkedEncoding(java.net.Socket socket, boolean ignoreStatusCode)
static java.lang.String
guessContentTypeFromFileType(java.lang.String file_type)
static boolean
isImageFileType(java.lang.String file_type)
static boolean
useCompressionForFileType(java.lang.String file_type)
-
-
-
Field Detail
-
NL
public static final java.lang.String NL
- See Also:
- Constant Field Values
-
default_type
private static final java.lang.String default_type
- See Also:
- Constant Field Values
-
file_types
private static final java.util.Map<java.lang.String,java.lang.String> file_types
-
compression
private static final java.util.Set<java.lang.String> compression
-
-
Method Detail
-
guessContentTypeFromFileType
public static java.lang.String guessContentTypeFromFileType(java.lang.String file_type)
- Parameters:
file_type
- file extension- Returns:
- apropriate content type string if found
-
isImageFileType
public static boolean isImageFileType(java.lang.String file_type)
-
canGZIP
public static boolean canGZIP(java.lang.String accept_encoding)
-
useCompressionForFileType
public static boolean useCompressionForFileType(java.lang.String file_type)
- Parameters:
file_type
- a file type like text/plain- Returns:
- true if the file_type should be compressed
-
decodeChunkedEncoding
public static java.io.InputStream decodeChunkedEncoding(java.net.Socket socket) throws java.io.IOException
- Throws:
java.io.IOException
-
decodeChunkedEncoding
public static java.io.InputStream decodeChunkedEncoding(java.net.Socket socket, boolean ignoreStatusCode) throws java.io.IOException
- Throws:
java.io.IOException
-
-