CodeGym /Courses /Java Collections /Practice with Files and Path

Practice with Files and Path

Java Collections
Level 1 , Lesson 4
Available

"Hi, Amigo!" I came up with a couple of interesting tasks for you."

"They can only be completed in IntelliJ IDEA. Take a look at these interesting conditions…"

14
Task
Java Collections, level 1, lesson 4
Locked
Your own implementation
Your own implementation
14
Task
Java Collections, level 1, lesson 4
Locked
Search for hidden files
Search for hidden files
14
Task
Java Collections, level 1, lesson 4
Locked
File downloader
File downloader
28
Task
Java Collections, level 1, lesson 4
Locked
What's in the folder?
What's in the folder?
Comments (10)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
TheLordJackMC Level 39, Princeton, idk somewhere
6 August 2021
i hate it when there's text and i edit it, but then it doesnt print .-.
Andrei Level 41
15 June 2021
Good exercises once you check the solution and try to go line by line to understand. Like you would do in a class before attempting yourself. Otherwise, just trying to solve them by yourself it would take crazy amount of time IMO. My method: first try myself for a while, try at least to generate the pseudo-code, the logic of how it would work. Then try and write some of the prepcode. When I get stuck try some googling. If not successful check solution and see what's different.
Justin Smith Level 41, Greenfield, USA, United States
30 July 2022
My same process. There have definitely been some where I get stuck and I can't figure out why (like it appears to produce the correct result but won't validate), and then I look at the solution.
Wei Cui Level 39, Newark, United States
18 March 2020
hint for Your own implementation task Files.method wrap Paths.method from this link find needed method https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html
Csaba Gódor Level 36, Budapest, Hungary
17 January 2020
>> https://www.baeldung.com/java-nio-2-file-api for more infos
Robert Constantinescu Level 1, Bucharest, Romania
16 December 2019
Really, these new methods needs at least some examples... it's a little bit frustrating. It's doable, but i find the effort to search and implement the program according to the requirements without examples a little bit too much
Csaba Gódor Level 36, Budapest, Hungary
16 January 2020
found some using the link in the last row, https://docs.oracle.com/javase/tutorial/essential/io/legacy.html scroll down a bit and "Tutorial Coverage" last column of the API table
hurzel purzel Level 22, Stuttgart, Germany
17 July 2019
I wish the knowledge needed for this excercise were actually taught in the lesson(s) before. We learned about "Path" and "Files", but not about "Paths".
Ewerton Level 30, Belo Horizonte, Brasil
8 July 2019
For the "File Downloader" one, don't create a temp directory, only a temp file. I was stuck trying to debug it for almost an hour. And if you are getting "FileAlreadyExistsException", just use REPLACE_EXISTING, on move and copy methods.
Misiu Level 41, Gdansk, Poland
22 August 2020
Hm... Lesson says: "It's very simple. Look at this example: Path tempFile = Files.createTempFile("temp-",".tmp"); Files.copy(inputStream, tempFile);" I had problem with FileAlreadyExistsException too. Thank you :)