private Long getAccountId() { List<String> projectIdsList = uriInfo.getPathParameters().get(PROJECT_ID); Long projectId = Long.valueOf(projectIdsList.get(0)); Project project = projectsManager.get(projectId); if (project == null) { throw new VcmsObjectNotFoundException("project with id=" + projectId + " not found"); } return project.getAccountId(); }
/** * Returns streamed content with keystone credentials rc-file for given project and current user. * * @param project requested project * @return streamed content with rc-file. * @throws IOException if there was a failure on rc-file builder */ public StreamedContent getRcFileForProject(Project project) throws IOException { return rcFileBuilder.buildRcFile(user.getId(), project.getId()); }