public class SpincastUtils extends Object implements ISpincastUtils
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
SpincastUtils(ISpincastConfig spincastConfig) |
| Modifier and Type | Method and Description |
|---|---|
File |
getAppJarDirectory()
Returns the working directory: the directory
in which the executable .jar is located.
|
protected String |
getCurrentVersionFromPom() |
Locale |
getLocaleBestMatchFromAcceptLanguageHeader(String header)
Gets the best Locale to use given a "Accept-Language" HTTP header.
|
String |
getMimeTypeFromExtension(String extension)
Gets the
mime type from the extension. |
String |
getMimeTypeFromPath(String path)
Gets the
mime type from a path, using its extension. |
protected ISpincastConfig |
getSpincastConfig() |
String |
getSpincastCurrentVersion()
Gets the current Spincast version
|
boolean |
isContentTypeToSkipGziping(String contentType)
Should the specified
Content-Type be gzipped? |
@Inject public SpincastUtils(ISpincastConfig spincastConfig)
protected ISpincastConfig getSpincastConfig()
public boolean isContentTypeToSkipGziping(String contentType)
ISpincastUtilsContent-Type be gzipped?isContentTypeToSkipGziping in interface ISpincastUtilspublic String getMimeTypeFromPath(String path)
ISpincastUtilsmime type from a path, using its extension.getMimeTypeFromPath in interface ISpincastUtilsmime type or null if it can't be
decided.public String getMimeTypeFromExtension(String extension)
ISpincastUtilsmime type from the extension.getMimeTypeFromExtension in interface ISpincastUtilsmime type or null if it can't be
decided.public Locale getLocaleBestMatchFromAcceptLanguageHeader(String header)
ISpincastUtilsgetLocaleBestMatchFromAcceptLanguageHeader in interface ISpincastUtilsnull
if the given header can't be parsed.public File getAppJarDirectory()
ISpincastUtilsgetAppJarDirectory in interface ISpincastUtilsnull if the application is
running inside an IDE.public String getSpincastCurrentVersion()
ISpincastUtilsgetSpincastCurrentVersion in interface ISpincastUtilsprotected String getCurrentVersionFromPom()
Copyright © 2016. All rights reserved.