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(String exclude)
          Adds an exclude.
protected  void checkConfigurationInternal(Issues issues)
           
 boolean cleanFolder(File parentFolder, FileFilter filter, boolean continueOnError, boolean deleteParentFolder)
           
 void cleanFolder(String srcGenPath)
          Deletes all files and subdirectories under dir.
 String getComponentName()
           
 String getLogMessage()
           
protected  void invokeInternal(WorkflowContext model, ProgressMonitor monitor, Issues issues)
           
 boolean isExcluded(File path)
           
 boolean isUseDefaultExcludes()
          Returns if the default excludes are used.
 void setDirectory(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(String directory)
Sets the directory.

Parameters:
directory - name of directory

getLogMessage

public String getLogMessage()
Specified by:
getLogMessage in interface WorkflowComponentWithID
Overrides:
getLogMessage in class AbstractWorkflowComponent
See Also:
AbstractWorkflowComponent.getLogMessage()

invokeInternal

protected void invokeInternal(WorkflowContext model,
                              ProgressMonitor monitor,
                              Issues issues)
Specified by:
invokeInternal in class AbstractWorkflowComponent

checkConfigurationInternal

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

cleanFolder

public void cleanFolder(String srcGenPath)
                 throws 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:
FileNotFoundException

isExcluded

public boolean isExcluded(File path)

cleanFolder

public boolean cleanFolder(File parentFolder,
                           FileFilter filter,
                           boolean continueOnError,
                           boolean deleteParentFolder)
                    throws FileNotFoundException
Throws:
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(String exclude)
Adds an exclude.

Parameters:
exclude - the exclude

getComponentName

public String getComponentName()
Specified by:
getComponentName in interface WorkflowComponent
Overrides:
getComponentName in class AbstractWorkflowComponent
See Also:
AbstractWorkflowComponent.getComponentName()


Copyright © 2015. All rights reserved.