org.eclipse.jgit.util.FS.canExecute()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(94)

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

FS.canExecute介绍

[英]Determine if the file is executable (or not).

Not all platforms and JREs support executable flags on files. If the feature is unsupported this method will always return false.

If the platform supports symbolic links and f is a symbolic link this method returns false, rather than the state of the executable flags on the target file.
[中]确定文件是否可执行(或不可执行)。
并非所有平台和JRE都支持文件上的可执行标志。如果功能不受支持,此方法将始终返回false。
如果平台支持符号链接且f是符号链接,则此方法返回false,而不是目标文件上可执行标志的状态

代码示例

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

/**
 * Get the file attributes we care for.
 *
 * @param path
 *            a {@link java.io.File} object.
 * @return the file attributes we care for.
 * @since 3.3
 */
public Attributes getAttributes(File path) {
  boolean isDirectory = isDirectory(path);
  boolean isFile = !isDirectory && path.isFile();
  assert path.exists() == isDirectory || isFile;
  boolean exists = isDirectory || isFile;
  boolean canExecute = exists && !isDirectory && canExecute(path);
  boolean isSymlink = false;
  long lastModified = exists ? path.lastModified() : 0L;
  long createTime = 0L;
  return new Attributes(this, path, exists, isDirectory, canExecute,
      isSymlink, isFile, createTime, lastModified, -1);
}

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

if (!fs.canExecute(tmpFile))
    fs.setExecute(tmpFile, true);
} else {
  if (fs.canExecute(tmpFile))
    fs.setExecute(tmpFile, false);

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

final boolean on = getFS().canExecute(tmp);
final boolean off = getFS().canExecute(tmp);
FileUtils.delete(tmp);

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

/**
 * @param path
 * @return the file attributes we care for
 * @since 3.3
 */
public Attributes getAttributes(File path) {
  boolean isDirectory = isDirectory(path);
  boolean isFile = !isDirectory && path.isFile();
  assert path.exists() == isDirectory || isFile;
  boolean exists = isDirectory || isFile;
  boolean canExecute = exists && !isDirectory && canExecute(path);
  boolean isSymlink = false;
  long lastModified = exists ? path.lastModified() : 0L;
  long createTime = 0L;
  return new Attributes(this, path, exists, isDirectory, canExecute,
      isSymlink, isFile, createTime, lastModified, -1);
}

代码示例来源:origin: berlam/github-bucket

/**
 * Get the file attributes we care for.
 *
 * @param path
 *            a {@link java.io.File} object.
 * @return the file attributes we care for.
 * @since 3.3
 */
public Attributes getAttributes(File path) {
  boolean isDirectory = isDirectory(path);
  boolean isFile = !isDirectory && path.isFile();
  assert path.exists() == isDirectory || isFile;
  boolean exists = isDirectory || isFile;
  boolean canExecute = exists && !isDirectory && canExecute(path);
  boolean isSymlink = false;
  long lastModified = exists ? path.lastModified() : 0L;
  long createTime = 0L;
  return new Attributes(this, path, exists, isDirectory, canExecute,
      isSymlink, isFile, createTime, lastModified, -1);
}

代码示例来源:origin: berlam/github-bucket

if (!fs.canExecute(tmpFile))
    fs.setExecute(tmpFile, true);
} else {
  if (fs.canExecute(tmpFile))
    fs.setExecute(tmpFile, false);

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

if (!fs.canExecute(tmpFile))
    fs.setExecute(tmpFile, true);
} else {
  if (fs.canExecute(tmpFile))
    fs.setExecute(tmpFile, false);

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

final boolean on = getFS().canExecute(tmp);
final boolean off = getFS().canExecute(tmp);
FileUtils.delete(tmp);

代码示例来源:origin: berlam/github-bucket

final boolean on = getFS().canExecute(tmp);
final boolean off = getFS().canExecute(tmp);
FileUtils.delete(tmp);

相关文章