Package land.oras.utils
Class ArchiveUtils
java.lang.Object
land.oras.utils.ArchiveUtils
Archive utilities
-
Method Summary
Modifier and TypeMethodDescriptionstatic LocalPath
Compress a tar file to a tar.gz or tar.zstd file depending on the requested media typestatic Path
Create a temporary archive when uploading directory layersstatic LocalPath
Create a tar.gz file from a directorystatic LocalPath
uncompress
(InputStream is, String mediaType) Extract a compressed file from a tar.gz or tar.zstd file depending on the requested media typestatic void
untar
(InputStream fis, Path target) Extract a tar file to a target directory
-
Method Details
-
createTempTar
Create a temporary archive when uploading directory layers- Returns:
- The path to the archive
-
tar
Create a tar.gz file from a directory- Parameters:
sourceDir
- The source directory- Returns:
- The path to the tar.gz file
-
untar
Extract a tar file to a target directory- Parameters:
fis
- The archive streamtarget
- The target directory
-
compress
Compress a tar file to a tar.gz or tar.zstd file depending on the requested media type- Parameters:
path
- The tar filemediaType
- The target media type- Returns:
- The path to the tar.gz file or the tar.zstd file
-
uncompress
Extract a compressed file from a tar.gz or tar.zstd file depending on the requested media type- Parameters:
is
- The compressed input streammediaType
- The media type of the stream to select the uncompression method- Returns:
- The path to the tar.gz file or the tar.zstd file
-