Class ContentTypeUtils
java.lang.Object
org.aksw.jena_sparql_api.conjure.utils.ContentTypeUtils
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intclassifyLang(org.apache.jena.riot.Lang lang) static Set<com.google.common.net.MediaType>compatibleContentTypes(com.google.common.net.MediaType range, Collection<com.google.common.net.MediaType> candidates) static org.aksw.jena_sparql_api.http.domain.api.RdfEntityInfoderiveHeadersFromFileName(String fileName) Attempts to get Content-type, Content-encoding from a given filenamestatic Stringstatic org.apache.http.Header[]expandAccept(org.apache.http.Header[] headers) Expands the accept header of a request with respect to registered languages For each range r in the accept header get all langs l and qvalues that that correspond to r for each lang l get the set of content types assign each content type the minimum qvaluestatic StringtoFileExtension(String contentType, boolean precedeWithDotIfNotEmpty) static StringtoFileExtension(String contentType, List<String> codings) static StringtoFileExtension(List<String> codings) static StringtoFileExtension(org.aksw.jena_sparql_api.http.domain.api.RdfEntityInfo info) static StringtoFileExtension(org.apache.http.Header[] headers) static StringtoFileExtensionCt(org.apache.http.Header[] headers) toFileExtensionParts(List<String> codings)
-
Field Details
-
ctExtensions
-
codingExtensions
-
-
Constructor Details
-
ContentTypeUtils
public ContentTypeUtils()
-
-
Method Details
-
compatibleContentTypes
public static Set<com.google.common.net.MediaType> compatibleContentTypes(com.google.common.net.MediaType range, Collection<com.google.common.net.MediaType> candidates) -
entryToHeaderValue
-
classifyLang
public static int classifyLang(org.apache.jena.riot.Lang lang) -
expandAccept
public static org.apache.http.Header[] expandAccept(org.apache.http.Header[] headers) Expands the accept header of a request with respect to registered languages For each range r in the accept header get all langs l and qvalues that that correspond to r for each lang l get the set of content types assign each content type the minimum qvalue- Parameters:
headers-- Returns:
-
getCtExtensions
-
getCodingExtensions
-
toFileExtension
-
toFileExtensionCt
-
toFileExtensionParts
-
toFileExtension
-
toFileExtension
-
toFileExtension
-
toFileExtension
-
deriveHeadersFromFileName
public static org.aksw.jena_sparql_api.http.domain.api.RdfEntityInfo deriveHeadersFromFileName(String fileName) Attempts to get Content-type, Content-encoding from a given filename- Parameters:
resultFile- The non-null file that will be passed into the FileEntityEx result. Used for pragmatic reasons, as it seems to be the best Entity class that prevents us from having to roll our own.fileName-- Returns:
-