@PUT
  @Path("/zip")
  @Consumes(MediaType.MULTIPART_FORM_DATA)
  @Produces(MediaType.APPLICATION_JSON)
  public Response uploadZip(
      @FormDataParam("file") InputStream uploadedInputStream,
      @FormDataParam("file") FormDataContentDisposition contentDisposition,
      @FormDataParam("path") String path) {
    try {
      if (!path.endsWith("/"))
        path = path + "/";
      ZipInputStream zip = new ZipInputStream(uploadedInputStream);
      ZipEntry ze = zip.getNextEntry();
      HdfsApi api = getApi();
      while (ze != null) {
        String filePath = path + ze.getName();
        if (ze.isDirectory()) {
          api.mkdir(filePath);
        } else {
          uploadFile(filePath, zip);
        }
        ze = zip.getNextEntry();
      }
      return Response.ok(getApi().fileStatusToJSON(api.listdir(path))).build();
    } catch (WebApplicationException ex) {
      throw ex;
    } catch (Exception ex) {
      throw new ServiceFormattedException(ex.getMessage(), ex);
    }
  }
Upload zip and unpack
@param uploadedInputStream file input stream
@param contentDisposition content disposition
@param path path
@return files statuses
@throws IOException
@throws Exception
contrib/views/commons/src/main/java/org/apache/ambari/view/commons/hdfs/UploadService.java