Implementing the FileUploadResource class

FileUploadResource is a resource designed to allow clients to upload files to a server through an asynchronous request using REST. This class uses the JAX-RS to create a REST resource and, depending on the file extension, this resource delegates the task of saving a file to its respective EJB. In the following code block, we have the FileUploadResource class: 

import javax.annotation.Resource;import javax.enterprise.concurrent.ManagedExecutorService;import javax.enterprise.context.spi.CreationalContext;import javax.enterprise.inject.spi.Bean;import javax.enterprise.inject.spi.BeanManager;import javax.naming.InitialContext;import javax.naming.NamingException;import javax.ws.rs.Consumes;import javax.ws.rs. ...

Get Java EE 8 Design Patterns and Best Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.