src/test/java –> test related files, mostly JUnit test cases.Return “upload success” message within Response objectĪdd jersey-2.12 & jersey-multipart-2.12 dependencies to pom.xmlįolks who aren’t familiar with Maven concepts or don’t require maven for their project, can download the below jars individually from the central repository or maven repository and include them in the classpathīefore moving on, let us understand the directory/package structure once you create project in Eclipse IDE Maven has to follow certain directory structure.Finally, write the steams to the upload file server using basic file handling operations.Annotate upload method with Get InputStream & FormDataContentDisposition from input parameter and process to get actual filename and pass inputstream to write to file server.Finally, build() the ResponseBuilder and return Response object with “download success” message.
Annotate download Zip method with Set “Content-Disposition” in the ResponseBuilder to allow downloading users to select path to download Zipped file.We will implement Jersey examples in the following articles based on latest 2.x version Download Latest Jersey release version is 2.12 see here and look documentation and API for details. Earlier Jersey 1.x version was developed and supported by Oracle/Sun team Latest Jersey 2.x version has been developed by Oracle/Glassfish team in accordance with JAX-RS 2.0 specification. Jersey is the most popular amongst Restful web service development. In this article, we will learn and implement JAX-RS Restful web service which is exposed to upload/download Zipped (.zip) file