Problems

Take a look at the following problems in order to test your Java I/O programming prowess. I strongly encourage you to give each problem a try before you turn to the solutions and download the example programs:

  1. Creating file paths: Write several examples of creating several kinds of file paths (for example, absolute paths, relative paths, and so on).
  2. Converting file paths: Write several examples of converting file paths (for example, converting a file path into a string, URI, file, and so on).
  3. Joining file paths: Write several examples of joining (combining) file paths. Define a fixed path and append other different paths to it (or replace a part of it with other paths).
  4. Constructing a path between two locations: Write several examples that construct a relative path between two given paths (from one path to another).
  5. Comparing file paths: Write several examples of comparing the given file paths.
  6. Walking paths: Write a program that visits all the files within a directory, including subdirectories. Moreover, write a program that searches a file by name, deletes a directory, moves a directory, and copies a directory.
  7. Watching paths: Write several programs that watch changes that occur on a certain path (for example, create, delete, and modify).
  8. Streaming a file's content: Write a program that streams the content of the given file.
  9. Searching for files/folders in a file tree: Write a program that searches for the given files/folders in the given file tree.
  10. Reading/writing text files efficiently: Write several programs to exemplify different approaches for reading and writing a text file in an efficient manner.
  11. Reading/writing binary files efficiently: Write several programs to exemplify different approaches for reading and writing a binary file in an efficient manner.
  12. Searching in big files: Write a program that efficiently searches the given string in a big file.
  13. Reading a JSON/CSV file as an object: Write a program that reads the given JSON/CSV file as an object (POJO).
  14. Working with temporary files/folders: Write several programs for working with temporary files/folders.
  15. Filtering files: Write several user-defined filters for files.
  16. Discovering mismatches between two files: Write a program that discovers the mismatches between two files at the byte level.
  17. Circular byte buffer: Write a program that represents an implementation of a circular byte buffer.
  18. Tokenizing files: Write several snippets of code to exemplify different techniques of tokenizing a file content.
  19. Writing formatted output directly to a file: Write a program that formats the given numbers (integers and doubles) and outputs them to a file.
  20. Working with Scanner: Write several snippets of code to reveal Scanner capabilities.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset