@Override public InputStream getDeliverableContent(com.enioka.jqm.api.Deliverable d) { return getDeliverableContent(d.getId()); }
/** * Version of {@link JqmClient#getDeliverableContent(Deliverable)} which does not require the web service APIs to be enabled to work. * Also, returned files do not self-destruct on stream close.<br> * See the javadoc of the original method for details. * * @throws FileNotFoundException */ public InputStream getDeliverableContent(Deliverable file) throws FileNotFoundException { List<com.enioka.jqm.model.Deliverable> dd = com.enioka.jqm.model.Deliverable.select(cnx, "deliverable_select_by_id", file.getId()); if (dd.isEmpty()) { throw new JqmInvalidRequestException("no deliverable with this ID"); } com.enioka.jqm.model.Deliverable d = dd.get(0); JobInstance ji = Query.create().setJobInstanceId(d.getJobId()).run().get(0); String nodeName = ji.getNodeName(); Node n = nodes.get(nodeName); return new FileInputStream(FilenameUtils.concat(n.getDlRepo(), file.getFilePath())); } }
/** * Version of {@link JqmClient#getDeliverableContent(Deliverable)} which does not require the web service APIs to be enabled to work. * Also, returned files do not self-destruct on stream close.<br> * See the javadoc of the original method for details. * * @throws FileNotFoundException */ public InputStream getDeliverableContent(Deliverable file) throws FileNotFoundException { List<com.enioka.jqm.model.Deliverable> dd = com.enioka.jqm.model.Deliverable.select(cnx, "deliverable_select_by_id", file.getId()); if (dd.isEmpty()) { throw new JqmInvalidRequestException("no deliverable with this ID"); } com.enioka.jqm.model.Deliverable d = dd.get(0); JobInstance ji = Query.create().setJobInstanceId(d.getJobId()).run().get(0); String nodeName = ji.getNodeName(); Node n = nodes.get(nodeName); return new FileInputStream(FilenameUtils.concat(n.getDlRepo(), file.getFilePath())); } }