Class JoinFilesCommand

java.lang.Object
eu.svjatoslav.alyverkko_cli.commands.JoinFilesCommand
All Implemented Interfaces:
Command

public class JoinFilesCommand extends Object implements Command
The JoinFilesCommand aggregates multiple files (optionally matching a specific pattern) into a single file for AI processing, typically in the mail directory. Usage Example:
   alyverkko-cli joinfiles -s /path/to/source -p "*.java" -t "my_topic" --edit
 
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.NullOption
    If present, open the joined file using a text editor afterward.
    The pattern used to filter files for joining, e.g.
    eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.StringOption
    Pattern for matching files, such as "*.java".
    The base directory for recursion when joining files.
    eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.DirectoryOption
    Directory from which files will be joined.
    eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.StringOption
    Topic name, used as the basis for the output file name.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    executeCommand(String[] cliArguments)
    Executes the command that joins files from a specified directory (matching an optional pattern) into one output file in the mail directory.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • sourceDirectoryOption

      public eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.DirectoryOption sourceDirectoryOption
      Directory from which files will be joined.
    • patternOption

      public eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.StringOption patternOption
      Pattern for matching files, such as "*.java".
    • topic

      public eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.StringOption topic
      Topic name, used as the basis for the output file name.
    • editOption

      public eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.NullOption editOption
      If present, open the joined file using a text editor afterward.
    • sourceBaseDirectory

      public Path sourceBaseDirectory
      The base directory for recursion when joining files.
    • fileNamePattern

      public String fileNamePattern
      The pattern used to filter files for joining, e.g. "*.java".
  • Constructor Details

    • JoinFilesCommand

      public JoinFilesCommand()
  • Method Details

    • getCommandName

      public String getCommandName()
      Specified by:
      getCommandName in interface Command
      Returns:
      the name of this command, i.e., "joinfiles".
    • executeCommand

      public void executeCommand(String[] cliArguments) throws IOException
      Executes the command that joins files from a specified directory (matching an optional pattern) into one output file in the mail directory. Optionally, it can open the output file in an editor.
      Specified by:
      executeCommand in interface Command
      Parameters:
      cliArguments - the command-line arguments after "joinfiles".
      Throws:
      IOException - if any IO operations fail.