SafeShare is a fully functional secure file transfer application built with a Java Swing UI and a MySQL database for persistent data storage and access control.
SafeShare enables secure management and sharing of files with a robust two-role system — Administrator and User — ensuring that sensitive documents are only accessed by authorized individuals.
- Register for an account with enhanced validation:
- Password strength checker
- Mobile number validation (10 digits only)
- Input field validation
- Log in securely to their personal dashboard
- Browse a list of available files
- Request access to specific files
- View approved files using a unique access key
- Manage the entire file repository (upload/delete)
- View and manage all user access requests
- Approve or reject file access requests
- View detailed user profiles before granting access
All data is persistently stored in a MySQL database, ensuring user information, files, and access rights are retained between sessions.
SafeShare/
├── src/main/java/com/example/securefiletransfer/
│ ├── SecureFileTransfer.java # Main application entry point
│ ├── DatabaseManager.java # JDBC operations & database layer
│ ├── AdminPanel.java # Admin dashboard UI and logic
│ ├── UserPanel.java # User dashboard UI and logic
│ ├── LoginPanel.java # Login screen UI
│ ├── RegisterPanel.java # Registration screen UI
│ ├── FileHandler.java # Logic for viewing/handling files
│ ├── PasswordStrengthDots.java # Custom UI component for password strength
│ └── ... (other UI and helper classes)
│
├── database/
│ └── database.sql # Complete MySQL database schema
│
└── pom.xml # Maven project configuration and dependencies
| Component | Version |
|---|---|
| Java Development Kit (JDK) | 17 or higher |
| Apache Maven | 3.6 or higher |
| MySQL Server | 5.7 or higher |
| OS | Windows / Linux / macOS |
| RAM | Minimum 512 MB |
| Disk Space | 50 MB (application + database) |
- Install JDK 17+
- Install Apache Maven
- Install and run MySQL Server
git clone https://github.com/yourusername/SafeShare.git
cd SafeShareStart your MySQL Server, then run:
CREATE DATABASE IF NOT EXISTS secure_file_transfer;
USE secure_file_transfer;
-- Execute the full content of database/database.sqlEdit src/main/java/com/example/securefiletransfer/DatabaseManager.java and update these lines:
private static final String DB_URL = "jdbc:mysql://localhost:3306/secure_file_transfer";
private static final String DB_USER = "your_username";
private static final String DB_PASSWORD = "your_password"; // Change if neededmvn clean installmvn exec:java -Dexec.mainClass="com.example.securefiletransfer.SecureFileTransfer"| Role | Username | Password |
|---|---|---|
| Administrator | admin | 00000 |
- Role-based access (User/Admin)
- Secure login system
- Registration with validation
- Password strength indicator
- Upload/Delete files
- View and approve/reject requests
- View user details before approval
- Request file access
- View approved files via access key
- In-app file viewer for PDF, Images, and Text
- Data stored in MySQL
- Prevents SQL injection (PreparedStatement)
- Clear UI-database separation
- Enhanced input validation
- Optimized form performance
Tables:
users– Stores user accounts, credentials, and rolesfiles– Stores file metadata and content (LONGBLOB)requests– Tracks file access requests, status, and keys
- Run:
mvn clean install - Verify main class path
- Ensure MySQL is running and accessible on port 3306
- Verify credentials in
DatabaseManager.java - Run
SHOW TABLES;to confirm database setup
- Ensure default admin was inserted by
database.sql - Verify DB connection
Current Implementation:
- Parameterized queries to prevent SQL injection
- Passwords stored in plain text (demo purpose)
For Production:
- Use password hashing (e.g., bcrypt)
- Encrypt files before storing
- Implement audit logging
- File encryption at rest
- Email notifications for request updates
- File download functionality
- User group management
- Enhanced admin controls
- Search and filtering options
- Email validation
- Additional form validations
- Enhanced mobile number formatting
Last Updated: October 19, 2025
Status: Completed
- Enhanced mobile number validation:
- Strictly enforces 10-digit requirement
- Real-time validation using DocumentFilter
- Only allows numeric input
- Improved registration form:
- Optimized scrolling performance
- Added helpful tooltips
- Clear fields after successful registration
- Removed address field from system
- Updated database schema
- Simplified registration process
- Migration script provided