info.magnolia.module.files
Class BasicFileExtractorOperation

java.lang.Object
  extended by info.magnolia.module.files.BasicFileExtractorOperation

public class BasicFileExtractorOperation
extends Object

A simple FileExtractorOperation which just extracts a resource from the class path to the filesystem.


Field Summary
protected  String absoluteTargetPath
           
protected  String resourcePath
           
 
Method Summary
protected  InputStream checkInput()
           
protected  File checkOutput()
           
protected  void copyAndClose(InputStream in, OutputStream out)
           
 void extract()
           
protected  OutputStream openOutput(File targetFile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resourcePath

protected final String resourcePath

absoluteTargetPath

protected final String absoluteTargetPath
Method Detail

extract

public void extract()
             throws IOException
Throws:
IOException

checkInput

protected InputStream checkInput()
                          throws IOException
Throws:
IOException

checkOutput

protected File checkOutput()
                    throws IOException
Returns:
a java.io.File corresponding to the absoluteTargetPath if the path is validated, or null if the file should not be extracted. TODO ugly.
Throws:
IOException

openOutput

protected OutputStream openOutput(File targetFile)
                           throws IOException
Throws:
IOException

copyAndClose

protected void copyAndClose(InputStream in,
                            OutputStream out)
                     throws IOException
Throws:
IOException


Copyright © 2003-2014 Magnolia International Ltd.. All Rights Reserved.