com.sun.enterprise.util.zip.ZipFile类的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(158)

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

ZipFile介绍

暂无

代码示例

代码示例来源:origin: org.glassfish.common/common-util

/**
* @param args the command line arguments
*/
public static void main (String args[]) 
{
  try
  {
    ZipFile zip = new ZipFile("C:\\temp\\petstore.ear", "C:\\temp\\petstore");
    java.util.List l = zip.explode();
    System.out.println("**** Filelist ****\n" + l);
  }
  catch(Exception e)
  {
    System.out.println("error: " + e);
    e.printStackTrace();
  }
}

代码示例来源:origin: org.glassfish.common/common-util

public ZipFile(InputStream inStream, File anExplodeDir) throws ZipFileException
{
  ctor(inStream, anExplodeDir);
}

代码示例来源:origin: org.glassfish.main.common/common-util

private void checkExplodeDir() throws ZipFileException {
  String explodeDirName = explodeDir.getPath();
  // just in case...
  insist(explodeDir.mkdirs(), "Unable to create target directory: " + explodeDirName);
  insist(explodeDir.exists(), "Target Directory doesn't exist: " + explodeDirName);//NOI18N
  insist(explodeDir.isDirectory(), "Target Directory isn't a directory: " + explodeDirName);//NOI18N
  insist(explodeDir.canWrite(), "Can't write to Target Directory: " + explodeDirName);//NOI18N
}

代码示例来源:origin: eclipse-ee4j/glassfish

public ZipFile(File zipFile, File anExplodeDir) throws ZipFileException {
  checkZipFile(zipFile);
  BufferedInputStream bis = null;
  try {
    bis = new BufferedInputStream(new FileInputStream(zipFile), BUFFER_SIZE);
    ctor(bis, anExplodeDir);
    this.zipFile = zipFile;
  } catch (Throwable e) {
    if (bis != null) {
      try {
        bis.close();
      } catch (Throwable thr) {
        throw new ZipFileException(thr);
      }
    }
    throw new ZipFileException(e);
  }
}

代码示例来源:origin: org.glassfish.common/common-util

private void ctor(InputStream inStream, File anExplodeDir) throws ZipFileException
{
  insist(anExplodeDir != null);
  explodeDir = anExplodeDir;
  try
  {
    zipStream = new ZipInputStream(inStream);
    checkExplodeDir();
  }
  catch(Throwable t)
  {
        if (zipStream != null) {
          try {
            zipStream.close();
          } catch (Throwable thr) {
          }
        }
    throw new ZipFileException(t.toString());
  }
}

代码示例来源:origin: eclipse-ee4j/glassfish

if (isDirectory(filename)) {
bos = new BufferedOutputStream(getOutputStream(f), BUFFER_SIZE);

代码示例来源:origin: org.glassfish.main.common/common-util

public ZipFile(File zipFile, File anExplodeDir) throws ZipFileException {
  checkZipFile(zipFile);
  BufferedInputStream bis = null;
  try {
    bis = new BufferedInputStream(new FileInputStream(zipFile), BUFFER_SIZE);
    ctor(bis, anExplodeDir);
    this.zipFile = zipFile;
  } catch (Throwable e) {
    if (bis != null) {
      try {
        bis.close();
      } catch (Throwable thr) {
        throw new ZipFileException(thr);
      }
    }
    throw new ZipFileException(e);
  }
}

代码示例来源:origin: eclipse-ee4j/glassfish

insist(anExplodeDir != null);
explodeDir = anExplodeDir;
  checkExplodeDir();
} catch (Throwable t) {
  if (zipStream != null) {

代码示例来源:origin: org.glassfish.main.common/common-util

if (isDirectory(filename)) {
bos = new BufferedOutputStream(getOutputStream(f), BUFFER_SIZE);

代码示例来源:origin: eclipse-ee4j/glassfish

/**
* @param args the command line arguments
*/
public static void main (String args[]) 
{
  try
  {
    ZipFile zip = new ZipFile("C:\\temp\\petstore.ear", "C:\\temp\\petstore");
    java.util.List l = zip.explode();
    System.out.println("**** Filelist ****\n" + l);
  }
  catch(Exception e)
  {
    System.out.println("error: " + e);
    e.printStackTrace();
  }
}

代码示例来源:origin: org.glassfish.common/common-util

public ZipFile(File zipFile, File anExplodeDir) throws ZipFileException
{
  checkZipFile(zipFile);
  BufferedInputStream bis = null;
  
  try
  {
    bis = new BufferedInputStream(new FileInputStream(zipFile), BUFFER_SIZE);
          ctor(bis, anExplodeDir);
          this.zipFile = zipFile;
  }
  catch(Throwable e)
  {
        if (bis != null) {
          try {
            bis.close();
          } catch (Throwable thr) {
            throw new ZipFileException(thr);
          }
        }
    throw new ZipFileException(e);
  }
}

代码示例来源:origin: org.glassfish.main.common/common-util

insist(anExplodeDir != null);
explodeDir = anExplodeDir;
  checkExplodeDir();
} catch (Throwable t) {
  if (zipStream != null) {

代码示例来源:origin: org.glassfish.common/common-util

if(isDirectory(filename))
        BufferedOutputStream os = new BufferedOutputStream(getOutputStream(filename), BUFFER_SIZE);

代码示例来源:origin: org.glassfish.main.common/common-util

private void checkZipFile(File zipFile) throws ZipFileException {
  insist(zipFile != null);
  String zipFileName = zipFile.getPath();
  insist(zipFile.exists(), "zipFile (" + zipFileName + ") doesn't exist");//NOI18N
  insist(!zipFile.isDirectory(), "zipFile (" + zipFileName + ") is actually a directory!");//NOI18N
}

代码示例来源:origin: org.glassfish.main.common/common-util

public ZipFile(InputStream inStream, File anExplodeDir) throws ZipFileException {
  ctor(inStream, anExplodeDir);
}

代码示例来源:origin: org.glassfish.main.common/common-util

/**
* @param args the command line arguments
*/
public static void main (String args[]) 
{
  try
  {
    ZipFile zip = new ZipFile("C:\\temp\\petstore.ear", "C:\\temp\\petstore");
    java.util.List l = zip.explode();
    System.out.println("**** Filelist ****\n" + l);
  }
  catch(Exception e)
  {
    System.out.println("error: " + e);
    e.printStackTrace();
  }
}

代码示例来源:origin: eclipse-ee4j/glassfish

private void checkZipFile(File zipFile) throws ZipFileException {
  insist(zipFile != null);
  String zipFileName = zipFile.getPath();
  insist(zipFile.exists(), "zipFile (" + zipFileName + ") doesn't exist");//NOI18N
  insist(!zipFile.isDirectory(), "zipFile (" + zipFileName + ") is actually a directory!");//NOI18N
}

代码示例来源:origin: eclipse-ee4j/glassfish

public ZipFile(InputStream inStream, File anExplodeDir) throws ZipFileException {
  ctor(inStream, anExplodeDir);
}

代码示例来源:origin: org.glassfish.common/common-util

tmpList = tmpZf.explode();
    ZipFile newZf = new ZipFile(f, tmpZf.explodeDir);
    zipFileList.add(newZf);

代码示例来源:origin: org.glassfish.common/common-util

private void checkZipFile(File zipFile) throws ZipFileException
{
  insist(zipFile != null);
  
  String zipFileName = zipFile.getPath();
  insist( zipFile.exists(),		"zipFile (" + zipFileName + ") doesn't exist" );//NOI18N
  insist( !zipFile.isDirectory(), "zipFile (" + zipFileName + ") is actually a directory!" );//NOI18N
}

相关文章