"Hej, Amigo!" Jeg fandt på et par interessante opgaver til dig."
"De kan kun gennemføres i IntelliJ IDEA. Tag et kig på disse interessante forhold..."
14
Opgave
Java Collections, niveau, lektie
Your own implementation
Implement the following methods:
1. readBytes - must return all of the bytes in the fileName file.
2. readLines - must return all of the lines in the fileName file. Use the default encoding.
3. writeBytes - must write a byte array to the fileName file.
14
Opgave
Java Collections, niveau, lektie
Search for hidden files
In the Solution class, override the logic of the following two methods:
visitFile - in addition to the existing logic, add all paths to ZIP and RAR files to the archived field;
visitFileFailed - add all paths to inaccessible files to the failed field and return SKIP_SUBTREE.
14
Opgave
Java Collections, niveau, lektie
File downloader
Implement a downloadFile(String urlString, Path downloadDirectory) method whose inputs are a URL to a file to be downloaded and the destination folder for the download.
The method must create a URL object and download the file's contents to the local disk. Download it to a temporary directory first so that if the download fails, there won't be partially downloaded files in your directory.
28
Opgave
Java Collections, niveau, lektie
What's in the folder?
Write a program that will read detailed information about a folder and display it on the console.
First of all, read the folder path from the console.
If the entered path is not a directory, display "[full path] is not a folder" and exit the program.