This Java project provides a simple way to zip and unzip multiple files using two main components: Packer.java
and Unpacker.java
. The Packer
class allows you to create a compressed archive of files from a specified folder, while the Unpacker
class lets you extract files from the generated archive.
- File Zipping: Use the
Packer
class to compress files from a specified folder into a single archive. - File Unzipping: Utilize the
Unpacker
class to extract files from the generated archive. - Customizable Archive Name: You can specify the desired name for the output archive file when using the
Packer
.
Before using this project, ensure you have the following prerequisites installed on your system:
- Java Development Kit (JDK)
- Git (optional, for cloning the repository)
-
Clone this repository to your local machine using the following command (if you haven't already):
git clone https://github.com/your-username/your-repo.git
-
Compile the Java source files:
javac Packer.java Unpacker.java
-
You are now ready to use the
Packer
andUnpacker
classes.
To create a compressed archive, follow these steps:
-
Open a terminal.
-
Navigate to the project directory containing the compiled
.class
files. -
Run the
Packer
class with the following command:java Packer
-
When asked, give the folder name containing the files to be compressed:
java Packer
-
Give the output file any name you want.
-
A compressed text file named
givenName.txt
will be created in the same directory.
To extract files from the archive, follow these steps:
-
Open a terminal.
-
Navigate to the project directory containing the compiled
.class
files. -
Run the
Unpacker
class with the following command:java Unpacker
-
Enter the text file name created when Packing.
-
The files from the compressed text file will be extracted to the current directory.
Contributions are welcome! If you have any suggestions, improvements, or bug fixes, please open an issue or create a pull request. For major changes, please discuss them in advance.
This project is licensed under the MIT License.