@ProviderType
public interface FileOptimizerService
Modifier and Type | Method and Description |
---|---|
boolean |
canOptimize(org.apache.sling.api.resource.Resource fileResource)
Returns true if the resource is a registered type, the CA Config for the
resource is enabled and if an optimizer is registered for the file's meta
type
|
OptimizationResult |
getOptimizedContents(org.apache.sling.api.resource.Resource fileResource)
Gets the optimized contents of a file resource.
|
boolean |
isOptimized(org.apache.sling.api.resource.Resource fileResource)
Returns true if the specified resource has already been optimized by the
FileOptimizer.
|
OptimizationResult |
optimizeFile(org.apache.sling.api.resource.Resource fileResource,
boolean autoCommit)
Optimizes a file resource.
|
boolean canOptimize(org.apache.sling.api.resource.Resource fileResource)
fileResource
- the resource to check if the optimizer is availableOptimizationResult getOptimizedContents(org.apache.sling.api.resource.Resource fileResource) throws IOException
fileResource
- the resource to optimizeIOException
- an exception occurs reading the original resourceboolean isOptimized(org.apache.sling.api.resource.Resource fileResource)
fileResource
- the resource to checkOptimizationResult optimizeFile(org.apache.sling.api.resource.Resource fileResource, boolean autoCommit) throws IOException
fileResource
- the resource to optimizeautoCommit
- if true, the results will automatically be committed to
the Sling RepoIOException
- an exception occurs reading the original resourceCopyright © 2007–2018 The Apache Software Foundation. All rights reserved.