类 RarUtilPwd

java.lang.Object
cn.benma666.myutils.RarUtilPwd

public class RarUtilPwd extends Object
Rar压缩文件处理工具类
date: 2016年7月14日 下午4:13:34
版本:
作者:
jingma
  • 字段详细资料

    • SEPARATOR

      public static final String SEPARATOR
  • 构造器详细资料

    • RarUtilPwd

      public RarUtilPwd()
  • 方法详细资料

    • unRarDir

      public static void unRarDir(String rarDir, String dest, String pwd) throws Exception
      使用给定密码解压指定目录下的rar压缩文件到指定目录

      如果指定目录不存在,可以自动创建,不合法的路径将导致异常被抛出

      参数:
      rarDir - 指定的rar压缩文件
      dest - 解压目录
      pwd - 密码
      抛出:
      net.lingala.zip4j.exception.ZipException - 压缩文件有损坏或者解压缩失败抛出
      Exception
    • unrar

      public static void unrar(String srcRar, String password) throws IOException
      解压指定RAR文件到当前文件夹
      参数:
      srcRar - 指定解压
      password - 压缩文件时设定的密码
      抛出:
      IOException
    • unrar

      public static void unrar(String srcRar, String destPath, String password) throws IOException
      解压指定的RAR压缩文件到指定的目录中
      参数:
      srcRar - 指定的RAR压缩文件
      destPath - 指定解压到的目录
      password - 压缩文件时设定的密码
      抛出:
      IOException
    • unrar

      public static void unrar(File srcRarFile, String password) throws IOException
      解压指定RAR文件到当前文件夹
      参数:
      srcRarFile - 解压文件
      password - 压缩文件时设定的密码
      抛出:
      IOException
    • unrar

      public static void unrar(File srcRarFile, String destPath, String password) throws IOException
      解压指定RAR文件到指定的路径
      参数:
      srcRarFile - 需要解压RAR文件
      destPath - 指定解压路径
      password - 压缩文件时设定的密码
      抛出:
      IOException
    • isRarNameToDir

      public static boolean isRarNameToDir()
      返回:
      isRarNameToDir
    • setRarNameToDir

      public static void setRarNameToDir(boolean isRarNameToDir)
      参数:
      isRarNameToDir - the isRarNameToDir to set