Class Decompressor<T extends Decompressor<T>>

java.lang.Object
com.imyeyu.compress.AbstractRunner<T>
com.imyeyu.compress.Decompressor<T>
Type Parameters:
T - 解压器类型
All Implemented Interfaces:
com.imyeyu.utils.OS.FileSystem
Direct Known Subclasses:
GZipDecompressor, TarDecompressor, Z7Decompressor, ZipDecompressor

public abstract class Decompressor<T extends Decompressor<T>> extends AbstractRunner<T>
抽象解压器
Version:
2024-06-30 18:02
Author:
夜雨
  • Constructor Details

    • Decompressor

      public Decompressor()
  • Method Details

    • of

      protected T of(File fromFile)
      绑定源压缩文件
      Parameters:
      fromFile - 源压缩文件
      Returns:
      当前解压器
    • of

      protected T of(String fromPath)
      绑定源压缩文件路径
      Parameters:
      fromPath - 源压缩文件路径
      Returns:
      当前解压器
    • of

      public T of(InputStream fromStream)
      绑定源压缩输入流
      Parameters:
      fromStream - 源压缩输入流
      Returns:
      当前解压器
    • toPath

      public T toPath(String toPath) throws Exception
      解压到目标目录
      Parameters:
      toPath - 目标目录
      Returns:
      当前解压器
      Throws:
      Exception - 解压失败
    • toPath

      protected void toPath(File fromFile, String toPath) throws Exception
      执行从文件解压
      Parameters:
      fromFile - 源压缩文件
      toPath - 目标目录
      Throws:
      Exception - 解压失败
    • toPath

      protected abstract void toPath(InputStream fromStream, String toPath) throws Exception
      执行从输入流解压
      Parameters:
      fromStream - 源压缩输入流
      toPath - 目标目录
      Throws:
      Exception - 解压失败