EasyShare splits files into chunks, exchanges the chunks directly between connected peers and validates every piece with a SHA-1 hash. No central file server: every downloader becomes an uploader.
Download project (.zip) Read the user manualThe peer-to-peer network runs on your own computers (Windows, JDK 17+). This website is the project's documentation and download page.
A tracker only answers "who has this file?". Pieces flow directly between peers, several at once, and each piece is checked against its SHA-1 hash before it is written to disk.
Each shared file is cut into 256 KB pieces. The SHA-1 of every piece and of the metadata (the info hash) is computed.
Peers announce their files to a tracker every 15 s, or find each other on the LAN with UDP multicast, or connect by IP.
One thread per peer. A shared piece manager hands out the rarest missing piece, never the same piece twice.
Bad pieces are discarded and fetched again; peers sending 5 bad pieces are blocked. The whole file is verified at the end.
Everything is plain Java — sockets, threads, MessageDigest — with no external libraries.
| Concept | Implementation |
|---|---|
| File chunking | Fixed-size pieces written at their byte offset into a pre-allocated .part file |
| Cryptographic hashing | SHA-1 per piece, whole-file SHA-1, info hash = SHA-1 of the metadata |
| Multithreaded socket streams | Thread-pool upload server; coordinator + one worker thread per peer for downloads |
| Peer discovery | Tracker (TCP text protocol), LAN discovery (UDP multicast), manual connect ip:port |
| Swarming | Rarest-first piece selection; partial downloads are shared immediately; completed files are seeded |
| Resume | Pieces on disk are re-verified after a restart; only missing pieces are downloaded |
| Interfaces | Console commands and a live web dashboard served by Java's built-in HttpServer |
| Testing | Automated end-to-end self-test: 12 checks with a tracker and 7 peers |
Needs a JDK 17 or newer. Everything else is in the zip.
build.bat to compile EasyShare.jar.demo.bat. A tracker and three peers (Alice, Bob, Carol) open in separate windows.search then get 3, or use her dashboard at http://localhost:8003.Carol> get 3
Downloading sample-video.bin (12.0 MB, 48 pieces)
! Piece #31 from Bob failed SHA-1 check
-> discarded, will download again
[##############################] 100%
DOWNLOAD COMPLETE
Pieces received from each peer:
Alice (127.0.0.1:6001) 25 pieces
Bob (127.0.0.1:6002) 23 pieces
Corrupted pieces re-downloaded: 3
Integrity: VERIFIED
Each one proves a concept from the project brief. Step-by-step instructions are in the user manual.
Carol receives pieces from Alice and Bob at the same time — shown per peer in the summary and dashboard.
Bob runs with --corrupt 15. Every damaged piece is caught by SHA-1 and never written to disk.
Press Enter, close the program, start it again and type resume — verified pieces are kept.
A 4th peer, Dave, downloads pieces from Carol while Carol is still downloading.
Close the tracker and use discover (UDP multicast) or connect ip:port.
Run messenger.bat on each PC: everyone on the LAN is listed; select a PC, attach files and click Send.
Run phone.bat and open the printed address on a phone: download files from the PC or upload photos to it.
Edit a shared file and run verify: the changed piece is reported as corrupted.
| File | What it does |
|---|---|
build.bat | Compiles the Java sources into EasyShare.jar |
messenger.bat | IP Messenger-style window: other PCs appear automatically; send messages, files and folders |
demo.bat | Starts a tracker and three peers on one computer with sample files |
demo-dave.bat | Adds a fourth peer to the running demo |
start-tracker.bat | Starts a tracker for a real LAN setup |
start-peer.bat | Starts a peer; asks for name, port and tracker address |
phone.bat | Lets a phone on the same Wi-Fi download and upload files in its browser |
run-tests.bat | Runs the automated end-to-end tests |
clean-demo.bat | Deletes demo folders to start fresh |