gpt4 book ai didi

org.apache.commons.compress.archivers.zip.ZipArchiveEntry.isDirectory()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 10:54:40 26 4
gpt4 key购买 nike

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

ZipArchiveEntry.isDirectory介绍

[英]Is this entry a directory?
[中]这个条目是目录吗?

代码示例

代码示例来源:origin: org.apache.commons/commons-compress

/**
 * Sets Unix permissions in a way that is understood by Info-Zip's
 * unzip command.
 * @param mode an <code>int</code> value
 */
public void setUnixMode(final int mode) {
  // CheckStyle:MagicNumberCheck OFF - no point
  setExternalAttributes((mode << SHORT_SHIFT)
             // MS-DOS read-only attribute
             | ((mode & 0200) == 0 ? 1 : 0)
             // MS-DOS directory flag
             | (isDirectory() ? 0x10 : 0));
  // CheckStyle:MagicNumberCheck ON
  platform = PLATFORM_UNIX;
}

代码示例来源:origin: jeremylong/DependencyCheck

while (entries.hasMoreElements()) {
  final ZipArchiveEntry entry = entries.nextElement();
  if (!entry.isDirectory()) {
    final String name = entry.getName().toLowerCase();
    if (name.endsWith(".class")) {

代码示例来源:origin: pxb1988/dex2jar

@Test
public void test1() throws IOException {
  ZipArchiveInputStream zis = new ZipArchiveInputStream(BadZipEntryFlagTest.class.getResourceAsStream("/bad.zip"));
  for (ZipArchiveEntry e = zis.getNextZipEntry(); e != null; e = zis.getNextZipEntry()) {
    e.getGeneralPurposeBit().useEncryption(false);
    if (!e.isDirectory()) {
      zis.read();
      System.out.println(e.getName());
    }
  }
}

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

@Override
public boolean isDirectory()
{
  return zipEntry.isDirectory();
}

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

public ZipResource( ZipFile zipFile, ZipArchiveEntry entry, InputStreamTransformer streamTransformer )
{
  super( entry.getName(), getLastModofied( entry ),
      entry.isDirectory() ? PlexusIoResource.UNKNOWN_RESOURCE_SIZE : entry.getSize(), !entry.isDirectory(),
      entry.isDirectory(), true );
  this.zipFile = zipFile;
  this.entry = entry;
  this.streamTransformer = streamTransformer;
}

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

@Override
public boolean isFile()
{
  return !zipEntry.isDirectory() && !zipEntry.isUnixSymlink();
}

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

private ZipFileResource( JarFile jarFile, ZipArchiveEntry entry )
{
  super( entry.getName(),
      entry.getTime() == -1 ? PlexusIoResource.UNKNOWN_MODIFICATION_DATE : entry.getTime(),
      entry.isDirectory() ? PlexusIoResource.UNKNOWN_RESOURCE_SIZE : entry.getSize(),
      !entry.isDirectory(), entry.isDirectory(), true );
  this.jarFile = jarFile;
}

代码示例来源:origin: apache/tika

private static MediaType detectKmz(ZipFile zip) {
  boolean kmlFound = false;
  Enumeration<ZipArchiveEntry> entries = zip.getEntries();
  while (entries.hasMoreElements()) {
    ZipArchiveEntry entry = entries.nextElement();
    String name = entry.getName();
    if (!entry.isDirectory()
        && name.indexOf('/') == -1 && name.indexOf('\\') == -1) {
      if (name.endsWith(".kml") && !kmlFound) {
        kmlFound = true;
      } else {
        return null;
      }
    }
  }
  if (kmlFound) {
    return MediaType.application("vnd.google-earth.kmz");
  } else {
    return null;
  }
}

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

INDEX_NAME ) && !name.equals( MANIFEST_NAME ) )
if ( ze.isDirectory() )

代码示例来源:origin: apache/tika

ZipArchiveEntry zae = zipArchiveInputStream.getNextZipEntry();
while (zae != null) {
  if (zae.isDirectory()) {
    zae = zipArchiveInputStream.getNextZipEntry();
    continue;

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

if ( zipArchiveEntry.isDirectory() && !zipArchiveEntry.isUnixSymlink() )
  if ( zipArchiveEntry.isDirectory() )
  if ( zipArchiveEntry.isDirectory() )

代码示例来源:origin: com.atlassian.jira/jira-core

boolean matches(final ZipArchiveEntry zipEntry)
  {
    return zipEntry.isDirectory();
  }
},

代码示例来源:origin: com.atlassian.jira/jira-core

boolean matches(final ZipArchiveEntry zipEntry)
  {
    return !zipEntry.isDirectory();
  }
},

代码示例来源:origin: com.atlassian.jira/jira-core

@Override
public boolean isDirectory()
{
  return zipEntry.isDirectory();
}

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

ze.getName(), new Date( ze.getTime() ), ze.isDirectory(),
ze.getUnixMode() != 0 ? ze.getUnixMode() : null,
resolveSymlink( zipFile, ze ), getFileMappers() );

代码示例来源:origin: apache/tika

while (zae != null) {
  try {
    if (!zae.isDirectory() && zipArchiveInputStream.canReadEntryData(zae)) {
      outputStream.putArchiveEntry(zae);

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

new Date( ze.getTime() ), ze.isDirectory(),
ze.getUnixMode() != 0 ? ze.getUnixMode() : null,
resolveSymlink( zf, ze ), getFileMappers() );

代码示例来源:origin: com.buschmais.jqassistant.plugin/jqassistant.plugin.common

@Override
protected String getRelativePath(ZipFileResource container, ZipArchiveEntry entry) {
  String name = entry.getName();
  if (entry.isDirectory()) {
    // strip trailing slash from directory entries
    return "/" + name.substring(0, name.length() - 1);
  } else {
    return "/" + name;
  }
}

代码示例来源:origin: com.buschmais.jqassistant.plugin/common

@Override
protected Resource getEntry(final ZipFileResource container, final ZipArchiveEntry entry) {
  if (entry.isDirectory()) {
    return new AbstractDirectoryResource(entry.getName()) {
    };
  } else {
    return new ZipArchiveEntryResource(container, entry);
  }
}

代码示例来源:origin: IQSS/dataverse

public void addEntry(ZipArchiveEntry zipArchiveEntry, InputStreamSupplier streamSupplier) throws IOException {
  if (zipArchiveEntry.isDirectory() && !zipArchiveEntry.isUnixSymlink())
    dirs.addArchiveEntry(ZipArchiveEntryRequest.createZipArchiveEntryRequest(zipArchiveEntry, streamSupplier));
  else
    scatterZipCreator.addArchiveEntry(zipArchiveEntry, streamSupplier);
}

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