ASF Bugzilla – Attachment 32774 Details for
Bug 57986
Opening excel file, reading it without explicit modification, closing modifies the file.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
java code
TestXSSFWorkbook.java (text/x-java), 902 bytes, created by
Michael
on 2015-06-01 20:12:45 UTC
(
hide
)
Description:
java code
Filename:
MIME Type:
Creator:
Michael
Created:
2015-06-01 20:12:45 UTC
Size:
902 bytes
patch
obsolete
> >import java.io.File; > >import org.apache.poi.ss.usermodel.Cell; >import org.apache.poi.ss.usermodel.Row; >import org.apache.poi.ss.usermodel.WorkbookFactory; >import org.apache.poi.xssf.usermodel.XSSFSheet; >import org.apache.poi.xssf.usermodel.XSSFWorkbook; > >import org.junit.Assert; > >public class TestXSSFWorkbook extends Assert >{ > > public static void main(String[] args) > { > try > { > File templateFile = new File("TestExcelTemplate.xlsx"); > Long lastModifiedBefore = templateFile.lastModified(); > XSSFWorkbook template = (XSSFWorkbook)WorkbookFactory.create(templateFile); > XSSFSheet sheet = template.getSheetAt(0); > for(Row row : sheet) > { > for(Cell cell : row){ > // do nothing > } > } > > template.close(); > Long lastModifiedAfter = templateFile.lastModified(); > assertEquals(lastModifiedBefore, lastModifiedAfter); > } catch(Exception e){ > e.printStackTrace(); > } > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 57986
: 32774 |
32775