org.apache.sling.fileoptim.models

## Class OptimizeResource

- java.lang.Object
- - org.apache.sling.fileoptim.models.OptimizeResource

    @ProviderType
     @Model(adaptables=org.apache.sling.api.resource.Resource.class)
    public class OptimizeResource
    extends Object

Sling model for executing the optimizer on a resource, will not commit the result

### Constructor Summary

Constructors
Constructor and Description
`OptimizeResource(org.apache.sling.api.resource.Resource resource)`

### Method Summary

All Methods Instance Methods Concrete Methods
`OptimizationResult` `getResult()` Gets the optimization result.
`void` `init()`
`boolean` `isCanOptimize()` Return true if the file can be optimized
`boolean` `isOptimized()` Returns true if the file is optimized, false otherwise

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### OptimizeResource

    public OptimizeResource(org.apache.sling.api.resource.Resource resource)

### Method Detail

#### init

    @PostConstruct
    public void init()
                             throws IOException

Throws:
  `IOException`

#### isOptimized

    public boolean isOptimized()

Returns true if the file is optimized, false otherwise

Returns:

#### getResult

    public OptimizationResult getResult()

Gets the optimization result.

Returns:

#### isCanOptimize

    public boolean isCanOptimize()

Return true if the file can be optimized

Returns: