Package com.sodius.mdw.server.utils
Class HeaderUtils
- java.lang.Object
-
- com.sodius.mdw.server.utils.HeaderUtils
-
public class HeaderUtils extends Object
Provides utilities to handle HTTP headers.
-
-
Field Summary
Fields Modifier and Type Field Description static String
ACCEPT
The standard HTTP 'Accept' header.static String
CONTENT_DISPOSITION
The standard HTTP 'Content-Disposition' header.static String
CONTENT_ENCODING
The standard HTTP 'Content-Encoding' header.static String
CONTENT_EXPIRATION
The standard HTTP 'Content-Expiration' header.static String
CONTENT_LOCATION
The standard HTTP 'Content-Location' header.static String
CONTENT_TYPE
The standard HTTP 'Content-Type' header.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
createContentDispositionValue(File file)
Returns a HTTP 'Content-Disposition' header value for the specified file.static String
createContentDispositionValue(String filename)
Returns a HTTP 'Content-Disposition' header value for the specified file name.static String
getContentDispositionFilename(String value)
Returns the file name set as 'Content-Disposition' header value.
-
-
-
Field Detail
-
ACCEPT
public static final String ACCEPT
The standard HTTP 'Accept' header.- See Also:
- Constant Field Values
-
CONTENT_TYPE
public static final String CONTENT_TYPE
The standard HTTP 'Content-Type' header.- See Also:
- Constant Field Values
-
CONTENT_DISPOSITION
public static final String CONTENT_DISPOSITION
The standard HTTP 'Content-Disposition' header.- See Also:
- Constant Field Values
-
CONTENT_ENCODING
public static final String CONTENT_ENCODING
The standard HTTP 'Content-Encoding' header.- See Also:
- Constant Field Values
-
CONTENT_LOCATION
public static final String CONTENT_LOCATION
The standard HTTP 'Content-Location' header.- See Also:
- Constant Field Values
-
CONTENT_EXPIRATION
public static final String CONTENT_EXPIRATION
The standard HTTP 'Content-Expiration' header.- See Also:
- Constant Field Values
-
-
Method Detail
-
createContentDispositionValue
public static String createContentDispositionValue(String filename)
Returns a HTTP 'Content-Disposition' header value for the specified file name.- Parameters:
filename
- the file name to set as a 'Content-Disposition' header value- Returns:
- the 'Content-Disposition' header value.
-
createContentDispositionValue
public static String createContentDispositionValue(File file)
Returns a HTTP 'Content-Disposition' header value for the specified file.- Parameters:
file
- the file to set as a 'Content-Disposition' header value- Returns:
- the 'Content-Disposition' header value.
-
getContentDispositionFilename
public static String getContentDispositionFilename(String value)
Returns the file name set as 'Content-Disposition' header value.- Parameters:
value
- the 'Content-Disposition' header value.- Returns:
- the file name specified in the 'Content-Disposition' header value,
null
if none.
-
-