GroupDocs.Merger allows developers to combine multiple ZIP documents in the preferred order and save them as a single file. You will not spend your time doing these operations manually on desktop software.
With GroupDocs.Merger it is possible to combine archive documents of any archive extensions such as ZIP or TAR.
The following example demonstrates how to merge archive files with several lines of Java code:
Create an instance of Merger class and pass source archive file path as a constructor parameter. You may specify absolute or relative file path as per your requirements.
Add another archive file to merge with Join method. Repeat this step for other archive documents you want to merge.
Call Merger class save method and specify the filename for the merged archive file as parameter.
// Load the source archive file
Mergermerger=newMerger("c:\sample1.zip");{// Add another archive file to merge
merger.join("c:\sample2.zip");// Merge archive files and save result
merger.save("c:\merged.zip");}
Merge different archive file formats
This section describes how to merge different archive file formats using GroupDocs.Merger API. Please look at the articles listed below: