You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by on...@apache.org on 2015/11/02 09:34:21 UTC
svn commit: r1711906 -
/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/XSSFTestDataSamples.java
Author: onealj
Date: Mon Nov 2 08:34:21 2015
New Revision: 1711906
URL: http://svn.apache.org/viewvc?rev=1711906&view=rev
Log:
whitespace
Modified:
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/XSSFTestDataSamples.java
Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/XSSFTestDataSamples.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/XSSFTestDataSamples.java?rev=1711906&r1=1711905&r2=1711906&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/XSSFTestDataSamples.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/XSSFTestDataSamples.java Mon Nov 2 08:34:21 2015
@@ -37,53 +37,51 @@ import org.apache.poi.xssf.usermodel.XSS
* @author Josh Micich
*/
public class XSSFTestDataSamples {
- /**
- * Used by {@link writeOutAndReadBack(R wb, String testName)}. If a
- * value is set for this in the System Properties, the xlsx file
- * will be written out to that directory.
- */
- public static final String TEST_OUTPUT_DIR = "poi.test.xssf.output.dir";
+ /**
+ * Used by {@link writeOutAndReadBack(R wb, String testName)}. If a
+ * value is set for this in the System Properties, the xlsx file
+ * will be written out to that directory.
+ */
+ public static final String TEST_OUTPUT_DIR = "poi.test.xssf.output.dir";
- public static File getSampleFile(String sampleFileName) {
- return HSSFTestDataSamples.getSampleFile(sampleFileName);
- }
- public static OPCPackage openSamplePackage(String sampleName) {
- try {
- return OPCPackage.open(
- HSSFTestDataSamples.openSampleFileStream(sampleName)
- );
- } catch(Exception e) {
- throw new RuntimeException(e);
- }
- }
- public static XSSFWorkbook openSampleWorkbook(String sampleName) {
- InputStream is = HSSFTestDataSamples.openSampleFileStream(sampleName);
- try {
- return new XSSFWorkbook(is);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
+ public static File getSampleFile(String sampleFileName) {
+ return HSSFTestDataSamples.getSampleFile(sampleFileName);
+ }
+ public static OPCPackage openSamplePackage(String sampleName) {
+ try {
+ return OPCPackage.open(HSSFTestDataSamples.openSampleFileStream(sampleName));
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ public static XSSFWorkbook openSampleWorkbook(String sampleName) {
+ InputStream is = HSSFTestDataSamples.openSampleFileStream(sampleName);
+ try {
+ return new XSSFWorkbook(is);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
public static <R extends Workbook> R writeOutAndReadBack(R wb) {
- Workbook result;
- try {
+ Workbook result;
+ try {
ByteArrayOutputStream baos = new ByteArrayOutputStream(8192);
wb.write(baos);
InputStream is = new ByteArrayInputStream(baos.toByteArray());
- if (wb instanceof HSSFWorkbook) {
- result = new HSSFWorkbook(is);
- } else if (wb instanceof XSSFWorkbook) {
- result = new XSSFWorkbook(is);
- } else {
- throw new RuntimeException("Unexpected workbook type ("
- + wb.getClass().getName() + ")");
- }
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- @SuppressWarnings("unchecked")
- R r = (R) result;
- return r;
+ if (wb instanceof HSSFWorkbook) {
+ result = new HSSFWorkbook(is);
+ } else if (wb instanceof XSSFWorkbook) {
+ result = new XSSFWorkbook(is);
+ } else {
+ throw new RuntimeException("Unexpected workbook type ("
+ + wb.getClass().getName() + ")");
+ }
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ @SuppressWarnings("unchecked")
+ R r = (R) result;
+ return r;
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org