Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Test
- public void testPoiFileCopy() {
- String inputFile = "test/input/データ.xls";
- String outputFile = "test/output/データ2.xls";
- try {
- FileInputStream fis = new FileInputStream(inputFile);
- HSSFWorkbook wb = new HSSFWorkbook(fis);
- FileOutputStream fos = new FileOutputStream(outputFile);
- // ブックを書き込む
- wb.write(fos);
- fos.close();
- wb.close();
- fis.close();
- assertTrue(Files.isSameFile(Paths.get(inputFile), Paths.get(outputFile)));
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- } finally {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement