protected void performProcessing() throws IOException { File resultFile = null; try { resultFile = process(); // now write the processed content to the destination if (resultFile.length() > 0) { InputStream resultStream = new BufferedInputStream(new FileInputStream(resultFile)); FileUtils.copyStream(resultStream, true, getDestination(), false); } else { setStatus(new Status(IStatus.ERROR, Activator.ID, "Unpacking fails because intermediate file is empty: " + resultFile)); //$NON-NLS-1$ } } finally { if (resultFile != null) resultFile.delete(); } }
protected File process() throws IOException { Options options = new Options(); options.unpack = true; // TODO use false here assuming that all content is conditioned. Need to revise this options.processAll = false; options.input = incoming; options.outputDir = getWorkDir().getPath(); options.verbose = false; new JarProcessorExecutor().runJarProcessor(options); return new File(getWorkDir(), incoming.getName().substring(0, incoming.getName().length() - PACKED_SUFFIX.length())); } }
public void initialize(IProvisioningAgent agent, IProcessingStepDescriptor descriptor, IArtifactDescriptor context) { super.initialize(agent, descriptor, context); if (!UnpackStep.canUnpack()) { IStatus status = null; if (detailedResult) { status = new Status(IStatus.ERROR, Activator.ID, "Unpack facility not configured."); //$NON-NLS-1$ detailedResult = true; } else { String[] locations = Utils.getPack200Commands("unpack200"); //$NON-NLS-1$ StringBuffer locationTried = new StringBuffer(100); for (int i = 0; i < locations.length; i++) { locationTried.append(locations[i]).append(", "); //$NON-NLS-1$ } status = new Status(IStatus.ERROR, Activator.ID, "Unpack facility not configured. The locations searched for unpack200 are: " + locationTried); //$NON-NLS-1$ } setStatus(status); } }
public void initialize(IProvisioningAgent agent, IProcessingStepDescriptor descriptor, IArtifactDescriptor context) { super.initialize(agent, descriptor, context); if (!UnpackStep.canUnpack()) { IStatus status = null; if (detailedResult) { status = new Status(IStatus.ERROR, Activator.ID, "Unpack facility not configured."); //$NON-NLS-1$ detailedResult = true; } else { String[] locations = Utils.getPack200Commands("unpack200"); //$NON-NLS-1$ StringBuffer locationTried = new StringBuffer(100); for (int i = 0; i < locations.length; i++) { locationTried.append(locations[i]).append(", "); //$NON-NLS-1$ } status = new Status(IStatus.ERROR, Activator.ID, "Unpack facility not configured. The locations searched for unpack200 are: " + locationTried); //$NON-NLS-1$ } setStatus(status); } }
protected void performProcessing() throws IOException { File resultFile = null; try { resultFile = process(); // now write the processed content to the destination if (resultFile.length() > 0) { InputStream resultStream = new BufferedInputStream(new FileInputStream(resultFile)); FileUtils.copyStream(resultStream, true, getDestination(), false); } else { setStatus(new Status(IStatus.ERROR, Activator.ID, "Unpacking fails because intermediate file is empty: " + resultFile)); //$NON-NLS-1$ } } finally { if (resultFile != null) resultFile.delete(); } }
protected File process() throws IOException { Options options = new Options(); options.unpack = true; // TODO use false here assuming that all content is conditioned. Need to revise this options.processAll = false; options.input = incoming; options.outputDir = getWorkDir().getPath(); options.verbose = false; new JarProcessorExecutor().runJarProcessor(options); return new File(getWorkDir(), incoming.getName().substring(0, incoming.getName().length() - PACKED_SUFFIX.length())); } }
public void initialize(IProvisioningAgent agent, IProcessingStepDescriptor descriptor, IArtifactDescriptor context) { super.initialize(agent, descriptor, context); if (!UnpackStep.canUnpack()) { IStatus status = null; if (detailedResult) { status = new Status(IStatus.ERROR, Activator.ID, "Unpack facility not configured."); //$NON-NLS-1$ detailedResult = true; } else { String[] locations = Utils.getPack200Commands("unpack200"); //$NON-NLS-1$ StringBuffer locationTried = new StringBuffer(100); for (int i = 0; i < locations.length; i++) { locationTried.append(locations[i]).append(", "); //$NON-NLS-1$ } status = new Status(IStatus.ERROR, Activator.ID, "Unpack facility not configured. The locations searched for unpack200 are: " + locationTried); //$NON-NLS-1$ } setStatus(status); } }
protected void performProcessing() throws IOException { File resultFile = null; try { resultFile = process(); // now write the processed content to the destination if (resultFile.length() > 0) { InputStream resultStream = new BufferedInputStream(new FileInputStream(resultFile)); FileUtils.copyStream(resultStream, true, getDestination(), false); } else { setStatus(new Status(IStatus.ERROR, Activator.ID, "Unpacking fails because intermediate file is empty: " + resultFile)); //$NON-NLS-1$ } } finally { if (resultFile != null) resultFile.delete(); } }
protected File process() throws IOException { Options options = new Options(); options.unpack = true; // TODO use false here assuming that all content is conditioned. Need to revise this options.processAll = false; options.input = incoming; options.outputDir = getWorkDir().getPath(); options.verbose = false; new JarProcessorExecutor().runJarProcessor(options); return new File(getWorkDir(), incoming.getName().substring(0, incoming.getName().length() - PACKED_SUFFIX.length())); } }
@Override public void initialize(IProvisioningAgent agent, IProcessingStepDescriptor descriptor, IArtifactDescriptor context) { super.initialize(agent, descriptor, context); if (!UnpackStep.canUnpack()) { IStatus status = null; if (detailedResult) { status = new Status(IStatus.ERROR, Activator.ID, MirrorRequest.ARTIFACT_PROCESSING_ERROR, "Unpack facility not configured.", null); //$NON-NLS-1$ detailedResult = true; } else { String[] locations = Utils.getPack200Commands("unpack200"); //$NON-NLS-1$ StringBuffer locationTried = new StringBuffer(100); for (int i = 0; i < locations.length; i++) { locationTried.append(locations[i]).append(", "); //$NON-NLS-1$ } status = new Status(IStatus.ERROR, Activator.ID, MirrorRequest.ARTIFACT_PROCESSING_ERROR, "Unpack facility not configured. The locations searched for unpack200 are: " + locationTried, null); //$NON-NLS-1$ } setStatus(status); } }
@Override protected void performProcessing() throws IOException { File resultFile = null; try { resultFile = process(); // now write the processed content to the destination if (resultFile.length() > 0) { InputStream resultStream = new BufferedInputStream(new FileInputStream(resultFile)); FileUtils.copyStream(resultStream, true, getDestination(), false); } else { setStatus(new Status(IStatus.ERROR, Activator.ID, MirrorRequest.ARTIFACT_PROCESSING_ERROR, "Unpacking fails because intermediate file is empty: " + resultFile, null)); //$NON-NLS-1$ } } catch (IOException e) { setStatus(new Status(IStatus.ERROR, Activator.ID, MirrorRequest.ARTIFACT_PROCESSING_ERROR, "Unpacking fails", e)); //$NON-NLS-1$ throw e; } finally { if (resultFile != null) resultFile.delete(); } }
protected File process() throws IOException { Options options = new Options(); options.unpack = true; // TODO use false here assuming that all content is conditioned. Need to revise this options.processAll = false; options.input = incoming; options.outputDir = getWorkDir().getPath(); options.verbose = false; new JarProcessorExecutor().runJarProcessor(options); return new File(getWorkDir(), incoming.getName().substring(0, incoming.getName().length() - PACKED_SUFFIX.length())); } }