hudson.FilePath.list()方法的使用及代码示例

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

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

FilePath.list介绍

[英]List up files and directories in this directory.

This method returns direct children of the directory denoted by the 'this' object.
[中]列出此目录中的文件和目录。
此方法返回由“This”对象表示的目录的直接子级。

代码示例

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

/**
 * List up files and directories in this directory.
 *
 * <p>
 * This method returns direct children of the directory denoted by the 'this' object.
 */
@Nonnull
public List<FilePath> list() throws IOException, InterruptedException {
  return list((FileFilter)null);
}

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

/**
 * List up files in this directory that matches the given Ant-style filter.
 *
 * @param includes
 *      See {@link FileSet} for the syntax. String like "foo/*.zip" or "foo/*&#42;/*.xml"
 * @return
 *      can be empty but always non-null.
 */
@Nonnull
public FilePath[] list(final String includes) throws IOException, InterruptedException {
  return list(includes, null);
}

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

/**
 * List up files in this directory that matches the given Ant-style filter.
 *
 * @param includes
 * @param excludes
 *      See {@link FileSet} for the syntax. String like "foo/*.zip" or "foo/*&#42;/*.xml"
 * @return
 *      can be empty but always non-null.
 * @since 1.407
 */
@Nonnull
public FilePath[] list(final String includes, final String excludes) throws IOException, InterruptedException {
  return list(includes, excludes, true);
}

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

/**
 * List up subdirectories.
 *
 * @return can be empty but never null. Doesn't contain "." and ".."
 */
@Nonnull
public List<FilePath> listDirectories() throws IOException, InterruptedException {
  return list(new DirectoryFilter());
}

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

/**
 * Adds all the files that matches the given glob in the directory.
 *
 * @see FilePath#list(String)  
 */
public ClasspathBuilder addAll(FilePath base, String glob) throws IOException, InterruptedException {
  for(FilePath item : base.list(glob))
    add(item);
  return this;
}

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

@Override public VirtualFile[] list() throws IOException {
  try {
    List<FilePath> kids = f.list();
    VirtualFile[] vfs = new VirtualFile[kids.size()];
    for (int i = 0; i < vfs.length; i++) {
      vfs[i] = new FilePathVF(kids.get(i), this.root);
    }
    return vfs;
  } catch (InterruptedException x) {
    throw new IOException(x);
  }
}
@Override public Collection<String> list(String includes, String excludes, boolean useDefaultExcludes) throws IOException {

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

List<FilePath> children = root.list();
if(children.size()!=1)    return null;
if(children.get(0).isDirectory())

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * List up files and directories in this directory.
 *
 * <p>
 * This method returns direct children of the directory denoted by the 'this' object.
 */
public List<FilePath> list() throws IOException, InterruptedException {
  return list((FileFilter)null);
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * List up files and directories in this directory.
 *
 * <p>
 * This method returns direct children of the directory denoted by the 'this' object.
 */
public List<FilePath> list() throws IOException, InterruptedException {
  return list((FileFilter)null);
}

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

/**
 * List up files and directories in this directory.
 *
 * <p>
 * This method returns direct children of the directory denoted by the 'this' object.
 */
@Nonnull
public List<FilePath> list() throws IOException, InterruptedException {
  return list((FileFilter)null);
}

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

/**
 * List up files in this directory that matches the given Ant-style filter.
 *
 * @param includes
 *      See {@link FileSet} for the syntax. String like "foo/*.zip" or "foo/*&#42;/*.xml"
 * @return
 *      can be empty but always non-null.
 */
@Nonnull
public FilePath[] list(final String includes) throws IOException, InterruptedException {
  return list(includes, null);
}

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

/**
 * List up subdirectories.
 *
 * @return can be empty but never null. Doesn't contain "." and ".."
 */
@Nonnull
public List<FilePath> listDirectories() throws IOException, InterruptedException {
  return list(new DirectoryFilter());
}

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

/**
 * Adds all the files that matches the given glob in the directory.
 *
 * @see FilePath#list(String)  
 */
public ClasspathBuilder addAll(FilePath base, String glob) throws IOException, InterruptedException {
  for(FilePath item : base.list(glob))
    add(item);
  return this;
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * List up subdirectories.
 *
 * @return can be empty but never null. Doesn't contain "." and ".."
 */
public List<FilePath> listDirectories() throws IOException, InterruptedException {
  return list(new DirectoryFilter());
}

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

/**
 * Adds all the files that matches the given glob in the directory.
 *
 * @see FilePath#list(String)
 */
public ClasspathBuilder addAll(FilePath base, String glob) throws IOException, InterruptedException {
  for (FilePath item : base.list(glob)) {
    add(item);
  }
  return this;
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Adds all the files that matches the given glob in the directory.
 *
 * @see FilePath#list(String)  
 */
public ClasspathBuilder addAll(FilePath base, String glob) throws IOException, InterruptedException {
  for(FilePath item : base.list(glob))
    add(item);
  return this;
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Adds all the files that matches the given glob in the directory.
 *
 * @see FilePath#list(String)  
 */
public ClasspathBuilder addAll(FilePath base, String glob) throws IOException, InterruptedException {
  for(FilePath item : base.list(glob))
    add(item);
  return this;
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-test-harness

@Override
  public boolean perform(AbstractBuild<?, ?> build,
              Launcher launcher, BuildListener listener)
      throws InterruptedException, IOException {
    for (FilePath f : build.getWorkspace().list()) {
      f.touch(System.currentTimeMillis());
    }
    return true;
  }
}

代码示例来源:origin: org.eclipse.hudson/hudson-test-framework

@Override
  public boolean perform(AbstractBuild<?, ?> build,
      Launcher launcher, BuildListener listener)
      throws InterruptedException, IOException {
    for (FilePath f : build.getWorkspace().list()) {
      f.touch(System.currentTimeMillis());
    }
    return true;
  }
}

代码示例来源:origin: org.jenkins-ci.plugins/vectorcast-coverage

protected static FilePath[] getVectorCASTCoverageReports(File file) throws IOException, InterruptedException {
  FilePath path = new FilePath(file);
  if (path.isDirectory()) {
    return path.list("*xml");
  } else {
    // Read old builds (before 1.11) 
    FilePath report = new FilePath(new File(path.getName() + ".xml"));
    return report.exists() ? new FilePath[]{report} : new FilePath[0];
  }
}

相关文章