@Test public void testOnWriteNoItems() throws Exception { resourceLocator.onWrite(null, context); Assert.assertNull(context.consumeResource()); }
@Override public void onWrite(ExcelRow item, ResourceContext context) throws Exception { super.onWrite(item, context); if (!context.containsResource() && isValid(item)) { String suffix = item.getDate().format(DateTimeFormatter.ofPattern("yyyyMMdd")); File file = ExcelFileUtils.getFile(new File(directoryPath), fileName, suffix, fileExtension); context.changeResource(new FileSystemResource(file)); } }
ExcelRowToWriteResourceLocator extends CountingItemResourceLocator<ExcelRow> { @Override public void onWrite(ExcelRow item, ResourceContext context) throws Exception { super.onWrite(item, context); if (!context.containsResource() && isValid(item)) { String suffix = item.getDate().format(DateTimeFormatter.ofPattern("yyyyMMdd")); File file = ExcelFileUtils.getFile(new File(directoryPath), fileName, suffix, fileExtension); context.changeResource(new FileSystemResource(file)); } } }
ExcelRowToWriteResourceLocator extends CountingItemResourceLocator<ExcelRow> { @Override public void onWrite(ExcelRow item, ResourceContext context) throws Exception { super.onWrite(item, context); if (!context.containsResource() && isValid(item)) { String suffix = item.getDate().format(DateTimeFormatter.ofPattern("yyyyMMdd")); File file = ExcelFileUtils.getFile(new File(directoryPath), fileName, suffix, fileExtension); context.changeResource(new FileSystemResource(file)); } }  }
ExcelRowToWriteResourceLocator extends CountingItemResourceLocator<ExcelRow> { @Override public void onWrite(ExcelRow item, ResourceContext context) throws Exception { super.onWrite(item, context); if (!context.containsResource() && isValid(item)) { String suffix = item.getDate().format(DateTimeFormatter.ofPattern("yyyyMMdd")); File file = ExcelFileUtils.getFile(new File(directoryPath), fileName, suffix, fileExtension); context.changeResource(new FileSystemResource(file)); } }  @Override void onWrite(ExcelRow item, ResourceContext context); void setFileName(String fileName); void setFileExtension(String fileExtension); void setDirectoryPath(String directoryPath); }
ExcelRowToWriteResourceLocator extends CountingItemResourceLocator<ExcelRow> { @Override public void onWrite(ExcelRow item, ResourceContext context) throws Exception { super.onWrite(item, context); if (!context.containsResource() && isValid(item)) { String suffix = item.getDate().format(DateTimeFormatter.ofPattern("yyyyMMdd")); File file = ExcelFileUtils.getFile(new File(directoryPath), fileName, suffix, fileExtension); context.changeResource(new FileSystemResource(file)); } }  @Override void onWrite(ExcelRow item, ResourceContext context); void setFileName(String fileName); void setFileExtension(String fileExtension); void setDirectoryPath(String directoryPath);  }