@Override public String iconPath(final String branch, final String kubernetesId) throws Exception { GitFacade facade = getGit(); return facade.readFile(branch, "/", new Function<File, String>() { @Override public String apply(File rootFolder) { return doFindIconPath(rootFolder, kubernetesId); } }); }
@Override public String iconPath(final String branch, final String kubernetesId) throws Exception { GitFacade facade = getGit(); return facade.readFile(branch, "/", new Function<File, String>() { @Override public String apply(File rootFolder) { return doFindIconPath(rootFolder, kubernetesId); } }); }
@Override public List<AppDTO> findApps(final String branch) throws Exception { GitFacade facade = getGit(); return facade.readFile(branch, "/", new Function<File, List<AppDTO>>() { @Override public List<AppDTO> apply(File rootFolder) { List<AppDTO> answer = new ArrayList<AppDTO>(); doAddApps(rootFolder, rootFolder, answer); return answer; } }); }
@Override public List<AppDTO> findApps(final String branch) throws Exception { GitFacade facade = getGit(); return facade.readFile(branch, "/", new Function<File, List<AppDTO>>() { @Override public List<AppDTO> apply(File rootFolder) { List<AppDTO> answer = new ArrayList<AppDTO>(); doAddApps(rootFolder, rootFolder, answer); return answer; } }); }
@Override public String appPath(final String branch, final String kubernetesId) throws Exception { GitFacade facade = getGit(); return facade.readFile(branch, "/", new Function<File, String>() { @Override public String apply(File rootFolder) { File file = findAppFolder(rootFolder, kubernetesId); if (file != null) { return relativePath(rootFolder, file); } else { return null; } } }); }
@Override public String appPath(final String branch, final String kubernetesId) throws Exception { GitFacade facade = getGit(); return facade.readFile(branch, "/", new Function<File, String>() { @Override public String apply(File rootFolder) { File file = findAppFolder(rootFolder, kubernetesId); if (file != null) { return relativePath(rootFolder, file); } else { return null; } } }); }
public Response findAppsWithETags(final String branch, final Request request) throws Exception { final GitFacade facade = getGit(); return facade.readFile(branch, "/", new Function<File, Response>() { @Override public Response apply(File rootFolder) { String head = facade.getHEAD(); EntityTag etag = new EntityTag(head); Response.ResponseBuilder builder = request.evaluatePreconditions(etag); // only query the data if its changed if (builder == null) { List<AppDTO> answer = new ArrayList<AppDTO>(); doAddApps(rootFolder, rootFolder, answer); builder = Response.ok(answer); builder.tag(etag); } return builder.build(); } }); }
gitFacade.readFile(branch, path, callback); } catch (GitAPIException e) { throw new ServletException("Failed to read file: " + path + " on branch " + branch + ". " + e, e);