code: public void start() {
      try {
        if (init) {
          setErrorStatus("Cannot initialize multiple times", null);
          return;
        }
        init = true;
        HttpPost postRequest = setupRequest(new ByteArrayOutputStream(0));
        UploadImageParam.setHeaders(postRequest, journalId, namespaceInfoString,
            epoch, txid, 0, segmentId++, false);
  
        HttpClient httpClient = new DefaultHttpClient();
        HttpResponse response = httpClient.execute(postRequest);
        if (response.getStatusLine().getStatusCode() == HttpServletResponse.SC_NOT_ACCEPTABLE) {
          throwIOException("Error when starting upload to : " + uri + " status: "
              + response.getStatusLine().toString());
        }
  
        // get the session id
        for (Header h : response.getAllHeaders()) {
          if (h.getName().equals("sessionId")) {
            sessionId = Long.parseLong(h.getValue());
            break;
          }
        }
  
        // we must have the session id
        if (sessionId < 0) {
          throw new IOException("Session id is missing");
        }
      } catch (Exception e) {
        setErrorStatus("Exception when starting upload channel for: " + uri, e);
      }
    }
docs: Create an image upload channel, based on image txid and other metadata.