August 2018
Intermediate to advanced
314 pages
8h 9m
English
At this point, we will implement PdfHandler, JpgHandler, and ZipHandler, which are the EJBs responsible for dealing with the logic to save its files.
In the following code, we have PdfHandler, which is responsible for saving PDF files:
import javax.ejb.Stateless;import java.io.IOException;import java.util.Date;@Statelesspublic class PdfHandler { public String handler (FileBean file) throws IOException { return FileSystemUtils.save( file.getFile(), "pdf", "pdf_"+ new Date().getTime() + ".pdf" ); }}
In the following code block, we have JpgHandler, which is responsible for saving JPG files:
import javax.ejb.Stateless;import java.io.IOException;import java.util.Date;@Statelesspublic class JpgHandler { public String handler ...
Read now
Unlock full access