From d840524634b77bed6c00db7704f91ee57b6f61f8 Mon Sep 17 00:00:00 2001 From: Fitru Date: Sun, 10 Jul 2022 09:54:40 -0400 Subject: [PATCH 1/2] Finished --- .idea/compiler.xml | 1 + .idea/misc.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 3f507c9..29fac82 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -7,6 +7,7 @@ + diff --git a/.idea/misc.xml b/.idea/misc.xml index accd629..0bc224b 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -8,7 +8,7 @@ - + \ No newline at end of file From 681d7ac65f982dda197ce4f6b24cdf11ccba77a0 Mon Sep 17 00:00:00 2001 From: Fitru Date: Sun, 10 Jul 2022 11:28:01 -0400 Subject: [PATCH 2/2] Finished, will come back to play with program --- .DS_Store | Bin 0 -> 6148 bytes FileManager.md | 94 ++++++++++++++++++++++++++++++++++++++++- FileManagerWriteUp.txt | 87 ++++++++++++++++++++++++++++++++++++++ javamanager/.DS_Store | Bin 0 -> 6148 bytes src/.DS_Store | Bin 0 -> 6148 bytes src/main/.DS_Store | Bin 0 -> 6148 bytes target/.DS_Store | Bin 0 -> 6148 bytes test/.DS_Store | Bin 0 -> 6148 bytes 8 files changed, 180 insertions(+), 1 deletion(-) create mode 100644 .DS_Store create mode 100644 FileManagerWriteUp.txt create mode 100644 javamanager/.DS_Store create mode 100644 src/.DS_Store create mode 100644 src/main/.DS_Store create mode 100644 target/.DS_Store create mode 100644 test/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..dd199fc76823c418decb4f15786311b865fa7fd0 GIT binary patch literal 6148 zcmeH~&r8EF6vtm&)y^U8prE&a*MU>VP`s2m{{bs{a57svwXQbOcJ43+z3V^ZKjPox zdr1bXa~}Og9=v>$m%OI=uqF!tu+|{h0jL6ijZSK#$fw!|O~Qkm?mBONe^g8nK zC22sRxyk=V;B9s&rub^1<}XOy5wLoE@Lf<#1q* zQd1fNhCq=(Nj0l<{vXf3{}+=?%MdUG{uKdcwcU0Lm!!|unZ?mr%h9jU$!J`zRHk5| ik7HS(qj&>d8uoFjpgLM}r5Hgoe*`23Qy2o@O5h#cnX60y literal 0 HcmV?d00001 diff --git a/FileManager.md b/FileManager.md index 1e01e92..69b645f 100644 --- a/FileManager.md +++ b/FileManager.md @@ -1,4 +1,96 @@ -# FileManager +#** FileManager An amazingly useless tool! + +##** File Manager prompts + +######** Some basic commands of FileManager +''' +- list +- info +- mkdir +- rename +- copy +- quit +''' + +######** What the commands can do +''' +If a user wanted to create a folder, they would use mkdir to make the folder inside the java file manager. +If a user wanted to see the list of folders in a folder they can use this input to look through the folder contents. +If a user wanted to check the info of the file and check to see the history, size, absolute and relative path they could use this input. +If a user wanted to rename the folder, they would call the path of the folder and rename it with a different name. +If a user wanted to copy the folder and its contents they would need to enter the folder name and chose the path of where the copy folder should be found. +If a user wants to move a folder they would need to chose the folder and set the path of where it should be moved. +If a user wants to delete a folder, the user must chose the correct folder path. If a user wants to quit the program they can just enter quit and leave. +''' +''' +The main method for the program to do anything is to ask the user for a command, then a folder path and then follow extra instructions if you want to move, copy +and rename. +''' + +######** How would you add the idea of a current folder? +''' +So I think I would implement this command similar to the chose the path file prompt. +I think it would make sense to ask the user when they enter the path if they want to look at any specific folder or not. +If I wanted to make it as a command, it would work similarly to the info command. Ask the user to choose the folder it wants to adjust without opening it, then +continue asking what the user wants to do with the file. +''' + +######** How would you add a change folder command? +''' +I think for this command I would implement it similarly as copy/move. +I don't want to open the folder, but I would need to be able to ask the user for the current folder and the next folder they want to see. +Or I would ask the user to enter the folder that they would like to change from, but I would still need the current folder command to make the change. +''' + +######** How would you add a command to display the contents of a file? +''' +I think for this command I would set up similar to info. +The command would need a specific folder to enter and then the user would need to input the specific file to look at. +The only job is to display the contents like info or the command line prompt more. +''' + +######** How would you change list to show the difference between files and folders? +''' +I think an adjustment I would make would be in the method. +It would need to be able to identify folders with some key indication, like if it sees a folder in the path there would need to be a string that identifies it. +The same could be done with the files, it would need to be able to identify them by some ending. +In a normal finder the files have .txt,.pdf or some indication. +Folders don't have any indication, but for a basic command prompt like this it would be important to identify the difference. +''' +######** How could you clean up some of the code by sing an enum instead of strings for the commands? +''' +The enums would allow more freedom to have them change along the way and call them in different situations. +The strings have to be written out in every prompt, an enum would take the place at each point without having to write it out every time. +The repetition of the code would be less apparent. +''' +######** How would you use the FileOperator class to test the FileOperator class? +''' +One way to test the class would be to set the test class with a lot of assertEquals to check if the message is printed based on the conditional statements. +Making sure methods will work effectively in the code when called. +It's possible certain methods will need a boolean check to test if and when the code is called an assertTrue or assertFalse will work. +It would also be important to following with any classes being called from other sides to call the correct methods. +''' +######** How would test this code? Ho are the testing methods different for each class? Which class cannot be easily tested with unitTests? +''' +As I discussed in the previous question, the testing methods would require a lot of assertEquals for messages and a lot of assertTrue's/assertFalse's. +The tests would differ based on the methods actions and understanding if you need to make the expected equal to the actual or if you are just focused on checking +a true or false condition. +I think the console class would be difficult to test, because it requires an input from the user to return the input. +Other then that the FileManager method processCommand would be difficult to test because of the amount of case statements that would have to be tested. +''' + +######** Does the code, as is, have any obvious bugs? How would you find out? +''' +So there are situations when running the program that it won't identify the folders created even with the correct format. +It is difficult to use the program effectively without any instructions or directions. +The best way to find out anything in this course for bugs is to just throw things at it and see if the try/catch will activate. +''' + +######** Why is the console passed as a parameter to the two constructors? +''' +I think it is because it would be easier to use the console function without having to make it an object every single time. +Being able to designate the class as an instance variable will make the coding process easier to work with. +''' diff --git a/FileManagerWriteUp.txt b/FileManagerWriteUp.txt new file mode 100644 index 0000000..0bc40de --- /dev/null +++ b/FileManagerWriteUp.txt @@ -0,0 +1,87 @@ + + +My FileManager, an amazingly useless tool. + + +List: a folder +Info: on a file +Mkdir: make a new folder +Rename: a file +Copy, Move, delete: self explanatory +Quit: the file manager shell + + + +The list will allow you to look at all the files in the folder similar to the ls in the command folder. + +Info will let you look at file, without opening it up + +Mkdir will let you create a folder + +Rename will let you rename the a folder + +Copy will let you copy the folder and its contents + +Move will let you move the folder and its contents + +Delete will let you delete the folder and its contents + +Quit will let you quit the program + +If a user wanted to create a folder, they would use mkdir to make the folder inside the java file manager. If a user wanted to see the list of folders in a folder they can use this input to look through the folder contents. If a user wanted to check the info of the file and check to see the history, size, absolute and relative path they could use this input. If a user wanted to rename the folder, they would call the path of the folder and rename it with a different name. If a user wanted to copy the folder and its contents they would need to enter the folder name and chose the path of where the copy folder should be found. If a user wants to move a folder they would need to chose the folder and set the path of where it should be moved. If a user wants to delete a folder, the user must chose the correct folder path. If a user wants to quit the program they can just enter quit and leave. + +The main method for the program to do anything is to ask the user for a command, then a folder path and then follow extra instructions if you want to move, copy and rename. + +Why are the manipulation commands, the things that affect files and folders, in a different class than the file mnager itself? +One reason could be because it will keep the code clean and less cluttered. It would be easy to find the specific method without having to scroll too far down in one class. +It would be easier to call the methods from another class in each case statement than letting the main class do all the work. + + +Why is all the input and output factored out into a separate class? +Again I think it is still about organizing the code and keeping it as clean as possible. Another reason could be that the method in the console class only needs to focus on just that one method. No matter what prompt is entered in the method, it will return the input of the next line and the same for the send message method, which will take a message and print the message back. + +Why is Copy/move in the same method? What about the two operations are so much the same? How would you seperate them? Would it make it more understandable or less to separate them? + +I think they are in the same method because when you copy the folder and try to place it in the same location it won't work. However, if you copy and move it to another location the file will copy properly. The same can be said about move, if you try to move a folder to the same location with a folder that has the same name, it would not work. One way to separate them is to set move as a secondary option to copy and have move be its own option as well. It would make sure the user will move the file and provided the user with an option to just move the file without copying. I think it would not matter on understandability because the user would have to understand that no file with the same name can be in the same path folder. Even if a user doesn't understand that thought process, they can still test it and see that if the files are copied and added to the same place, it would not work. + + +How would you add the idea of a current folder? + +So I think I would implement this command similar to the chose the path file prompt. I think it would make sense to ask the user when they enter the path if they want to look at any specific folder or not. If I wanted to make it as a command, it would work similarly to the info command. Ask the user to choose the folder it wants to adjust without opening it, then continue asking what the user wants to do with the file. + +How would you add a change folder command? + +I think for this command I would implement it similarly as copy/move. I don't want to open the folder, but I would need to be able to ask the user for the current folder and the next folder they want to see. Or I would ask the user to enter the folder that they would like to change from, but I would still need the current folder command to make the change. + +How would you add a command to display the contents of a file? + +I think for this command I would set up similar to info. The command would need a specific folder to enter and then the user would need to input the specific file to look at. The only job is to display the contents like info or the command line prompt more. + + +How would you change list to show the difference between files and folders? + + +I think one adjustment would be to the method. It would need to be able to identify folders with some key indication, like if it sees a folder in the path there would need to be a string that identifies it. The same could be done with the files, it would need to be able to identify them by some ending. In a normal finder the files have .txt,.pdf or some indication. Folders don't have any indication, but for a basic command prompt like this it would be important to identify the difference. + +How could you clean up some of the code by sing an enum instead of strings for the commands? + +The enums would allow more freedom to have them change along the way and call them in different situations. The strings have to be written out in every prompt, an enum would take the place at each point without having to write it out every time. The repetition of the code would be less apparent. + +How would you use the FileOperator class to test the FileOperator class? + +One way to test the class would be to set the test class with a lot of assertEquals to check if the message is printed based on the conditional statements. Making sure methods will work effectively in the code when called. It's possible certain methods will need a boolean check to test if and when the code is called an assertTrue or assertFalse will work. It would also be important to following with any classes being called from other sides to call the correct methods. + +How would test this code? Ho are the testing methods different for each class? Which class cannot be easily tested with unitTests? + +As I discussed in the previous question, the testing methods would require a lot of assertEquals for messages and a lot of assertTrue's/assertFalse's. The tests would differ based on the methods actions and understanding if you need to make the expected equal to the actual or if you are just focused on checking a true or false condition. I think the console class would be difficult to test, because it requires an input from the user to return the input. Other then that the FileManager method processCommand would be difficult to test because of the amount of case statements that would have to be tested. + + +Does the code, as is, have any obvious bugs? How would you find out? + +So there are situations when running the program that it won't identify the folders created even with the correct format. It is difficult to use the program effectively without any instructions or directions. The best way to find out anything in this course for bugs is to just throw things at it and see if the try/catch will activate. + + +Why is the console passed as a parameter to the two constructors? +I think it is because it would be easier to use the console function without having to make it an object every single time. Being able to designate the class as an instance variable will make the coding process easier to work with. + + diff --git a/javamanager/.DS_Store b/javamanager/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..70a7860b395ea804de9018a11251d4dc75d8fe59 GIT binary patch literal 6148 zcmeHKPfNov6i>G4I)>1Lg5CmN2W~os!%M023s}*E%53b=Vr|CSxx*Oru3yM6;^*_j(p9m+RX~n&WMi2q38Qy8 zw!Xg(xb`ZOOfe~EU)P_+S>A4c@Jh9|u~~QOPSd#!9@Q+!!+e_g;p7@e7fL0v)I)h0 zk7h%6`&6ZQ7^kC&PKcusgxp-kX{2Vpnx;{va|7dW8ct*A?#<`Dezzq$-Q)J6CFcFZ zc1v`RdW%KF+1WohIUhbHJfd~%>$%a+9w-axV2iL(1d!tyZGnqGoQnyB;vEae1c zA|WwA3=jjv!1^#??*ON{K3k@p5(C7*4;jGoK|n+FEEWd!(E*(<0RU@Y)&e@#5||?_ zdKL?V-~r(#70{$|TVimN4t8PVJd1@vlg_v;KDhmIS-f!lb(ml1aK=4@)Dr{5z%m0^ z`+~T5|DVAxv$Dw7A=D8A#K3=LfY%1Wz=z%0yY<^X@varn?x3MyT!9J*=u3|P7~naw ftDVL#P=`3rVqp+xLAy=|q=$eeggRp27Z~^i?h;NT literal 0 HcmV?d00001 diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..9d6a56620545250bb9a34aa5ef87a586fdec28fa GIT binary patch literal 6148 zcmeH~J#ND=428+mgMlm_Giu2JdIP~oPS6W9ZI%FTJOtf!^gjNeK$Xr#5j+CqCsHB| zzriv^MCZ@*v&bYOBitx^3!N$QK|bUp7rCBq@5|e|E_r5?v@`HYy8YZHr~nn90#tws zP=SA>fZf}$aT{c$0#twsd@EqzhXOa&WDEMI1HnfCa6s7&Yo8^+Vg;}!TM!kPMk^St z>SKu2y&Wuht|nVB+C_8t(0sDm6a&*}7cEF&S{)2jfC_X9JVid){eOi2Hve}mOsN1B zcrXQYIJ_KYyj0$;cduvl*R0yQ!9hQc@Z%={iCx7zxEuD1Ex?*=K~!M;5pWq8sKB2p F@C6gX5~u(G literal 0 HcmV?d00001 diff --git a/src/main/.DS_Store b/src/main/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..d38176301af6a9db8e9ffa5dc7916732489a254b GIT binary patch literal 6148 zcmeH~JqiLr422WjLa^D=avBfd4F=H@cme+^5iCUOIl3=D2(H#5@&d^>$xK-G6+0Ud z(dF&95a~r^0yoOs!oU=HCnwp-U3SOo;k>_G&Ut2(v@`Ht2K%{9Pys4H1*iZOpaMUn zfZf}$$u!7F1*iZOcq(AuhXOa&WDEMI1HnfCutV7mYo8^+Vg;}!TM!kPMk^St>SKu2 zy&Wuht|nVB+C_8t(0sDm6a&*}7cEF&S{)2jfC>y07)RdQ{lA8Pn*RqaOsN1B_%j8x zTWwZLyj0$;Z?9+dZB}jF;GiEzc=-uHVps7D?uPwh3$P|z5EU4I1Y8CND)3bW9?Vn{ Ar2qf` literal 0 HcmV?d00001 diff --git a/target/.DS_Store b/target/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..cedaae4d194a50b3385f31f100727e90c605c965 GIT binary patch literal 6148 zcmeHKyH3ME5S$~Ch(r@Q%KHHd{=kaD7vu*38_`%;!b$Ir-)8nfAUL!XXg1m#-+0F- zPvOl1D4Rof2dn|Cn1*<_Wgd3lauyfK7#4rVh-Zx5*!EAutol4*+Do+P@raSXqkia3 zaE%vIugo_V?1>$2SvKH6ru|ud{tU5lKn}4#^_E~~hjUYCOQy>{e2`Mq8B}a@Ba`H9nn#3tEcEeZ7-a30Z>$R2n s!2Ar>dN~(w#YAt#+*m8V`Bqo$n)jQ;DbVHQT~5>=0rN#62mZo=5A`A+9RL6T literal 0 HcmV?d00001 diff --git a/test/.DS_Store b/test/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..7eb30df5caf28d5e852156ca48339a61f9c3d7be GIT binary patch literal 6148 zcmeHKF=_)r43uIQhBPi+?ic)n#W*j>2g1co;IIpm{;IqyPs@xXg3V!^CXE?^G<&ns zE;q&LWM;nmJZ#O@X10P8?TcY<+^5g%sTiX3jQ4Rkokp^Y+PVv@UD#kBc08Of>qk(- zC3W{GB}f4&AO)m=6p#XcPyjufwt7xflmb#f3j8X-??ZzVd*PHApALi=0f0-;VOYm3 z0c<3Iy>Lnd1M@5eW~tYR;aLv8RbDTg60_VqZpJxvv)6>;aXa`H>E=CAQ3^