code: public String getChecksum(String algorithm,
                                long offset,
                                long length,
                                String path)
      throws ClientException, ServerException, IOException {
  
          // check if we the cksum commands and specific algorithm are supported
          checkCksumSupport(algorithm);
  
          // form CKSM command
          String parameters = String.format("%s %d %d %s",algorithm, offset,length,path);
          Command cmd = new Command("CKSM", parameters);
  
          // transfer command, obtain reply
          Reply cksumReply = doCommand(cmd);
  
          // check for error
          if( !Reply.isPositiveCompletion(cksumReply) ) {
              throw new ServerException(ServerException.SERVER_REFUSED,
                      cksumReply.getMessage());
          }
  
          return cksumReply.getMessage();
      }
docs: implement GridFTP v2 CKSM command from
  <a href="http://www.ogf.org/documents/GFD.47.pdf">GridFTP v2 Protocol Description</a>
  <pre>
  5.1 CKSM
  This command is used by the client to request checksum calculation over a portion or
  whole file existing on the server. The syntax is:
  CKSM &lt;algorithm&gt; &lt;offset&gt; &lt;length&gt; &lt;path&gt; CRLF
  Server executes this command by calculating specified type of checksum over
  portion of the file starting at the offset and of the specified length. If length is –1,
  the checksum will be calculated through the end of the file. On success, the server
  replies with
  2xx &lt;checksum value&gt;
  Actual format of checksum value depends on the algorithm used, but generally,
  hexadecimal representation should be used.
  </pre>
  
  @param algorithm ckeckum alorithm
  @param offset
  @param length
  @param path
  @return ckecksum value returned by the server
  @throws org.globus.ftp.exception.ClientException
  @throws org.globus.ftp.exception.ServerException
  @throws java.io.IOException