Write A Java Code RPT – Command Processor This exercise simulates a command line shell. It does…

Write A Java Code

RPT – Command Processor

This exercise simulates a command line shell. It does not actually create any objects on the physical disk. Instead, it maintains objects and state within the context of running application.

While this application could be written procedurally, using OOP techniques (when appropriate) is preferred to separate functionality into more logical and maintainable pieces.

The main input mechanism of the application is the acceptance of text on the command line. Commands should be read and processed until the [quit] command is found.
If the entered command is not recognized, the Unrecognized command error should be returned. Or if the command has invalid parameters, or any parameter is missing, the Invalid Command error message should be returned.

Command Name: quit
This command terminates the main application loop.

Current Directory
Command Name: pwd
This command prints the full path of the current directory.

List Contents
Command Name: ls
Switches (extra)
[-r] –Recursive. If provided, prints everything in the current directory and all subdirectories.
This command lists the contents (directories and files) of the current directory. It writes a single item per line. If there are no items, print nothing.
If printing recursively, before printing contents, print the full path of the current directory.

Make Directory
Command Name: mkdir
[dirName] – the name of the directory to create. Character limit of 100.
This command creates a directory entry in the cache. If the directory already exists (by name), a message like “Directory already exists” should be printed.

Change Directory
Command Name: cd
[dirName] – the name of the sub-directory to change current path to.
This command changes the current path to a sub-directory(by name). If the name does not exist, a message like “Directory not found” should be displayed.
The command should also accept the dirName of “..”, which indicates the current directory should be changed to the parent. If the current directory is “root”, no message should be displayed.

Created File
Command Name: touch
[fileName] – the name of the file to create. Character limit of 100.
This command created a “file” in the current directory.

If time permits, the following additional features could be added:
An optional parameter can be added to the command to accept a multi-faceted path (i.e., subdir1/subdir1-1/subdir3)
[cd] – The directory change should follow the path recursively. If any of the parts do not exist, the command should fail with a message of “Invalid path”.
[ls] –The listing should be of the final node of the supplied path.

The previous state of the application could be loaded from a file on disk. The contents of this file would be a serialized representation of the application context.

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
The price is based on these factors:
Academic level
Number of pages
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
error: Content is protected !!