Package land.oras.utils
Class ArchiveUtils
java.lang.Object
land.oras.utils.ArchiveUtils
Archive utilities
-
Method Summary
Modifier and TypeMethodDescriptionstatic LocalPathCompress a tar file to a tar.gz or tar.zstd file depending on the requested media typestatic PathCreate a temporary directorystatic PathCreate a temporary archive when uploading directory layersstatic LocalPathCreate a tar.gz file from a directorystatic LocalPathtarcompress(LocalPath sourceDir, String mediaType) Create a tar compressed file from a directorystatic LocalPathuncompress(InputStream is, String mediaType) Extract a compressed file from a tar.gz or tar.zstd file depending on the requested media typestatic Pathuncompressuntar(Path path, String mediaType) Uncompress a compressed file and untar to a temporary directorystatic voiduncompressuntar(Path path, Path target, String mediaType) Uncompress a compressed file and untar it to the target directorystatic voiduntar(InputStream fis, Path target) Extract a tar file to a target directorystatic PathConvienience method to extract a tar file to a temporary directorystatic voidExtract 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
-