Package adams.core.io.fileuse
Class FileSizeChange
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.core.io.fileuse.AbstractFileUseCheck
-
- adams.core.io.fileuse.FileSizeChange
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Serializable
public class FileSizeChange extends AbstractFileUseCheck
Checks the file size before and after the specified wait interval. If the sizes differ, then the file is considered to be in use.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-min-size <long> (property: minSize) The minimum size that the file must have; below is considered in use. default: 1 minimum: 1
-interval <int> (property: interval) The wait interval in msec between before/after file size checks. default: 100 minimum: 1
- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
m_Interval
the interval in msec to wait.protected long
m_MinSize
the minimum file size.-
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 FileSizeChange()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.int
getInterval()
Returns the wait interval in msec.long
getMinSize()
Returns the wait interval in msec.String
globalInfo()
Returns a string describing the object.String
intervalTipText()
Returns the tip text for this property.boolean
isInUse(File file)
Checks whether the file is in use.String
minSizeTipText()
Returns the tip text for this property.void
setInterval(int value)
Sets the wait interval in msec.void
setMinSize(long value)
Sets the minimum file size in bytes.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, 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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
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
-
setMinSize
public void setMinSize(long value)
Sets the minimum file size in bytes.- Parameters:
value
- the size
-
getMinSize
public long getMinSize()
Returns the wait interval in msec.- Returns:
- the size
-
minSizeTipText
public String minSizeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setInterval
public void setInterval(int value)
Sets the wait interval in msec.- Parameters:
value
- the interval
-
getInterval
public int getInterval()
Returns the wait interval in msec.- Returns:
- the interval
-
intervalTipText
public String intervalTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
isInUse
public boolean isInUse(File file)
Checks whether the file is in use.- Specified by:
isInUse
in classAbstractFileUseCheck
- Parameters:
file
- the file to check- Returns:
- true if in use
-
-