Skip to content

PrasiddhShah/distributed-file-transfer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Distributed File Transfer System

A client–server file transfer system built in Java, implemented twice with two different distributed computing approaches: raw TCP sockets and Java RMI (Remote Method Invocation). Both versions support resumable uploads and downloads, so an interrupted transfer picks up where it left off instead of restarting.

Built as part of SWE 622 (Distributed Software Engineering) at George Mason University.

Features

  • Upload and download files between client and server
  • Resumable transfers: if a transfer is interrupted, rerunning the command resumes from the last byte received rather than starting over
  • Remote directory management: dir, mkdir, rmdir, rm
  • Remote server shutdown command
  • Server address configured via the PA1_SERVER environment variable

Two Implementations

socket-version rmi-version
Transport Raw TCP sockets (ServerSocket, DataInputStream/DataOutputStream) Java RMI with a shared Remote interface
Protocol Custom command protocol written by hand over the socket streams Remote method calls (upload, download, dir, etc.) via an RMI registry
Transfer resume Server reports existing partial file size; client skips ahead in the stream Client polls transfer state (currentStatus, getRead) and resumes by byte offset

Implementing the same system both ways highlights the tradeoff: sockets give full control over the wire protocol at the cost of manual framing and error handling, while RMI abstracts the network away behind method calls.

Quick Start

Requires Java 8+.

# Compile (from either socket-version/ or rmi-version/)
cd socket-version
javac -d out src/*.java

# Terminal 1: start the server
java -cp out Server start 9090

# Terminal 2: point the client at the server, then run commands
export PA1_SERVER=localhost:9090
java -cp out Client upload <local_path> <server_path>
java -cp out Client download <server_path> <local_path>

See each version's README for the full command reference: socket-version · rmi-version

Project Structure

├── socket-version/     # TCP socket implementation
│   └── src/
│       ├── Client.java
│       └── Server.java
└── rmi-version/        # Java RMI implementation
    └── src/
        ├── RMIInterface.java   # Shared remote interface
        ├── Client.java
        └── Server.java

Author

Prasiddh Shah

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages