- Notifications
You must be signed in to change notification settings - Fork66
ZipCodeCore/JavaFileManager
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
a Java file manager - Meant to be read and thought about.
You can fork this repo, and clone it down onto your computer.Themain() function is inclass FileManager.You should be able to run that function.
This lab is meant to be an activity of reading the code and documenting what you found out.It is not necessarily a coding project. You do not need to write code to finish the lab.You only need to document what you found here.
This is a very simple file managementshell, it shows how to manipulate files using java standard library calls.Available commands:
lista folderinfoon on a filemkdirmake a new folderrenamea filecopy,move,deletefilesquitthe file manager shell
There are three classes in this app:FileManager,FileOperator andConsole insrc/main/java.Each class a different reason for being.There is a simple file hierarchy for manual testing in thetest folder.You can use thetest folder for doing simple file manipulations.
You should create a page of documentation in theHelp for FileManager file describing how you useeach of the commands the program provides.You can useMastering Markdown to learn more about whatmarkdown is and how you use it to write markdown files.There is also info atWikipedia : Markdown.
Write a short summary of what each command does and how it is used.Give a real example of what the user would see using each command.Edit theHelp for FileManager file with your explanatory text.
Why are the manipulation commands, the things that affect files and folders, in a different class thanthefile manager itself?
Why is all the input and output factored out into a separate class?
Why is Copy/Move in the same method? What about the two operations are so much the same?How would you separate them? Would it make it more understandable or less to separate them?
What would you have to do to:
- add the idea of acurrent folder?
- how would you add achange folder command?
- how would you add a command to display the contents of a file?
- how would you changelist to show the difference between files and folders?
- how could you clean up some of the code by using anenum instead of strings for the commands?
- how would you use theFileOperator class to test theFileOperator class?
How would you test this code?How are the testing methods different for each class?Which class cannot be easily tested wit unit tests?
Does the code, as is, have any obvious bugs?How would find out?
Why is the Console passed as a parameter to the two constructors?
This code is meant for you to read and consider how you might do some of these things.You can, of course, attempt any of the suggested changes that you'd like.You need not do so, though, yet, it might be a good activity to do after you've spent sometime working on other labs, so that your changes are nice and clean and concise.
About
a very simple example of a file manager (shell)
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.