Package ro.isdc.wro.maven.plugin.support
Class ResourceChangeHandler
- java.lang.Object
-
- ro.isdc.wro.maven.plugin.support.ResourceChangeHandler
-
public class ResourceChangeHandler extends java.lang.ObjectEncapsulates the details about resource change detection and persist the change information in build context.- Since:
- 1.7.2
- Author:
- Alex Objelean
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ResourceChangeHandlercreate(ro.isdc.wro.manager.factory.WroManagerFactory managerFactory, org.apache.maven.plugin.logging.Log log)Factory method which requires all mandatory fields.voiddestroy()Destroys all information about resource tracked for changes.voidforget(ro.isdc.wro.model.resource.Resource resource)After invoking this method on a resource, the next invocation ofisResourceChanged(Resource)will return true.org.apache.maven.plugin.logging.LoggetLog()booleanisIncrementalBuild()booleanisResourceChanged(ro.isdc.wro.model.resource.Resource resource)voidpersist()Persist the values stored in BuildContext(Holder)voidremember(ro.isdc.wro.model.resource.Resource resource)Will persist the information regarding the provided resource in some internal store.ResourceChangeHandlersetBuildContext(org.sonatype.plexus.build.incremental.BuildContext buildContext)ResourceChangeHandlersetBuildDirectory(java.io.File buildDirectory)ResourceChangeHandlersetIncrementalBuildEnabled(boolean incrementalBuildEnabled)ResourceChangeHandlersetLog(org.apache.maven.plugin.logging.Log log)ResourceChangeHandlersetManagerFactory(ro.isdc.wro.manager.factory.WroManagerFactory wroManagerFactory)
-
-
-
Method Detail
-
create
public static ResourceChangeHandler create(ro.isdc.wro.manager.factory.WroManagerFactory managerFactory, org.apache.maven.plugin.logging.Log log)
Factory method which requires all mandatory fields.
-
isResourceChanged
public boolean isResourceChanged(ro.isdc.wro.model.resource.Resource resource)
-
remember
public void remember(ro.isdc.wro.model.resource.Resource resource)
Will persist the information regarding the provided resource in some internal store. This information will be used later to check if the resource is changed.- Parameters:
resource-Resourceto touch.
-
getLog
public org.apache.maven.plugin.logging.Log getLog()
-
setManagerFactory
public ResourceChangeHandler setManagerFactory(ro.isdc.wro.manager.factory.WroManagerFactory wroManagerFactory)
-
setLog
public ResourceChangeHandler setLog(org.apache.maven.plugin.logging.Log log)
-
setBuildContext
public ResourceChangeHandler setBuildContext(org.sonatype.plexus.build.incremental.BuildContext buildContext)
-
setBuildDirectory
public ResourceChangeHandler setBuildDirectory(java.io.File buildDirectory)
-
setIncrementalBuildEnabled
public ResourceChangeHandler setIncrementalBuildEnabled(boolean incrementalBuildEnabled)
-
isIncrementalBuild
public boolean isIncrementalBuild()
-
destroy
public void destroy()
Destroys all information about resource tracked for changes.
-
forget
public void forget(ro.isdc.wro.model.resource.Resource resource)
After invoking this method on a resource, the next invocation ofisResourceChanged(Resource)will return true.- Parameters:
resourceUri- uri of the resource to clear from persisted storage.
-
persist
public void persist()
Persist the values stored in BuildContext(Holder)
-
-