org.eclipse.emf.mwe.utils
Class DirectoryCleaner

java.lang.Object
  extended by org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent
      extended by org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent2
          extended by org.eclipse.emf.mwe.utils.DirectoryCleaner
All Implemented Interfaces:
WorkflowComponent, WorkflowComponentWithID, IWorkflowComponent

public class DirectoryCleaner
extends AbstractWorkflowComponent2


Constructor Summary
DirectoryCleaner()
           
 
Method Summary
 void addExclude(java.lang.String exclude)
          Adds an exclude.
protected  void checkConfigurationInternal(Issues issues)
           
 boolean cleanFolder(java.io.File parentFolder, java.io.FileFilter filter, boolean continueOnError, boolean deleteParentFolder)
           
 void cleanFolder(java.lang.String srcGenPath)
          Deletes all files and subdirectories under dir.
 java.lang.String getComponentName()
          Returns the component's name.
 java.lang.String getLogMessage()
          Returns the log message,
protected  void invokeInternal(WorkflowContext model, ProgressMonitor monitor, Issues issues)
          Internal method for component execution.
 boolean isExcluded(java.io.File path)
           
 boolean isUseDefaultExcludes()
          Returns if the default excludes are used.
 void setDirectory(java.lang.String directory)
          Sets the directory.
 void setUseDefaultExcludes(boolean useDefaultExcludes)
          Sets if the default excludes are used.
 
Methods inherited from class org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent2
checkConfiguration
 
Methods inherited from class org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent
checkRequiredConfigProperty, getBridge, getContainer, getId, getLocation, invoke, invoke, postInvoke, preInvoke, setContainer, setId, setLocation, setSkipOnErrors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectoryCleaner

public DirectoryCleaner()
Method Detail

setDirectory

public void setDirectory(java.lang.String directory)
Sets the directory.

Parameters:
directory - name of directory

getLogMessage

public java.lang.String getLogMessage()
Description copied from interface: WorkflowComponentWithID
Returns the log message,

Specified by:
getLogMessage in interface WorkflowComponentWithID
Overrides:
getLogMessage in class AbstractWorkflowComponent
Returns:
the log message
See Also:
AbstractWorkflowComponent.getLogMessage()

invokeInternal

protected void invokeInternal(WorkflowContext model,
                              ProgressMonitor monitor,
                              Issues issues)
Description copied from class: AbstractWorkflowComponent
Internal method for component execution.

Specified by:
invokeInternal in class AbstractWorkflowComponent
Parameters:
model - the workflow context
monitor - the progress monitor
issues - container of execution issues

checkConfigurationInternal

protected void checkConfigurationInternal(Issues issues)
Overrides:
checkConfigurationInternal in class AbstractWorkflowComponent2

cleanFolder

public void cleanFolder(java.lang.String srcGenPath)
                 throws java.io.FileNotFoundException
Deletes all files and subdirectories under dir. Returns true if all deletions were successful. If a deletion fails, the method stops attempting to delete and returns false.

Throws:
java.io.FileNotFoundException

isExcluded

public boolean isExcluded(java.io.File path)

cleanFolder

public boolean cleanFolder(java.io.File parentFolder,
                           java.io.FileFilter filter,
                           boolean continueOnError,
                           boolean deleteParentFolder)
                    throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

isUseDefaultExcludes

public boolean isUseDefaultExcludes()
Returns if the default excludes are used.

Returns:
true, if the default excludes are used, otherwise false.

setUseDefaultExcludes

public void setUseDefaultExcludes(boolean useDefaultExcludes)
Sets if the default excludes are used.

Parameters:
useDefaultExcludes - If true, the default excludes are used, if false, the default excludes are ignored.

addExclude

public void addExclude(java.lang.String exclude)
Adds an exclude.

Parameters:
exclude - the exclude

getComponentName

public java.lang.String getComponentName()
Description copied from class: AbstractWorkflowComponent
Returns the component's name. Overridable by custom components.

Specified by:
getComponentName in interface WorkflowComponent
Overrides:
getComponentName in class AbstractWorkflowComponent
Returns:
simple class name by default
See Also:
AbstractWorkflowComponent.getComponentName()