Class ContentTypeUtils

java.lang.Object
org.aksw.jena_sparql_api.conjure.utils.ContentTypeUtils

public class ContentTypeUtils extends Object
  • Field Details

  • 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

      public static String entryToHeaderValue(Map.Entry<String,Float> e)
    • 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

      public static MapPair<String,String> getCtExtensions()
    • getCodingExtensions

      public static MapPair<String,String> getCodingExtensions()
    • toFileExtension

      public static String toFileExtension(org.apache.http.Header[] headers)
    • toFileExtensionCt

      public static String toFileExtensionCt(org.apache.http.Header[] headers)
    • toFileExtensionParts

      public static List<String> toFileExtensionParts(List<String> codings)
    • toFileExtension

      public static String toFileExtension(List<String> codings)
    • toFileExtension

      public static String toFileExtension(org.aksw.jena_sparql_api.http.domain.api.RdfEntityInfo info)
    • toFileExtension

      public static String toFileExtension(String contentType, boolean precedeWithDotIfNotEmpty)
    • toFileExtension

      public static String toFileExtension(String contentType, List<String> codings)
    • 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: