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

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

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

FS.supportsExecute介绍

[英]Does this operating system and JRE support the execute flag on files?
[中]此操作系统和JRE是否支持文件上的execute标志?

代码示例

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

List<Entry> result = new ArrayList<>();
FS fs = this;
boolean checkExecutable = fs.supportsExecute();
try {
  Files.walkFileTree(directory.toPath(),

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

/**
 * @param fs
 * @param file
 * @return non null attributes object
 */
static Attributes getFileAttributesBasic(FS fs, File file) {
  try {
    Path nioPath = toPath(file);
    BasicFileAttributes readAttributes = nioPath
        .getFileSystem()
        .provider()
        .getFileAttributeView(nioPath,
            BasicFileAttributeView.class,
            LinkOption.NOFOLLOW_LINKS).readAttributes();
    Attributes attributes = new Attributes(fs, file,
        true,
        readAttributes.isDirectory(),
        fs.supportsExecute() ? file.canExecute() : false,
        readAttributes.isSymbolicLink(),
        readAttributes.isRegularFile(), //
        readAttributes.creationTime().toMillis(), //
        readAttributes.lastModifiedTime().toMillis(),
        readAttributes.isSymbolicLink() ? Constants
            .encode(readSymLink(file)).length
            : readAttributes.size());
    return attributes;
  } catch (IOException e) {
    return new Attributes(file, fs);
  }
}

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

if (opt.isFileMode() && fs.supportsExecute()) {
  if (FileMode.EXECUTABLE_FILE.equals(entry.getRawMode())) {
    if (!fs.canExecute(tmpFile))

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

if (getFS().supportsExecute()) {
  File tmp = File.createTempFile("try", "execute", getDirectory()); //$NON-NLS-1$ //$NON-NLS-2$

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

List<Entry> result = new ArrayList<>();
FS fs = this;
boolean checkExecutable = fs.supportsExecute();
try {
  Files.walkFileTree(directory.toPath(),

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

static Attributes getFileAttributesBasic(FS fs, File path) {
  try {
    Path nioPath = path.toPath();
    BasicFileAttributes readAttributes = nioPath
        .getFileSystem()
        .provider()
        .getFileAttributeView(nioPath,
            BasicFileAttributeView.class,
            LinkOption.NOFOLLOW_LINKS).readAttributes();
    Attributes attributes = new FileUtil.Java7BasicAttributes(fs, path,
        true,
        readAttributes.isDirectory(),
        fs.supportsExecute() ? path.canExecute() : false,
        readAttributes.isSymbolicLink(),
        readAttributes.isRegularFile(), //
        readAttributes.creationTime().toMillis(), //
        readAttributes.lastModifiedTime().toMillis(),
        readAttributes.isSymbolicLink() ? Constants
            .encode(FileUtils.readSymLink(path)).length
            : readAttributes.size());
    return attributes;
  } catch (NoSuchFileException e) {
    return new FileUtil.Java7BasicAttributes(fs, path, false, false,
        false, false, false, 0L, 0L, 0L);
  } catch (IOException e) {
    return new Attributes(path, fs);
  }
}

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

/**
 * @param fs
 * @param file
 * @return non null attributes object
 */
static Attributes getFileAttributesBasic(FS fs, File file) {
  try {
    Path nioPath = file.toPath();
    BasicFileAttributes readAttributes = nioPath
        .getFileSystem()
        .provider()
        .getFileAttributeView(nioPath,
            BasicFileAttributeView.class,
            LinkOption.NOFOLLOW_LINKS).readAttributes();
    Attributes attributes = new Attributes(fs, file,
        true,
        readAttributes.isDirectory(),
        fs.supportsExecute() ? file.canExecute() : false,
        readAttributes.isSymbolicLink(),
        readAttributes.isRegularFile(), //
        readAttributes.creationTime().toMillis(), //
        readAttributes.lastModifiedTime().toMillis(),
        readAttributes.isSymbolicLink() ? Constants
            .encode(readSymLink(file)).length
            : readAttributes.size());
    return attributes;
  } catch (IOException e) {
    return new Attributes(file, fs);
  }
}

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

static Attributes getFileAttributesBasic(FS fs, File path) {
  try {
    Path nioPath = path.toPath();
    BasicFileAttributes readAttributes = nioPath
        .getFileSystem()
        .provider()
        .getFileAttributeView(nioPath,
            BasicFileAttributeView.class,
            LinkOption.NOFOLLOW_LINKS).readAttributes();
    Attributes attributes = new FileUtil.Java7BasicAttributes(fs, path,
        true,
        readAttributes.isDirectory(),
        fs.supportsExecute() ? path.canExecute() : false,
        readAttributes.isSymbolicLink(),
        readAttributes.isRegularFile(), //
        readAttributes.creationTime().toMillis(), //
        readAttributes.lastModifiedTime().toMillis(),
        readAttributes.isSymbolicLink() ? Constants
            .encode(FileUtils.readSymLink(path)).length
            : readAttributes.size());
    return attributes;
  } catch (NoSuchFileException e) {
    return new FileUtil.Java7BasicAttributes(fs, path, false, false,
        false, false, false, 0L, 0L, 0L);
  } catch (IOException e) {
    return new Attributes(path, fs);
  }
}

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

/**
 * @param fs
 * @param file
 * @return non null attributes object
 */
static Attributes getFileAttributesBasic(FS fs, File file) {
  try {
    Path nioPath = toPath(file);
    BasicFileAttributes readAttributes = nioPath
        .getFileSystem()
        .provider()
        .getFileAttributeView(nioPath,
            BasicFileAttributeView.class,
            LinkOption.NOFOLLOW_LINKS).readAttributes();
    Attributes attributes = new Attributes(fs, file,
        true,
        readAttributes.isDirectory(),
        fs.supportsExecute() ? file.canExecute() : false,
        readAttributes.isSymbolicLink(),
        readAttributes.isRegularFile(), //
        readAttributes.creationTime().toMillis(), //
        readAttributes.lastModifiedTime().toMillis(),
        readAttributes.isSymbolicLink() ? Constants
            .encode(readSymLink(file)).length
            : readAttributes.size());
    return attributes;
  } catch (IOException e) {
    return new Attributes(file, fs);
  }
}

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

if (opt.isFileMode() && fs.supportsExecute()) {
  if (FileMode.EXECUTABLE_FILE.equals(entry.getRawMode())) {
    if (!fs.canExecute(tmpFile))

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

if (opt.isFileMode() && fs.supportsExecute()) {
  if (FileMode.EXECUTABLE_FILE.equals(entry.getRawMode())) {
    if (!fs.canExecute(tmpFile))

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

if (getFS().supportsExecute()) {
  File tmp = File.createTempFile("try", "execute", getDirectory()); //$NON-NLS-1$ //$NON-NLS-2$

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

if (getFS().supportsExecute()) {
  File tmp = File.createTempFile("try", "execute", getDirectory()); //$NON-NLS-1$ //$NON-NLS-2$

相关文章