Package org.eclipse.emf.mwe.utils
Class DirectoryCleaner
java.lang.Object
org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent
org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent2
org.eclipse.emf.mwe.utils.DirectoryCleaner
- All Implemented Interfaces:
WorkflowComponent
,WorkflowComponentWithID
,IWorkflowComponent
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.Returns the component's name.Returns the log message,protected void
invokeInternal
(WorkflowContext model, ProgressMonitor monitor, Issues issues) Internal method for component execution.boolean
isExcluded
(File path) boolean
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
-
Constructor Details
-
DirectoryCleaner
public DirectoryCleaner()
-
-
Method Details
-
setDirectory
Sets the directory.- Parameters:
directory
- name of directory
-
getLogMessage
Description copied from interface:WorkflowComponentWithID
Returns the log message,- Specified by:
getLogMessage
in interfaceWorkflowComponentWithID
- Overrides:
getLogMessage
in classAbstractWorkflowComponent
- Returns:
- the log message
- See Also:
-
invokeInternal
Description copied from class:AbstractWorkflowComponent
Internal method for component execution.- Specified by:
invokeInternal
in classAbstractWorkflowComponent
- Parameters:
model
- the workflow contextmonitor
- the progress monitorissues
- container of execution issues
-
checkConfigurationInternal
- Overrides:
checkConfigurationInternal
in classAbstractWorkflowComponent2
-
cleanFolder
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
-
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, otherwisefalse
.
-
setUseDefaultExcludes
public void setUseDefaultExcludes(boolean useDefaultExcludes) Sets if the default excludes are used.- Parameters:
useDefaultExcludes
- Iftrue
, the default excludes are used, iffalse
, the default excludes are ignored.
-
addExclude
Adds an exclude.- Parameters:
exclude
- the exclude
-
getComponentName
Description copied from class:AbstractWorkflowComponent
Returns the component's name. Overridable by custom components.- Specified by:
getComponentName
in interfaceWorkflowComponent
- Overrides:
getComponentName
in classAbstractWorkflowComponent
- Returns:
- simple class name by default
- See Also:
-