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 StringACCEPTThe standard HTTP 'Accept' header.static StringCONTENT_DISPOSITIONThe standard HTTP 'Content-Disposition' header.static StringCONTENT_ENCODINGThe standard HTTP 'Content-Encoding' header.static StringCONTENT_EXPIRATIONThe standard HTTP 'Content-Expiration' header.static StringCONTENT_LOCATIONThe standard HTTP 'Content-Location' header.static StringCONTENT_TYPEThe standard HTTP 'Content-Type' header.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringcreateContentDispositionValue(File file)Returns a HTTP 'Content-Disposition' header value for the specified file.static StringcreateContentDispositionValue(String filename)Returns a HTTP 'Content-Disposition' header value for the specified file name.static StringgetContentDispositionFilename(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,
nullif none.
-
-