gpt4 book ai didi

org.zeroturnaround.zip.ZipException.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 09:47:31 24 4
gpt4 key购买 nike

本文整理了Java中org.zeroturnaround.zip.ZipException.<init>()方法的一些代码示例,展示了ZipException.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipException.<init>()方法的具体详情如下:
包路径:org.zeroturnaround.zip.ZipException
类名称:ZipException
方法名:<init>

ZipException.<init>介绍

暂无

代码示例

代码示例来源:origin: zeroturnaround/zt-zip

/**
 * Rethrow the given exception as a runtime exception.
 */
static ZipException rethrow(IOException e) {
 throw new ZipException(e);
}

代码示例来源:origin: zeroturnaround/zt-zip

static Object invoke(Method method, Object obj, Object... args) throws ZipException {
 try {
  return method.invoke(obj, args);
 }
 catch (IllegalAccessException e) {
  throw new ZipException(e);
 }
 catch (InvocationTargetException e) {
  throw new ZipException(e);
 }
 catch (IllegalArgumentException e) {
  throw new ZipException(e);
 }
}

代码示例来源:origin: zeroturnaround/zt-zip

static <T> Class<? extends T> getClassForName(String name, Class<T> clazz) {
 try {
  return Class.forName(name).asSubclass(clazz);
 }
 catch (ClassNotFoundException e) {
  throw new ZipException(e);
 }
 catch (ClassCastException e) {
  throw new ZipException(e);
 }
}

代码示例来源:origin: zeroturnaround/zt-zip

static Method getDeclaredMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) {
 try {
  return clazz.getDeclaredMethod(methodName, parameterTypes);
 }
 catch (NoSuchMethodException e) {
  throw new ZipException(e);
 }
}

代码示例来源:origin: zeroturnaround/zt-zip

private String getRootName(final String name) {
  String newName = name.substring(FilenameUtils.getPrefixLength(name));
  int idx = newName.indexOf(PATH_SEPARATOR);
  if (idx < 0) {
   throw new ZipException("Entry " + newName + " from the root of the zip is not supported");
  }
  return newName.substring(0, newName.indexOf(PATH_SEPARATOR));
 }
}

代码示例来源:origin: zeroturnaround/zt-zip

if (filenames == null) {
 if (!dir.exists()) {
  throw new ZipException("Given file '" + dir + "' doesn't exist!");
 throw new ZipException("Given directory '" + dir + "' doesn't contain any files!");

代码示例来源:origin: zeroturnaround/zt-zip

public void process(InputStream in, ZipEntry zipEntry) throws IOException {
 String root = getRootName(zipEntry.getName());
 if (rootDir == null) {
  rootDir = root;
 }
 else if (!rootDir.equals(root)) {
  throw new ZipException("Unwrapping with multiple roots is not supported, roots: " + rootDir + ", " + root);
 }
 String name = mapper.map(getUnrootedName(root, zipEntry.getName()));
 if (name != null) {
  File file = makeDestinationFile(outputDir, name);
  if (zipEntry.isDirectory()) {
   FileUtils.forceMkdir(file);
  }
  else {
   FileUtils.forceMkdir(file.getParentFile());
   if (log.isDebugEnabled() && file.exists()) {
    log.debug("Overwriting file '{}'.", zipEntry.getName());
   }
   FileUtils.copy(in, file);
  }
 }
}

代码示例来源:origin: zeroturnaround/zt-zip

log.debug("Compressing '{}' into '{}'.", sourceDir, targetZip);
if (!sourceDir.exists()) {
 throw new ZipException("Given file '" + sourceDir + "' doesn't exist!");

代码示例来源:origin: zeroturnaround/zt-zip

throw new ZipException("Failed to process zip entry '" + entry.getName() + " with action " + action, ze);

代码示例来源:origin: zeroturnaround/zt-zip

throw new ZipException("Failed to process zip entry '" + e.getName() + " with action " + action, ze);

代码示例来源:origin: zeroturnaround/zt-zip

throw new ZipException("Failed to process zip entry '" + entry.getName() + " with action " + action, ze);

代码示例来源:origin: zeroturnaround/zt-zip

throw new ZipException("Failed to process zip entry '" + e.getName() + "' with action " + action, ze);

代码示例来源:origin: zeroturnaround/zt-zip

throw new ZipException("Failed to process zip entry '" + e.getName() + " with action " + action, ze);

代码示例来源:origin: zeroturnaround/zt-zip

log.debug("Compressing '{}' into a stream.", sourceDir);
if (!sourceDir.exists()) {
 throw new ZipException("Given file '" + sourceDir + "' doesn't exist!");

代码示例来源:origin: zeroturnaround/zt-zip

throw new ZipException("Failed to process zip entry '" + e.getName() + " with action " + action, ze);

代码示例来源:origin: zeroturnaround/zt-zip

@SuppressWarnings("unchecked")
public Java7Nio2ApiPermissionsStrategy() {
 if (!isPosix()) {
  throw new ZipException("File system does not support POSIX file attributes");

代码示例来源:origin: zeroturnaround/zt-zip

/**
 * Get assigned to ZIP entry file permissions info. Current implementation tries to read "ASi Unix" (tag 0x756e) extra tag.
 * "ASi Unix"
 * 
 * @param zipEntry
 * @return file permissions info or <code>null</code> if ZIP entry does not have "ASi Unix" extra field.
 */
static ZTFilePermissions getZTFilePermissions(ZipEntry zipEntry) {
 try {
  ZTFilePermissions permissions = null;
  List<ZipExtraField> fields = ExtraFieldUtils.parse(zipEntry.getExtra());
  AsiExtraField asiExtraField = getFirstAsiExtraField(fields);
  if (asiExtraField != null) {
   int mode = asiExtraField.getMode() & 0777;
   permissions = ZTFilePermissionsUtil.fromPosixFileMode(mode);
  }
  return permissions;
 }
 catch (java.util.zip.ZipException ze) {
  throw new ZipException(ze);
 }
}

代码示例来源:origin: org.zeroturnaround/zt-zip

/**
 * Rethrow the given exception as a runtime exception.
 */
static ZipException rethrow(IOException e) {
 throw new ZipException(e);
}

代码示例来源:origin: org.zeroturnaround/zt-zip

static <T> Class<? extends T> getClassForName(String name, Class<T> clazz) {
 try {
  return Class.forName(name).asSubclass(clazz);
 }
 catch (ClassNotFoundException e) {
  throw new ZipException(e);
 }
 catch (ClassCastException e) {
  throw new ZipException(e);
 }
}

代码示例来源:origin: org.zeroturnaround/zt-zip

static Method getDeclaredMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) {
 try {
  return clazz.getDeclaredMethod(methodName, parameterTypes);
 }
 catch (NoSuchMethodException e) {
  throw new ZipException(e);
 }
}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com