@PUT
  @Consumes(MediaType.MULTIPART_FORM_DATA)
  @Produces(MediaType.APPLICATION_JSON)
  public Response uploadFile(
      @FormDataParam("file") InputStream uploadedInputStream,
      @FormDataParam("file") FormDataContentDisposition contentDisposition,
      @FormDataParam("path") String path) {
    try {
      if (!path.endsWith("/"))
        path = path + "/";
      String filePath = path + new String(contentDisposition.getFileName().getBytes("ISO8859-1"),"UTF-8");
      uploadFile(filePath, uploadedInputStream);
      return Response.ok(
          getApi().fileStatusToJSON(getApi().getFileStatus(filePath)))
          .build();
    } catch (WebApplicationException ex) {
      throw ex;
    } catch (Exception ex) {
      throw new ServiceFormattedException(ex.getMessage(), ex);
    }
  }
Upload file
@param uploadedInputStream file input stream
@param contentDisposition content disposition
@param path path
@return file status
contrib/views/commons/src/main/java/org/apache/ambari/view/commons/hdfs/UploadService.java