gpt4 book ai didi

org.apache.tools.zip.ZipEntry.getUnixMode()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 21:10:40 31 4
gpt4 key购买 nike

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

ZipEntry.getUnixMode介绍

[英]Unix permission.
[中]Unix权限。

代码示例

代码示例来源:origin: jenkinsci/jenkins

int mode = e.getUnixMode();
if (mode!=0)    // Ant returns 0 if the archive doesn't record the access mode
  target.chmod(mode);

代码示例来源:origin: org.apache.ant/ant

/**
 * Determine a Resource's Unix mode or return the given default
 * value if not available.
 */
private int getUnixMode(final Resource r, final ZipFile zf, final int defaultMode) {
  int unixMode = defaultMode;
  if (zf != null) {
    final ZipEntry ze = zf.getEntry(r.getName());
    unixMode = ze.getUnixMode();
    if ((unixMode == 0 || unixMode == UnixStat.DIR_FLAG)
      && !preserve0Permissions) {
      unixMode = defaultMode;
    }
  } else if (r instanceof ArchiveResource) {
    unixMode = ((ArchiveResource) r).getMode();
  }
  return unixMode;
}

代码示例来源:origin: org.apache.ant/ant

private void setEntry(ZipEntry e) {
  if (e == null) {
    setExists(false);
    return;
  }
  setName(e.getName());
  setExists(true);
  setLastModified(e.getTime());
  setDirectory(e.isDirectory());
  setSize(e.getSize());
  setMode(e.getUnixMode());
  extras = e.getExtraFields(true);
  method = e.getMethod();
}

代码示例来源:origin: org.gradle/gradle-core

public int getMode() {
    int unixMode = entry.getUnixMode() & 0777;
    if (unixMode == 0) {
      //no mode infos available - fall back to defaults
      if (isDirectory()) {
        unixMode = FileSystem.DEFAULT_DIR_MODE;
      } else {
        unixMode = FileSystem.DEFAULT_FILE_MODE;
      }
    }
    return unixMode;
  }
}

代码示例来源:origin: net.wasdev.wlp.ant/wlp-anttasks

private static void setFilePermissions(File file, ZipEntry entry) {
    int permissions = entry.getUnixMode();
    if (permissions != 0) {
      UnixPermissions perm = new UnixPermissions(permissions);
      if (perm.isOwnerExecute() || perm.isGroupExecute() || perm.isOwnerExecute()) {
        file.setExecutable(true);
      }
    }
  }
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

int mode = e.getUnixMode();
if (mode!=0)    // Ant returns 0 if the archive doesn't record the access mode
  target.chmod(mode);

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