hudson.util.IOUtils.mode()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(121)

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

IOUtils.mode介绍

[英]Gets the mode of a file/directory, if appropriate. Only includes read, write, and execute permissions for the owner, group, and others, i.e. the max return value is 0777. Consider using Files#getPosixFilePermissions instead if you only care about access permissions.

If the file is symlink, the mode is that of the link target, not the link itself.
[中]获取文件/目录的模式(如果适用)。仅包括所有者、组和其他人的读、写和执行权限,即最大返回值为0777。如果只关心访问权限,请考虑使用文件yGETPOSIXFILIPREST。
如果文件是symlink,则模式是链接目标的模式,而不是链接本身。

代码示例

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

@Override
  public Integer invoke(File f, VirtualChannel channel) throws IOException {
    return IOUtils.mode(stating(f));
  }
}

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

@Override public int mode() throws IOException {
  if (isIllegalSymlink()) {
    return -1;
  }
  return IOUtils.mode(f);
}
@Override public long lastModified() throws IOException {

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

relativePath+='/';
TarArchiveEntry te = new TarArchiveEntry(relativePath);
int mode = IOUtils.mode(file);
if (mode!=-1)   te.setMode(mode);
te.setModTime(file.lastModified());

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

public void visit(final File f, final String _relativePath) throws IOException {
  int mode = IOUtils.mode(f);

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

@Override
public void visitSymlink(File link, String target, String relativePath) throws IOException {
  TarArchiveEntry e = new TarArchiveEntry(relativePath, TarConstants.LF_SYMLINK);
  try {
    int mode = IOUtils.mode(link);
    if (mode != -1) {
      e.setMode(mode);
    }
  } catch (PosixException x) {
    // ignore
  }
  
  e.setLinkName(target);
  tar.putArchiveEntry(e);
  tar.closeArchiveEntry();
  entriesWritten++;
}

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

public Integer invoke(File f, VirtualChannel channel) throws IOException {
    return IOUtils.mode(stating(f));
  }
});

代码示例来源:origin: jenkinsci/kubernetes-pipeline-plugin

@Override
public void visitSymlink(File link, String target, String relativePath) throws IOException {
  TarArchiveEntry e = new TarArchiveEntry(relativePath, LF_SYMLINK);
  try {
    int mode = IOUtils.mode(link);
    if (mode != -1) {
      e.setMode(mode);
    }
  } catch (PosixException x) {
    // ignore
  }
  try {
    StringBuffer linkName = (StringBuffer) LINKNAME_FIELD.get(e);
    linkName.setLength(0);
    linkName.append(target);
  } catch (IllegalAccessException x) {
    throw new IOException("Failed to set linkName", x);
  }
  tar.putArchiveEntry(e);
  entriesWritten++;
}

代码示例来源:origin: jenkinsci/kubernetes-pipeline-plugin

te.setName(relativePath);
int mode = IOUtils.mode(file);
if (mode!=-1) {
  te.setMode(mode);

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

relativePath+='/';
TarArchiveEntry te = new TarArchiveEntry(relativePath);
int mode = IOUtils.mode(file);
if (mode!=-1)   te.setMode(mode);
te.setModTime(file.lastModified());

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

public void visit(final File f, final String _relativePath) throws IOException {
  int mode = IOUtils.mode(f);

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

@Override
public void visitSymlink(File link, String target, String relativePath) throws IOException {
  TarArchiveEntry e = new TarArchiveEntry(relativePath, TarConstants.LF_SYMLINK);
  try {
    int mode = IOUtils.mode(link);
    if (mode != -1) {
      e.setMode(mode);
    }
  } catch (PosixException x) {
    // ignore
  }
  
  e.setLinkName(target);
  tar.putArchiveEntry(e);
  tar.closeArchiveEntry();
  entriesWritten++;
}

相关文章