Skip to content

Overhaul of FileHandler Design

Eclipse Webmaster requested to merge github/fork/osbornjd/jay/MarkIII into jay/MarkIII

Created by: osbornjd


This PR introduces an overhaul of the FileHandler design and functionality. The overall design is cleaner and largely hidden from the user. There are still some areas of functionality that need to be worked out with remote file transfers, but these can be addressed once the remote command API is finished.

This PR addresses issue 404.

Brief Overview of Design

The FileHandler design now operates as follows:

  1. A factory IFileHandlerFactory creates a concrete instance of a Local or Remote FileHandler, which inherits from the abstract class FileHandler. FileHandler implements the interface IFileHandler, which describes the overall layout of the FileHandler design.
  • Note that at the moment, IFileHandlerFactory just creates a LocalFileHandler. RemoteFileHandling will be addressed once RemoteCommands have been implemented.
  1. The concrete instance of Local/Remote FileHandler then creates a concrete instance of a MoveFileCommand or CopyFileCommand, depending on which file transfer command was called.
  2. FileHandler then calls the Command to execute which actually executes the the file transfer. A CommandStatus is passed up the chain to the original call by the user to copy/move a file to confirm that the transfer was completed successfully.

Other Changes Unrelated to FileHandler

A few changes were made that were unrelated to the FileHandler

  1. The comment structure for the getter/setter functions in CommandConfiguration was adjusted to meet the eclipse style.
  2. A test in TestCommandFactory was adjusted so that the working directory can be identified on a user's computer and the test script can then be run without absolute paths being specified.

Merge request reports