Class FileInfo

  • All Implemented Interfaces:
    AdditionalInformationHandler, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, VariableChangeListener, Actor, DataInfoActor, ErrorHandler, InputConsumer, OutputProducer, Serializable, Comparable

    public class FileInfo
    extends AbstractTransformer
    implements DataInfoActor
    Outputs information for a path (file/directory).

    Input/output:
    - accepts:
       java.io.File
       java.lang.String
    - generates:
       java.lang.Long


    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: FileInfo
     
    -annotation <adams.core.base.BaseText> (property: annotations)
        The annotations to attach to this actor.
        default: 
     
    -skip <boolean> (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded 
        as it is.
        default: false
     
    -stop-flow-on-error <boolean> (property: stopFlowOnError)
        If set to true, the flow gets stopped in case this actor encounters an error;
         useful for critical actors.
        default: false
     
    -type <SIZE|LAST_MODIFIED|IS_READABLE|IS_WRITEABLE|IS_EXECUTABLE|IS_HIDDEN|IS_DIRECTORY|IS_FILE> (property: type)
        The type of information to generate.
        default: SIZE
     
    -value-true <java.lang.String> (property: valueTrue)
        The string to output in case query types starting with 'IS_' evaluated to 
        'true'.
        default: true
     
    -value-false <java.lang.String> (property: valueFalse)
        The string to output in case query types starting with 'IS_' evaluated to 
        'false'.
        default: false
     
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_ValueTrue

        protected String m_ValueTrue
        the string to output in case of "IS_" queries evaluate to TRUE.
      • m_ValueFalse

        protected String m_ValueFalse
        the string to output in case of "IS_" queries evaluate to FALSE.
    • Constructor Detail

      • FileInfo

        public FileInfo()
    • Method Detail

      • setType

        public void setType​(FileInfo.InfoType value)
        Sets the type of information to generate.
        Parameters:
        value - the type
      • getType

        public FileInfo.InfoType getType()
        Returns the type of information to generate.
        Returns:
        the type
      • typeTipText

        public String typeTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setValueTrue

        public void setValueTrue​(String value)
        Sets the string to output if query evaluates to "true'.
        Parameters:
        value - the string
      • getValueTrue

        public String getValueTrue()
        Returns the string to output if query evaluates to "true'.
        Returns:
        the string
      • valueTrueTipText

        public String valueTrueTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setValueFalse

        public void setValueFalse​(String value)
        Sets the string to output if query evaluates to "false'.
        Parameters:
        value - the string
      • getValueFalse

        public String getValueFalse()
        Returns the string to output if query evaluates to "false'.
        Returns:
        the string
      • valueFalseTipText

        public String valueFalseTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • generates

        public Class[] generates()
        Returns the class of the items that the actor generates.
        Specified by:
        generates in interface OutputProducer
        Returns:
        the class
      • accepts

        public Class[] accepts()
        Returns the class that the consumer accepts.
        Specified by:
        accepts in interface InputConsumer
        Returns:
        java.io.File.class, java.lang.String.class
      • doExecute

        protected String doExecute()
        Executes the flow item.
        Specified by:
        doExecute in class AbstractActor
        Returns:
        null if everything is fine, otherwise error message