Package adams.flow.condition.test
Class FileExists
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<TestCondition>
,SizeOfHandler
,TestCondition
,Serializable
,Comparable
- Direct Known Subclasses:
OptionalFlowExecution
public class FileExists extends AbstractTestCondition
Checks whether a specified file exists.
Valid options are:
-D <int> (property: debugLevel) The greater the number the more additional info the scheme may output to the console (0 = off). default: 0 minimum: 0
-file <adams.core.io.PlaceholderFile> (property: file) The file to look for. default: .
-invert (property: invert) If set to true, then the matching sense is inverted.
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected PlaceholderFile
m_File
the file to look for.protected boolean
m_Invert
whether to invert the matching sense.-
Fields inherited from class adams.flow.condition.test.AbstractTestCondition
m_Tested, m_TestResult
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description FileExists()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.String
fileTipText()
Returns the tip text for this property.PlaceholderFile
getFile()
Returns the file currently to look for.boolean
getInvert()
Returns whether to invert the matching sense.String
getQuickInfo()
Returns the quick info string to be displayed in the flow editor.String
globalInfo()
Returns a string describing the object.String
invertTipText()
Returns the tip text for this property.protected String
performTest()
Performs the actual testing of the condition.void
setFile(PlaceholderFile value)
Sets the file to look for.void
setInvert(boolean value)
Sets whether to invert the matching sense.-
Methods inherited from class adams.flow.condition.test.AbstractTestCondition
compareTo, equals, forCommandLine, forName, getConditions, getTestResult, initialize, reset, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_File
protected PlaceholderFile m_File
the file to look for.
-
m_Invert
protected boolean m_Invert
whether to invert the matching sense.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
setFile
public void setFile(PlaceholderFile value)
Sets the file to look for.- Parameters:
value
- the file
-
getFile
public PlaceholderFile getFile()
Returns the file currently to look for.- Returns:
- the file
-
fileTipText
public String fileTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setInvert
public void setInvert(boolean value)
Sets whether to invert the matching sense.- Parameters:
value
- true if inverting matching sense
-
getInvert
public boolean getInvert()
Returns whether to invert the matching sense.- Returns:
- true if matching sense is inverted
-
invertTipText
public String invertTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns the quick info string to be displayed in the flow editor.- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Specified by:
getQuickInfo
in interfaceTestCondition
- Overrides:
getQuickInfo
in classAbstractTestCondition
- Returns:
- the info or null if no info to be displayed
-
performTest
protected String performTest()
Performs the actual testing of the condition.- Specified by:
performTest
in classAbstractTestCondition
- Returns:
- the test result, null if everything OK, otherwise the error message
-
-