Package sonia.scm.io
Interface ContentTypeResolver
public interface ContentTypeResolver
ContentTypeResolver is able to detect the
ContentType of files based on their path and (optinally) a few starting bytes. These files do not have to be real files on the file system, but can be hypothetical constructs ("What content type is most probable for a file named like this").- Since:
- 2.23.0
-
Method Summary
Modifier and TypeMethodDescriptionfindSyntaxModesByLanguage(String language) Returns a map of syntax highlighting modes such as ace, codemirror or prism by language.Detects theContentTypeof the given path, by only using path based strategies.Detects theContentTypeof the given path, by using path and content based strategies.
-
Method Details
-
resolve
Detects theContentTypeof the given path, by only using path based strategies.- Parameters:
path- path of the file- Returns:
ContentTypeof path
-
resolve
Detects theContentTypeof the given path, by using path and content based strategies.- Parameters:
path- path of the filecontentPrefix- first few bytes of the content- Returns:
ContentTypeof path and content prefix
-
findSyntaxModesByLanguage
Returns a map of syntax highlighting modes such as ace, codemirror or prism by language.- Parameters:
language- name of the coding language- Since:
- 2.28.0
-