@Override public long addDisk(String fileName,InputStream inputStream) throws IOException, VmdkFormatException, NameTakenException, InternalException {
  if (!inputStream.markSupported()) {
    inputStream=new BufferedInputStream(inputStream);
  }
  int singleExtentSize=VmdkMetadata.getSingleExtentSize(inputStream);
  String imagePath=getImageFilePath(fileName);
  logger.info("write to {}",imagePath);
  nfcClient.putStreamOptimizedDisk(imagePath,inputStream);
  return singleExtentSize * 512L;
}

@ Override public long addDisk ( String fileName , InputStream inputStream ) throws IOException , VmdkFormatException , NameTakenException , InternalException { if ( ! inputStream . markSupported ( ) ) { inputStream = new BufferedInputStream ( inputStream ) ; } int singleExtentSize = VmdkMetadata . getSingleExtentSize ( inputStream ) ; String imagePath = getImageFilePath ( fileName ) ; logger . info ( "write to {}" , imagePath ) ; nfcClient . putStreamOptimizedDisk ( imagePath , inputStream ) ; return singleExtentSize * 512L ; }
upload disk to remote datastore . if the image name exists in the datastore , it will be overwritten . a typical datastore path for image id 123456789 is : [ datastore1 ] tmp_upload_123456789 / 123456789 . vmdk
