public interface ISpincastUtils
| Modifier and Type | Method and Description |
|---|---|
File |
getAppJarDirectory()
Returns the working directory: the directory
in which the executable .jar is located.
|
Locale |
getLocaleBestMatchFromAcceptLanguageHeader(String acceptLanguageHeader)
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. |
String |
getSpincastCurrentVersion()
Gets the current Spincast version.
|
boolean |
isContentTypeToSkipGziping(String contentType)
Should the specified
Content-Type be gzipped? |
void |
zipDirectory(File directoryToZip,
File targetZipFile,
boolean includeDirItself)
Zips a directory.
|
void |
zipExtract(File zipFile,
File targetDir)
Extracts a .zip file to the specified directory.
|
void zipDirectory(File directoryToZip, File targetZipFile, boolean includeDirItself)
targetZipFile - the target .zip file. If the parent directories don't
exist, tries to create them.If - true, the directory itself will be included in the
zip file, otherwise only its content will be.void zipExtract(File zipFile, File targetDir)
targetDir - The target directory. If it doesn't exist, tried to
create it (and its parents, if required).String getMimeTypeFromPath(String path)
mime type from a path, using its extension.mime type or null if it can't be
decided.String getMimeTypeFromExtension(String extension)
mime type from the extension.mime type or null if it can't be
decided.Locale getLocaleBestMatchFromAcceptLanguageHeader(String acceptLanguageHeader)
null
if the given header can't be parsed.boolean isContentTypeToSkipGziping(String contentType)
Content-Type be gzipped?File getAppJarDirectory()
null if the application is
running inside an IDE.String getSpincastCurrentVersion()
Copyright © 2016. All rights reserved.