docs: private DecodedStatus makePath(URI path, AbstractHttpEntity headerEntity) throws PathHandlingException {
          DecodedStatus status = DecodedStatus.FAIL;
          try {
              HttpPut dirMaker = HDFSUtils.createDirectoryRequest(new URI(path.getScheme(), path.getAuthority(),
                      path.getPath().substring(0, (path.getPath().lastIndexOf("/") + 1)),
                      path.getQuery(), path.getFragment()));
              if (m_isHttpfs) {
                  dirMaker.setHeader(OctetStreamContentTypeHeader);
              }
              status = checkResponse(m_client.execute(dirMaker,null).get());
              if (status != DecodedStatus.OK) return status;
          } catch (InterruptedException|ExecutionException|URISyntaxException e) {
              rateLimitedLogError(m_logger, "error creating parent directory for %s %s", path, Throwables.getStackTraceAsString(e));
              throw new PathHandlingException("error creating parent directory for " + path, e);
          }
  
          try {
              HttpPut fileMaker = HDFSUtils.createFileRequest(path);
              adjustReplicationFactorForURI(fileMaker);
              if (headerEntity != null) {
                  // HttpFS only accepts PUT/POST requests with application/octet-strema content type
                  if (m_isHttpfs) {
                      headerEntity.setContentType(OctetStreamMimeType);
                  }
                  fileMaker.setEntity(headerEntity);
              } else if (m_isHttpfs) {
                  fileMaker.setHeader(OctetStreamContentTypeHeader);
              }
              status = checkResponse(m_client.execute(fileMaker,null).get());
          } catch (InterruptedException | ExecutionException | URISyntaxException e) {
              rateLimitedLogError(m_logger, "error creating file %s %s", path, Throwables.getStackTraceAsString(e));
              throw new PathHandlingException("error creating file " + path,e);
          }
          if (status == DecodedStatus.FILE_ALREADY_EXISTS) {
              SimpleDateFormat dfmt = new SimpleDateFormat("yyyy-MM-dd'T'HH.mm.ss.SSS");
              dfmt.setTimeZone(m_timeZone);
              int retries = 0;
              while (status != DecodedStatus.OK && retries++ < 2) {
                  try {
                      HttpGet statusGetter = HDFSUtils.createFileStatusRequest(path);
                      HttpResponse response = m_client.execute(statusGetter, null).get();
                      status = checkResponse(response);
                      if (status != DecodedStatus.OK) continue;
  
                      String fileStatus = EntityUtils.toString(response.getEntity(), Charsets.UTF_8);
                      Matcher mtc = modtimeRE.matcher(fileStatus);
                      if (!mtc.find()) {
                          throw new PathHandlingException("no modification time in " + fileStatus);
                      }
  
                      String renameTo = HDFSUtils.getHdfsPath(path) + "."
                              + dfmt.format(Long.parseLong(mtc.group("modtime")));
  
                      HttpPut renameDoer = HDFSUtils.createRenameRequest(path, renameTo);
                      if (m_isHttpfs) {
                          renameDoer.setHeader(OctetStreamContentTypeHeader);
                      }
                      status = checkResponse(m_client.execute(renameDoer,null).get());
                      if (status != DecodedStatus.OK) continue;
  
                      HttpPut fileMaker = HDFSUtils.createFileRequest(path);
                      if (headerEntity != null) {
                          if (m_isHttpfs) {
                              headerEntity.setContentType(OctetStreamMimeType);
                          }
                          fileMaker.setEntity(headerEntity);
                      } else if (m_isHttpfs) {
                          fileMaker.setHeader(OctetStreamContentTypeHeader);
                      }
                      status = checkResponse(m_client.execute(fileMaker,null).get());
                  } catch (InterruptedException | ExecutionException | IOException e) {
                      rateLimitedLogError(m_logger, "error creating file %s %s", path, Throwables.getStackTraceAsString(e));
                      throw new PathHandlingException("error creating file " + path,e);
                  }
              }
              if (retries >= 2) {
                  throw new PathHandlingException("failed to handle file already exisits for " + path);
              }
          }
  
          return status;
      }