code: func (javaPlatform *Platform) GetDeploymentPayload(path string) ([]byte, error) {
  
  	logger.Debugf("Packaging java project from path %s", path)
  	var err error
  
  	// --------------------------------------------------------------------------------------
  	// Write out our tar package
  	// --------------------------------------------------------------------------------------
  	payload := bytes.NewBuffer(nil)
  	gw := gzip.NewWriter(payload)
  	tw := tar.NewWriter(gw)
  
  	folder := path
  	if folder == "" {
  		logger.Error("ChaincodeSpec's path cannot be empty")
  		return nil, errors.New("ChaincodeSpec's path cannot be empty")
  	}
  
  	// trim trailing slash if it exists
  	if folder[len(folder)-1] == '/' {
  		folder = folder[:len(folder)-1]
  	}
  
  	if err = cutil.WriteJavaProjectToPackage(tw, folder); err != nil {
  
  		logger.Errorf("Error writing java project to tar package %s", err)
  		return nil, fmt.Errorf("Error writing Chaincode package contents: %s", err)
  	}
  
  	tw.Close()
  	gw.Close()
  
  	return payload.Bytes(), nil
  }
docs: // WritePackage writes the java chaincode package