How shubhamrasal/11-packer_unpacker-java works
Project type and purpose
• This is a standalone desktop Java application (using Swing for its GUI) whose sole responsibility is to pack multiple files into a single metadata-driven archive and to unpack that archive back into individual files.
• Presentation layer: Swing UI frames (login, packFrame, secondFrame, UnpackFrame)
• Processing layer: core file-packing logic (Packer.java, UnPacker.java)
File structure
• Top-level classes:
• login.java – entry point, handles user authentication
• packFrame.java, secondFrame.java, UnpackFrame.java – Swing windows for packing workflow, post-login navigation, and unpacking workflow
• ClockLabel.java – a GUI utility component (probably shows the current time)
• Packer.java – implements the pack operation (reads many files, writes a single metadata+data file)
• UnPacker.java – implements the unpack operation (reads the archive, reconstructs original files)
• No external configuration or deployment scripts are present; the application runs from the command line via javac / java.
README for insights
• Workflow:
1. Compile the entire project: javac login.java
2. Launch the UI: java login
3. User enters credentials (hard-coded “abcd/abcd”)
4. Access “Pack” or “Unpack” UIs to perform file operations
• The README confirms that metadata (file names, sizes, timestamps) is bundled with the binary data.
a. Main components
• Presentation Layer
• Login Window
• Packing Window
• Unpacking Window
• Utility Widget (ClockLabel)
• Processing Layer
• Packer Module
• UnPacker Module
• Storage
• Local File System (Input Directory, Output Directory, .pak Archive)
b. Relationships & Data Flow
1. User → Login Window
2. Login Window → Application Controller
3. Controller → either Packing Window or Unpacking Window
4. Packing Window → invokes Packer Module → writes PackedArchive(.pak) to File System
5. Unpacking Window → invokes UnPacker Module → reads PackedArchive(.pak) → recreates files on File System
c. Architectural patterns & principles
• Layered separation (UI vs core processing)
• Single responsibility classes (each Frame handles only its own UI flow; Packer/UnPacker focus solely on I/O logic)
• Simple MVC-style delegation: UI “Controllers” trigger business logic modules
d. Key technologies
• Java Swing (javax.swing.*) for all GUI components
• Java IO / NIO for file and stream handling
• Standard JDK—no external dependencies