Class PathFinder.ExecFilter

    • Field Detail

      • cmd

        private final String[] cmd
        The command to be executed including arguments separated by space as to be passed to Runtime.exec(String) in order to decide whether the given path passes the filter. For more information on the entries see PathFinder.exec(String[]).
    • Constructor Detail

      • ExecFilter

        ExecFilter​(String[] cmd)
        Creates an execution filter from the given command and arguments.
        Parameters:
        cmd - The 0th entry is the command itself and the others are arguments. For details see PathFinder.exec(String[]).
    • Method Detail

      • pass

        public boolean pass​(Path path)
        The given path passes this filter, i.e. this method returns true if the shell command given by cmd succeeds according to its return value (which is then zero).

        Execution proceeds in the following steps:

        • Replace the arguments PathFinder.EXEC_ARG by the long name of path.
        • Create a separate process to execute the command.
        • Wait for execution end and
        • pass if the return value 0 indicates success.
        Specified by:
        pass in class PathFinder.Filter