@Override protected BlobHolder buildResult(List<String> cmdOutput, CmdParameters cmdParams) { try { return super.buildResult(cmdOutput, cmdParams); } finally { // delete the temp folder String userInstallationPath = cmdParams.getParameter(USER_INSTALLATION_PATH_KEY); if (userInstallationPath != null) { deleteTempDirectory(userInstallationPath); } } }
@Override protected BlobHolder buildResult(List<String> cmdOutput, CmdParameters cmdParams) { String outputPath = cmdParams.getParameter("outDirPath"); File outputDir = new File(outputPath); File[] files = outputDir.listFiles(); List<Blob> blobs = new ArrayList<Blob>(); for (File file : files) { Blob blob; try { blob = Blobs.createBlob(file); } catch (IOException e) { throw new ConversionException("Cannot create Blob", e); } blob.setFilename(file.getName()); if (file.getName().equalsIgnoreCase("index.html")) { blobs.add(0, blob); } else { blobs.add(blob); } } return new SimpleCachableBlobHolder(blobs); }
@Override protected BlobHolder buildResult(List<String> cmdOutput, CmdParameters cmdParams) { String outputPath = cmdParams.getParameter("outDirPath"); File outputDir = new File(outputPath); File[] files = outputDir.listFiles(); List<Blob> blobs = new ArrayList<>(); for (File file : files) { try { Blob blob = Blobs.createBlob(file); blob.setFilename(file.getName()); blobs.add(blob); } catch (IOException e) { throw new ConversionException("Cannot create Blob", e); } } return new SimpleCachableBlobHolder(blobs); }
@Override protected BlobHolder buildResult(List<String> cmdOutput, CmdParameters cmdParams) { String outputPath = cmdParams.getParameter("outDirPath"); File outputDir = new File(outputPath); File[] files = outputDir.listFiles(); List<Blob> blobs = new ArrayList<Blob>(); for (File file : files) { try { Blob blob = Blobs.createBlob(file); blob.setFilename(file.getName()); blobs.add(blob); } catch (IOException e) { throw new ConversionException("Cannot create Blob", e); } } return new SimpleCachableBlobHolder(blobs); }