- Navigate to the
srcfolder and run the following command:javac -cp . ./Main/Main.java ./discovery/.java ./discovery/messages/.java ./p2p/.java ./testing/.java - Start the central server:
java -cp . Main.Main central <!CentralServerIP!> <!CentralServerPort!>
- Start a peer:
java -cp . Main.Main peer <!PeerIP!> <!PeerPort!> <!CentralServerIP!> <!CentralServerPort!>
- Run the peer command as shown above.
- Use the following command to upload a file:
upload <!FILEPATHINOS!>
- Run the peer command as shown above.
- Use the following command to download a file:
download
- In the
testdirectory, add a file containing the paths of all the files to be tested. - Run the following command to start testing:
java -cp . Main.Main testing <!test Name!>
Currently, the test will use a three-node setup to perform the testing.
-
src/Main/Main.java: Entry point. Parses CLI, adapts peer/central roles, and user commands.
discovery/CentralRegistry.java: Central server logic for file and peer discovery.Handshake.java: Session setup and request/response coordination between peers and central.FileData.java: Metadata for files (name, size, hash) used across discovery and transfer.Node.java: Represents a peer (IP, port, identity).messages/: Serializable message types exchanged over the networkCentralRegistryRequest.java,CentralRegistryResponse.javaFileRequest.java,FileResponse.javaTransferRequest.java,TransferResponse.javaBroadcastBeacon.java: Beacon used for UDP broadcast transfers.
p2p/ConnectionHandlerSequential.java: Encrypted sequential TCP file send/receive.ConnectionHandlerParallel.java: Simpler TCP send/receive variant.FileReciever.java: High-level download flow (queries registry, selects peer, saves to downloads dir).ObjectTransfer.java: Object serialization over TCP and UDP broadcast helpers.BroadCastTransfer.java: File broadcasting and reception over UDP using beacons.
testing/FileTesting.java: Test harness that spins up central, sender, receiver from a list of file paths.
utils/UserExperience.java: Console progress bar utilities for transfers.Config.java: Centralized config loader; providesgetTestDir()andgetDownloadsDir().
test/- Test input lists (e.g.,
unit.txt,big.txt,encryption.txt) consumed in testing mode.
- Test input lists (e.g.,
downloads/- Default downloads target directory (configurable via
config.properties).
- Default downloads target directory (configurable via
-
bin/- Compiled
.classfiles organized mirroringsrc/packages.
- Compiled
-
config.properties- Repository-level configuration for directories:
test.dir: Directory containing test list files (default./src/test).downloads.dir: Directory where downloads are saved (default./src/downloads).
- Repository-level configuration for directories: