You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ye...@apache.org on 2011/12/16 11:11:46 UTC

svn commit: r1215080 - /poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java

Author: yegor
Date: Fri Dec 16 10:11:45 2011
New Revision: 1215080

URL: http://svn.apache.org/viewvc?rev=1215080&view=rev
Log:
Addition to Bugzilla 51961: enable compression of temp files when loading existing workbook

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java?rev=1215080&r1=1215079&r2=1215080&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java Fri Dec 16 10:11:45 2011
@@ -104,7 +104,33 @@ public class SXSSFWorkbook implements Wo
      * @param rowAccessWindowSize
      */
     public SXSSFWorkbook(XSSFWorkbook workbook, int rowAccessWindowSize){
+    	this(workbook,rowAccessWindowSize, false);
+    }
+
+    /**
+     * Constructs an workbook from an existing workbook.
+     * <p>
+     * When a new node is created via createRow() and the total number
+     * of unflushed records would exceed the specified value, then the
+     * row with the lowest index value is flushed and cannot be accessed
+     * via getRow() anymore.
+     * </p>
+     * <p>
+     * A value of -1 indicates unlimited access. In this case all
+     * records that have not been flushed by a call to flush() are available
+     * for random access.
+     * <p>
+     * <p></p>
+     * A value of 0 is not allowed because it would flush any newly created row
+     * without having a chance to specify any cells.
+     * </p>
+     *
+     * @param rowAccessWindowSize
+     * @param compressTmpFiles whether to use gzip compression for temporary files
+     */
+    public SXSSFWorkbook(XSSFWorkbook workbook, int rowAccessWindowSize, boolean compressTmpFiles){
     	setRandomAccessWindowSize(rowAccessWindowSize);
+    	setCompressTempFiles(compressTmpFiles);
     	if (workbook == null)
     	{
     		_wb=new XSSFWorkbook();
@@ -119,7 +145,6 @@ public class SXSSFWorkbook implements Wo
             }
     	}
     }
-
     /**
      * Construct an empty workbook and specify the window for row access.
      * <p>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org