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 directorystatic Path
Create a temporary archive when uploading directory layersstatic LocalPath
Create a tar.gz file from a directorystatic LocalPath
tarcompress
(LocalPath sourceDir, String mediaType) Create a tar compressed 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 Path
uncompressuntar
(Path path, String mediaType) Uncompress a compressed file and untar to a temporary directorystatic void
uncompressuntar
(Path path, Path target, String mediaType) Uncompress a compressed file and untar it to the target directorystatic void
untar
(InputStream fis, Path target) Extract a tar file to a target directorystatic Path
Convienience method to extract a tar file to a temporary directorystatic void
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
-
createTempDir
Create a temporary directory- Returns:
- The path to the temporary directory
-
tar
Create a tar.gz file from a directory- Parameters:
sourceDir
- The source directory- Returns:
- The path to the tar.gz file
-
tarcompress
Create a tar compressed file from a directory- Parameters:
sourceDir
- The source directorymediaType
- The media type- Returns:
- The path to the tar compressed file
-
untar
Extract a tar file to a target directory- Parameters:
path
- The tar filetarget
- The target directory
-
uncompressuntar
Uncompress a compressed file and untar it to the target directory- Parameters:
path
- The compressed filetarget
- The target directorymediaType
- The media type of the compressed file
-
uncompressuntar
Uncompress a compressed file and untar to a temporary directory- Parameters:
path
- The compressed filemediaType
- The media type of the compressed file- Returns:
- The path to the temporary directory
-
untar
Convienience method to extract a tar file to a temporary directory- Parameters:
path
- The tar file- Returns:
- The path to the temporary directory
-
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
-