code: @Override
    public FSDataOutputStream createObject(String objName, String contentType,
        Map<String, String> metadata, Statistics statistics) throws IOException {
      final URL url = new URL(mJossAccount.getAccessURL() + "/" + getURLEncodedObjName(objName));
      LOG.debug("PUT {}. Content-Type : {}", url.toString(), contentType);
  
      // When overwriting an object, cached metadata will be outdated
      String cachedName = getObjName(container + "/", objName);
      objectCache.remove(cachedName);
  
      try {
        final OutputStream sos;
        if (nonStreamingUpload) {
          sos = new SwiftNoStreamingOutputStream(mJossAccount, url, contentType,
              metadata, swiftConnectionManager, this);
        } else {
          sos = new SwiftOutputStream(mJossAccount, url, contentType,
              metadata, swiftConnectionManager);
        }
        return new FSDataOutputStream(sos, statistics);
      } catch (IOException e) {
        LOG.error(e.getMessage());
        throw e;
      }
    }
docs: Direct HTTP PUT request without JOSS package
  
  @param objName name of the object
  @param contentType content type
  @return HttpURLConnection