java.lang.Object
org.miaixz.bus.extra.compress.archiver.SevenZArchiver
- All Implemented Interfaces:
Closeable,AutoCloseable,Archiver
7zip format archiver wrapper.
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
ConstructorsConstructorDescriptionSevenZArchiver(File file) Constructor.Constructor.SevenZArchiver(SeekableByteChannel channel) Constructor. -
Method Summary
-
Constructor Details
-
SevenZArchiver
Constructor.- Parameters:
file- The archive output file.
-
SevenZArchiver
Constructor.- Parameters:
out- The archive output stream.
-
SevenZArchiver
Constructor.- Parameters:
channel- The archive output channel.
-
-
Method Details
-
getSevenZOutputFile
public org.apache.commons.compress.archivers.sevenz.SevenZOutputFile getSevenZOutputFile()Gets theSevenZOutputFileto allow for custom settings.- Returns:
- The
SevenZOutputFile.
-
add
public SevenZArchiver add(File file, String path, Function<String, String> fileNameEditor, Predicate<File> filter) Description copied from interface:ArchiverAdds a file or directory to the archive package. Directories are added recursively level by level.- Specified by:
addin interfaceArchiver- Parameters:
file- The file or directory.path- The initial path of the file or directory. If null, it is placed at the root level.fileNameEditor- A function to edit the file name.filter- A file filter that specifies which files or directories can be added. IfPredicate.test(Object)istrue, the file is kept. If null, all are added.- Returns:
- this
-
finish
Description copied from interface:ArchiverFinishes archiving the added files. This method does not close the archive stream, allowing more files to be added. -
close
public void close()Description copied from interface:ArchiverCloses without throwing an exception.
-