Get a list of all the defined jobs on the server (in the given folder)

@param folder {@link FolderJob}
@return list of defined jobs (summary level, for details @see Job#details
@throws IOException in case of an error.
767438
public Map<String, Job> getJobs(FolderJob folder) throws IOException {
        return getJobs(folder, null);
    }
29734
public void getSubFolders(final String folder, final AsyncCallback<List<CmsVfsEntryBean>> callback) {

        CmsRpcAction<List<CmsVfsEntryBean>> action = new CmsRpcAction<List<CmsVfsEntryBean>>() {

            @Override
            public void execute() {

                start(0, false);
                getGalleryService().getSubFolders(folder, this);
            }

            @Override
            protected void onResponse(List<CmsVfsEntryBean> result) {

                stop(false);
                callback.onSuccess(result);
            }

        };
        action.execute();
    }
684631
public List<Future<JobReport>> submitAll(List<Job> jobs) {
        try {
            return executorService.invokeAll(jobs);
        } catch (InterruptedException e) {
            throw new RuntimeException("Unable to execute jobs", e);
        }
    }
1065163
public List<Flow<Job<T>>> getAllFlow()
   {
      List<Flow<Job<T>>> list = new ArrayList<Flow<Job<T>>>();
      List<Node> nodeList = childNode.get("flow");
      for(Node node: nodeList)
      {
         Flow<Job<T>>  type = new FlowImpl<Job<T>>(this, "flow", childNode, node);
         list.add(type);
      }
      return list;
   }
1189237
public List<String> copyTo(String folder, String dest) throws IOException {
      List<String> res = new ArrayList<String>();
      if (path != null) {
        copyToDest(Utilities.path(path, folder), Utilities.path(path, folder), dest, res);
      } else {
        for (Entry<String, byte[]> e : content.entrySet()) {
          if (e.getKey().startsWith(folder+"/")) {
            String s = e.getKey().substring(folder.length()+1);
            res.add(s);
            String dst = Utilities.path(dest, s);
            String dstDir = Utilities.getDirectoryForFile(dst);
            Utilities.createDirectory(dstDir);
            TextFile.bytesToFile(e.getValue(), dst);
          }
        }
      }
      return res;
    }
29859
public JenkinsServer renameJob(FolderJob folder, String oldJobName, String newJobName) throws IOException {
        return renameJob(folder, oldJobName, newJobName, false);
    }
577780
public JobDetails getJobByJobID(String cluster, String jobId,
      boolean populateTasks) throws IOException {
    return getJobByJobID(new QualifiedJobId(cluster, jobId), populateTasks);
  }
890941
public AbstractJobVertex[] getAllReachableJobVertices() {

		final Vector<AbstractJobVertex> collector = new Vector<AbstractJobVertex>();
		collectVertices(null, collector);
		return collector.toArray(new AbstractJobVertex[0]);
	}
252533
public List<JobInfo> findJobs(final Optional<String> type, final int count) {
        if (type.isPresent()) {
            return jobRepository.findLatestBy(type.get(), count);
        } else {
            return jobRepository.findLatest(count);
        }
    }
780849
public List<String> paths(Node dir, Filter filter) throws IOException {
    	List<String> result;

    	result = new ArrayList<>();
    	paths(dir, filter, result);
    	return result;
    }
112456
public List<String> list(String folder) throws IOException {
      List<String> res = new ArrayList<String>();
      if (path != null) {
        File f = new File(Utilities.path(path, folder));
        if (f.exists() && f.isDirectory())
          for (String s : f.list())
            res.add(s);
      } else {
        for (String s : content.keySet()) {
          if (s.startsWith(folder+"/") && !s.substring(folder.length()+2).contains("/"))
            res.add(s.substring(folder.length()+1));
        }
      }
      return res;
    }
439354
public final void addFolder(@NotNull final Folder folder) {
        Contract.requireArgNotNull("folder", folder);
        if (folders == null) {
            folders = new ArrayList<>();
        }
        folders.add(folder);
    }
984268
public Iterator<AbstractJobOutputVertex> getOutputVertices() {

		final Collection<AbstractJobOutputVertex> coll = this.outputVertices.values();

		return coll.iterator();
	}
202504
public View getView(FolderJob folder, String name) throws IOException {
        try {
            View resultView = client.get(UrlUtils.toViewBaseUrl(folder, name) + "/", View.class);
            resultView.setClient(client);

            // TODO: Think about the following? Does there exists a simpler/more
            // elegant method?
            for (Job job : resultView.getJobs()) {
                job.setClient(client);
            }
            for (View view : resultView.getViews()) {
                view.setClient(client);
            }
            return resultView;
        } catch (HttpResponseException e) {
            LOGGER.debug("getView(folder={}, name={}) status={}", folder, name, e.getStatusCode());
            if (e.getStatusCode() == HttpStatus.SC_NOT_FOUND) {
                // TODO: Think hard about this.
                return null;
            }
            throw e;
        }
    }
1053180
public ResultList<JobDepartment> getJobs() throws MovieDbException {
        URL url = new ApiUrl(apiKey, MethodBase.JOB).subMethod(MethodSub.LIST).buildUrl();
        String webpage = httpTools.getRequest(url);

        try {
            WrapperJobList wrapper = MAPPER.readValue(webpage, WrapperJobList.class);
            ResultList<JobDepartment> results = new ResultList<>(wrapper.getJobs());
            wrapper.setResultProperties(results);
            return results;
        } catch (IOException ex) {
            throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get job list", url, ex);
        }
    }
264504
private static void formatWorkerDataFolder(String folder) throws IOException {
    Path path = Paths.get(folder);
    FileUtils.deletePathRecursively(folder);
    Files.createDirectory(path);
    // For short-circuit read/write to work, others needs to be able to access this directory.
    // Therefore, default is 777 but if the user specifies the permissions, respect those instead.
    String permissions = ServerConfiguration.get(PropertyKey.WORKER_DATA_FOLDER_PERMISSIONS);
    Set<PosixFilePermission> perms = PosixFilePermissions.fromString(permissions);
    Files.setPosixFilePermissions(path, perms);
    FileUtils.setLocalDirStickyBit(path.toAbsolutePath().toString());
  }
1089200
public static String[] scanFolderAsArray(String folder) {
        List<String> list = scanFolder(folder);
        String[] arrays = new String[list.size()];
        int i = 0;
        for (String item : list) {
            arrays[i++] = item;
        }
        return arrays;
    }