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. ...