Finding Duplicate Files is a practical Java project for learners ready to work with real file contents. Build a reusable, read-only checker that finds complete groups of equal files while preserving every original path. Different names can hide identical bytes; matching names or sizes can hide different contents.
The course contains two Guided Labs and one Challenge. First, read binary streams and save a complete path inventory. Then use size and SHA-256 fingerprints to narrow candidates, confirm equality with actual byte comparison, and regenerate the report after changing a practice copy. The Challenge applies the same mechanisms to a different archive folder. Each lab starts independently. Allow about 150 minutes; this is an author estimate including reading and ordinary corrections.
What You Will Learn
After completing this course, you will be able to:
- read binary files with
try-with-resourcesand use the actual length returned by each read; - calculate SHA-256 candidate fingerprints and inventory every path, including empty files and partial final buffers;
- confirm candidate equality by comparing real bytes rather than treating names, sizes or digests as proof;
- retain every member of a duplicate group, including groups of three or more, while leaving unique files out;
- regenerate a current report after a practice-file change and preserve all original files;
- write reports outside the scanned tree and report unreadable or unsupported inputs as failures.
Who This Course Is For
This course is for Java learners who want to combine standard-library file handling, collections and exceptions in a useful terminal program.
Prerequisites: Java classes, methods, basic collections, exceptions, elementary file reading and basic terminal navigation. Managing a Community Tool Library, especially its second Guided Lab, provides the file-reading and I/O-exception background; equivalent knowledge is also suitable. This course explains binary streams, read counts, resource closure and candidate-versus-byte comparison before use.
Learning environment: LabEx provides a browser-based WebIDE with an integrated terminal, Java compiler, starter code and real sample files, including small PNG images. You can run and inspect the files without installing Java locally. Program commands, labels and output remain in English.
Frequently Asked Questions
Will the program delete duplicate files?
No. The deliverable is a checker and a complete group report for review. Every original file is preserved; automatic deletion, repair and disk cleanup are outside the project.
Why compare bytes after calculating a fingerprint?
Size and SHA-256 help select candidates. The final decision comes from actual content comparison, so the program can keep every equal path and separate same-size files with different contents. The course does not treat a digest as mathematical proof of equality.
Which inputs does the project support?
Stable ordinary files and directories, including spaces and UTF-8 filenames. Symbolic links, special files and paths containing tabs or newlines are rejected. A read failure must not appear as a complete successful scan. Reports stay outside the input tree. Each lab supplies its own data; no previous VM files are needed, and concurrent snapshot guarantees are not part of this project.

