2121import org .apache .commons .compress .archivers .zip .ZipArchiveInputStream ;
2222import org .apache .commons .compress .compressors .bzip2 .BZip2CompressorInputStream ;
2323import org .apache .commons .compress .compressors .gzip .GzipCompressorInputStream ;
24+ import org .apache .commons .compress .compressors .zstandard .ZstdCompressorInputStream ;
2425import org .apache .commons .io .FileUtils ;
2526import org .eclipse .core .runtime .IPath ;
2627import org .eclipse .core .runtime .IProgressMonitor ;
@@ -79,27 +80,34 @@ private static IStatus processArchive(String pArchiveFileName, IPath pInstallPat
7980 // Create an ArchiveInputStream with the correct archiving algorithm
8081 String faileToExtractMessage = Messages .Manager_Failed_to_extract .replace (FILE , pArchiveFullFileName );
8182 if (pArchiveFileName .endsWith ("tar.bz2" )) { //$NON-NLS-1$
82- try (ArchiveInputStream inStream = new TarArchiveInputStream (
83+ try (TarArchiveInputStream inStream = new TarArchiveInputStream (
8384 new BZip2CompressorInputStream (new FileInputStream (pArchiveFullFileName )))) {
8485 return extract (inStream , pInstallPath .toFile (), 1 , pForceDownload , pMonitor );
8586 } catch (IOException | InterruptedException e ) {
8687 return new Status (IStatus .ERROR , Activator .getId (), faileToExtractMessage , e );
8788 }
8889 } else if (pArchiveFileName .endsWith ("zip" )) { //$NON-NLS-1$
89- try (ArchiveInputStream in = new ZipArchiveInputStream (new FileInputStream (pArchiveFullFileName ))) {
90+ try (ZipArchiveInputStream in = new ZipArchiveInputStream (new FileInputStream (pArchiveFullFileName ))) {
9091 return extract (in , pInstallPath .toFile (), 1 , pForceDownload , pMonitor );
9192 } catch (IOException | InterruptedException e ) {
9293 return new Status (IStatus .ERROR , Activator .getId (), faileToExtractMessage , e );
9394 }
9495 } else if (pArchiveFileName .endsWith ("tar.gz" )) { //$NON-NLS-1$
95- try (ArchiveInputStream in = new TarArchiveInputStream (
96+ try (TarArchiveInputStream in = new TarArchiveInputStream (
9697 new GzipCompressorInputStream (new FileInputStream (pArchiveFullFileName )))) {
9798 return extract (in , pInstallPath .toFile (), 1 , pForceDownload , pMonitor );
9899 } catch (IOException | InterruptedException e ) {
99100 return new Status (IStatus .ERROR , Activator .getId (), faileToExtractMessage , e );
100101 }
102+ } else if (pArchiveFileName .endsWith ("tar.zst" )) { //$NON-NLS-1$
103+ try (TarArchiveInputStream in = new TarArchiveInputStream (
104+ new ZstdCompressorInputStream (new FileInputStream (pArchiveFullFileName )))) {
105+ return extract (in , pInstallPath .toFile (), 1 , pForceDownload , pMonitor );
106+ } catch (IOException | InterruptedException e ) {
107+ return new Status (IStatus .ERROR , Activator .getId (), faileToExtractMessage , e );
108+ }
101109 } else if (pArchiveFileName .endsWith ("tar" )) { //$NON-NLS-1$
102- try (ArchiveInputStream in = new TarArchiveInputStream (new FileInputStream (pArchiveFullFileName ))) {
110+ try (TarArchiveInputStream in = new TarArchiveInputStream (new FileInputStream (pArchiveFullFileName ))) {
103111 return extract (in , pInstallPath .toFile (), 1 , pForceDownload , pMonitor );
104112 } catch (IOException | InterruptedException e ) {
105113 return new Status (IStatus .ERROR , Activator .getId (), faileToExtractMessage , e );
@@ -109,7 +117,7 @@ private static IStatus processArchive(String pArchiveFileName, IPath pInstallPat
109117 }
110118 }
111119
112- private static IStatus extract (ArchiveInputStream in , File destFolder , int stripPath , boolean overwrite ,
120+ private static IStatus extract (ArchiveInputStream <?> in , File destFolder , int stripPath , boolean overwrite ,
113121 IProgressMonitor pMonitor ) throws IOException , InterruptedException {
114122
115123 // Folders timestamps must be set at the end of archive extraction
0 commit comments