/usr/share/gtk-doc/html/gdata/GDataUploadStream.html is in libgdata-doc 0.14.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GData Reference Manual: GDataUploadStream</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="GData Reference Manual">
<link rel="up" href="ch02.html" title="Core API">
<link rel="prev" href="GDataDownloadStream.html" title="GDataDownloadStream">
<link rel="next" href="GDataComparable.html" title="GDataComparable">
<meta name="generator" content="GTK-Doc V1.19.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="10"><tr valign="middle">
<td width="100%" align="left">
<a href="#" class="shortcut">Top</a>
|
<a href="#GDataUploadStream.description" class="shortcut">Description</a>
|
<a href="#GDataUploadStream.object-hierarchy" class="shortcut">Object Hierarchy</a>
|
<a href="#GDataUploadStream.properties" class="shortcut">Properties</a>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GDataDownloadStream.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GDataComparable.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GDataUploadStream"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GDataUploadStream.top_of_page"></a>GDataUploadStream</span></h2>
<p>GDataUploadStream — GData upload stream object</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GDataUploadStream.stability-level"></a><h2>Stability Level</h2>
Unstable, unless otherwise indicated
</div>
<div class="refsynopsisdiv">
<a name="GDataUploadStream.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include <gdata/gdata-upload-stream.h>
#define <a class="link" href="GDataUploadStream.html#GDATA-LINK-RESUMABLE-CREATE-MEDIA:CAPS" title="GDATA_LINK_RESUMABLE_CREATE_MEDIA">GDATA_LINK_RESUMABLE_CREATE_MEDIA</a>
#define <a class="link" href="GDataUploadStream.html#GDATA-LINK-RESUMABLE-EDIT-MEDIA:CAPS" title="GDATA_LINK_RESUMABLE_EDIT_MEDIA">GDATA_LINK_RESUMABLE_EDIT_MEDIA</a>
<a class="link" href="GDataUploadStream.html#GDataUploadStream-struct" title="GDataUploadStream">GDataUploadStream</a>;
<a class="link" href="GDataUploadStream.html#GDataUploadStreamClass" title="GDataUploadStreamClass">GDataUploadStreamClass</a>;
<a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html"><span class="returnvalue">GOutputStream</span></a> * <a class="link" href="GDataUploadStream.html#gdata-upload-stream-new" title="gdata_upload_stream_new ()">gdata_upload_stream_new</a> (<em class="parameter"><code><a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a> *service</code></em>,
<em class="parameter"><code><a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="type">GDataAuthorizationDomain</span></a> *domain</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *method</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *upload_uri</code></em>,
<em class="parameter"><code><a class="link" href="GDataEntry.html" title="GDataEntry"><span class="type">GDataEntry</span></a> *entry</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *slug</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *content_type</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>);
<a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html"><span class="returnvalue">GOutputStream</span></a> * <a class="link" href="GDataUploadStream.html#gdata-upload-stream-new-resumable" title="gdata_upload_stream_new_resumable ()">gdata_upload_stream_new_resumable</a> (<em class="parameter"><code><a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a> *service</code></em>,
<em class="parameter"><code><a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="type">GDataAuthorizationDomain</span></a> *domain</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *method</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *upload_uri</code></em>,
<em class="parameter"><code><a class="link" href="GDataEntry.html" title="GDataEntry"><span class="type">GDataEntry</span></a> *entry</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *slug</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *content_type</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#goffset"><span class="type">goffset</span></a> content_length</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>);
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="GDataUploadStream.html#gdata-upload-stream-get-response" title="gdata_upload_stream_get_response ()">gdata_upload_stream_get_response</a> (<em class="parameter"><code><a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> *self</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gssize"><span class="type">gssize</span></a> *length</code></em>);
<a class="link" href="GDataService.html" title="GDataService"><span class="returnvalue">GDataService</span></a> * <a class="link" href="GDataUploadStream.html#gdata-upload-stream-get-service" title="gdata_upload_stream_get_service ()">gdata_upload_stream_get_service</a> (<em class="parameter"><code><a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> *self</code></em>);
<a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="returnvalue">GDataAuthorizationDomain</span></a> * <a class="link" href="GDataUploadStream.html#gdata-upload-stream-get-authorization-domain" title="gdata_upload_stream_get_authorization_domain ()">gdata_upload_stream_get_authorization_domain</a>
(<em class="parameter"><code><a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> *self</code></em>);
<a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="returnvalue">GCancellable</span></a> * <a class="link" href="GDataUploadStream.html#gdata-upload-stream-get-cancellable" title="gdata_upload_stream_get_cancellable ()">gdata_upload_stream_get_cancellable</a> (<em class="parameter"><code><a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> *self</code></em>);
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="GDataUploadStream.html#gdata-upload-stream-get-method" title="gdata_upload_stream_get_method ()">gdata_upload_stream_get_method</a> (<em class="parameter"><code><a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> *self</code></em>);
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="GDataUploadStream.html#gdata-upload-stream-get-upload-uri" title="gdata_upload_stream_get_upload_uri ()">gdata_upload_stream_get_upload_uri</a> (<em class="parameter"><code><a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> *self</code></em>);
<a class="link" href="GDataEntry.html" title="GDataEntry"><span class="returnvalue">GDataEntry</span></a> * <a class="link" href="GDataUploadStream.html#gdata-upload-stream-get-entry" title="gdata_upload_stream_get_entry ()">gdata_upload_stream_get_entry</a> (<em class="parameter"><code><a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> *self</code></em>);
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="GDataUploadStream.html#gdata-upload-stream-get-slug" title="gdata_upload_stream_get_slug ()">gdata_upload_stream_get_slug</a> (<em class="parameter"><code><a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> *self</code></em>);
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="GDataUploadStream.html#gdata-upload-stream-get-content-type" title="gdata_upload_stream_get_content_type ()">gdata_upload_stream_get_content_type</a>
(<em class="parameter"><code><a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> *self</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#goffset"><span class="returnvalue">goffset</span></a> <a class="link" href="GDataUploadStream.html#gdata-upload-stream-get-content-length" title="gdata_upload_stream_get_content_length ()">gdata_upload_stream_get_content_length</a>
(<em class="parameter"><code><a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> *self</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="GDataUploadStream.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
+----<a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html">GOutputStream</a>
+----GDataUploadStream
</pre>
</div>
<div class="refsect1">
<a name="GDataUploadStream.properties"></a><h2>Properties</h2>
<pre class="synopsis">
"<a class="link" href="GDataUploadStream.html#GDataUploadStream--authorization-domain" title='The "authorization-domain" property'>authorization-domain</a>" <a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="type">GDataAuthorizationDomain</span></a>* : Read / Write / Construct Only
"<a class="link" href="GDataUploadStream.html#GDataUploadStream--cancellable" title='The "cancellable" property'>cancellable</a>" <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a>* : Read / Write / Construct Only
"<a class="link" href="GDataUploadStream.html#GDataUploadStream--content-length" title='The "content-length" property'>content-length</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a> : Read / Write / Construct Only
"<a class="link" href="GDataUploadStream.html#GDataUploadStream--content-type" title='The "content-type" property'>content-type</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write / Construct Only
"<a class="link" href="GDataUploadStream.html#GDataUploadStream--entry" title='The "entry" property'>entry</a>" <a class="link" href="GDataEntry.html" title="GDataEntry"><span class="type">GDataEntry</span></a>* : Read / Write / Construct Only
"<a class="link" href="GDataUploadStream.html#GDataUploadStream--method" title='The "method" property'>method</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write / Construct Only
"<a class="link" href="GDataUploadStream.html#GDataUploadStream--service" title='The "service" property'>service</a>" <a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a>* : Read / Write / Construct Only
"<a class="link" href="GDataUploadStream.html#GDataUploadStream--slug" title='The "slug" property'>slug</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write / Construct Only
"<a class="link" href="GDataUploadStream.html#GDataUploadStream--upload-uri" title='The "upload-uri" property'>upload-uri</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write / Construct Only
</pre>
</div>
<div class="refsect1">
<a name="GDataUploadStream.description"></a><h2>Description</h2>
<p>
<a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> is a <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html"><span class="type">GOutputStream</span></a> subclass to allow uploading of files from GData services with authorization from a <a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a> under
the given <a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="type">GDataAuthorizationDomain</span></a>. If authorization is not required to perform the upload, a <a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="type">GDataAuthorizationDomain</span></a> doesn't have to be
specified.
</p>
<p>
Once a <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> is instantiated with <a class="link" href="GDataUploadStream.html#gdata-upload-stream-new" title="gdata_upload_stream_new ()"><code class="function">gdata_upload_stream_new()</code></a>, the standard <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html"><span class="type">GOutputStream</span></a> API can be used on the stream to upload
the file. Network communication may not actually begin until the first call to <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html#g-output-stream-write"><code class="function">g_output_stream_write()</code></a>, so having a <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> around is no
guarantee that data is being uploaded.
</p>
<p>
Uploads of a file, or a file with associated metadata (a <a class="link" href="GDataEntry.html" title="GDataEntry"><span class="type">GDataEntry</span></a>) should use <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a>, but if you want to simply upload a single
<a class="link" href="GDataEntry.html" title="GDataEntry"><span class="type">GDataEntry</span></a>, use <a class="link" href="GDataService.html#gdata-service-insert-entry" title="gdata_service_insert_entry ()"><code class="function">gdata_service_insert_entry()</code></a> instead. <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> is for large streaming uploads.
</p>
<p>
Once an upload is complete, the server's response can be retrieved from the <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> using <a class="link" href="GDataUploadStream.html#gdata-upload-stream-get-response" title="gdata_upload_stream_get_response ()"><code class="function">gdata_upload_stream_get_response()</code></a>. In order
for network communication to be guaranteed to have stopped (and thus the response definitely available), <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html#g-output-stream-close"><code class="function">g_output_stream_close()</code></a> must be called
on the <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> first. Otherwise, <a class="link" href="GDataUploadStream.html#gdata-upload-stream-get-response" title="gdata_upload_stream_get_response ()"><code class="function">gdata_upload_stream_get_response()</code></a> may return saying that the operation is still in progress.
</p>
<p>
If the server returns an error instead of a success response, the error will be returned by <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html#g-output-stream-close"><code class="function">g_output_stream_close()</code></a> as a <a class="link" href="GDataService.html#GDataServiceError" title="enum GDataServiceError"><span class="type">GDataServiceError</span></a>.
</p>
<p>
The entire upload operation can be cancelled using the <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> instance provided to <a class="link" href="GDataUploadStream.html#gdata-upload-stream-new" title="gdata_upload_stream_new ()"><code class="function">gdata_upload_stream_new()</code></a>, or returned by
<a class="link" href="GDataUploadStream.html#gdata-upload-stream-get-cancellable" title="gdata_upload_stream_get_cancellable ()"><code class="function">gdata_upload_stream_get_cancellable()</code></a>. Cancelling this at any time will cause all future <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html"><span class="type">GOutputStream</span></a> method calls to return
<a href="http://library.gnome.org/devel/gio/unstable/gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a>. If any <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html"><span class="type">GOutputStream</span></a> methods are in the process of being called, they will be cancelled and return <a href="http://library.gnome.org/devel/gio/unstable/gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> as
soon as possible.
</p>
<p>
Note that cancelling an individual method call (such as a call to <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html#g-output-stream-write"><code class="function">g_output_stream_write()</code></a>) using the <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> parameter of the method will not
cancel the upload as a whole — just that particular method call. In the case of <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html#g-output-stream-write"><code class="function">g_output_stream_write()</code></a>, this will cause it to return the number of
bytes it has successfully written up to the point of cancellation (up to the requested number of bytes), or return a <a href="http://library.gnome.org/devel/gio/unstable/gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> if it
had not managed to write any bytes to the network by that point. This is also the behaviour of <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html#g-output-stream-write"><code class="function">g_output_stream_write()</code></a> when the upload operation as
a whole is cancelled.
</p>
<p>
In the case of <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html#g-output-stream-close"><code class="function">g_output_stream_close()</code></a>, the call will return immediately if network activity hasn't yet started. If it has, the network activity
will be cancelled, regardless of whether the call to <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html#g-output-stream-close"><code class="function">g_output_stream_close()</code></a> is cancelled. Cancelling a pending call to <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html#g-output-stream-close"><code class="function">g_output_stream_close()</code></a>
(either using the method's <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a>, or by cancelling the upload stream as a whole) will cause it to stop waiting for the network activity to
finish, and return <a href="http://library.gnome.org/devel/gio/unstable/gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> immediately. Network activity will continue to be shut down in the background.
</p>
<p>
Any outstanding data is guaranteed to be written to the network successfully even if a call to <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html#g-output-stream-close"><code class="function">g_output_stream_close()</code></a> is cancelled. However, if
the upload stream as a whole is cancelled using <a class="link" href="GDataUploadStream.html#GDataUploadStream--cancellable" title='The "cancellable" property'><span class="type">"cancellable"</span></a>, no more data will be sent over the network, and the network
connection will be closed immediately. i.e. <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> will do its best to instruct the server to cancel the upload and any associated
server-side changes of state.
</p>
<p>
If the server returns an error message (for example, if the user is not correctly authenticated/authorized or doesn't have suitable permissions
to upload from the given URI), it will be returned as a <a class="link" href="GDataService.html#GDataServiceError" title="enum GDataServiceError"><span class="type">GDataServiceError</span></a> by <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html#g-output-stream-close"><code class="function">g_output_stream_close()</code></a>.
</p>
<p>
</p>
<div class="example">
<a name="id-1.3.2.10.7.12.1"></a><p class="title"><b>Example 3. Uploading from a File</b></p>
<div class="example-contents">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="usertype">GDataService</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">service</span><span class="symbol">;</span>
<span class="usertype">GDataAuthorizationDomain</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">domain</span><span class="symbol">;</span>
<span class="usertype">GCancellable</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">cancellable</span><span class="symbol">;</span>
<span class="usertype">GInputStream</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">input_stream</span><span class="symbol">;</span>
<span class="usertype">GOutputStream</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">upload_stream</span><span class="symbol">;</span>
<span class="usertype">GFile</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">file</span><span class="symbol">;</span>
<span class="usertype">GFileInfo</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">file_info</span><span class="symbol">;</span>
<span class="usertype">GError</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">error </span><span class="symbol">=</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">;</span>
<span class="comment">/* Get the file to upload */</span>
<span class="normal">file </span><span class="symbol">=</span><span class="normal"> </span><span class="function">get_file_to_upload</span><span class="normal"> </span><span class="symbol">();</span>
<span class="normal">file_info </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gio/unstable/GFile.html#g-file-query-info">g_file_query_info</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">file</span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/gio/unstable/GFileInfo.html#G-FILE-ATTRIBUTE-STANDARD-DISPLAY-NAME:CAPS">G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME</a> </span><span class="string">","</span><span class="normal"> <a href="http://library.gnome.org/devel/gio/unstable/GFileInfo.html#G-FILE-ATTRIBUTE-STANDARD-CONTENT-TYPE:CAPS">G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE</a> </span><span class="string">","</span>
<span class="normal"> <a href="http://library.gnome.org/devel/gio/unstable/GFileInfo.html#G-FILE-ATTRIBUTE-STANDARD-SIZE:CAPS">G_FILE_ATTRIBUTE_STANDARD_SIZE</a></span><span class="symbol">,</span>
<span class="normal"> <a href="http://library.gnome.org/devel/gio/unstable/GFile.html#G-FILE-QUERY-INFO-NONE:CAPS">G_FILE_QUERY_INFO_NONE</a></span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">error</span><span class="symbol">);</span>
<span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">file_info </span><span class="symbol">==</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">)</span><span class="normal"> </span><span class="cbracket">{</span>
<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Message-Logging.html#g-error">g_error</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Error getting file info: %s"</span><span class="symbol">,</span><span class="normal"> error</span><span class="symbol">-></span><span class="normal">message</span><span class="symbol">);</span>
<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#g-error-free">g_error_free</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">error</span><span class="symbol">);</span>
<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">file</span><span class="symbol">);</span>
<span class="normal"> </span><span class="keyword">return</span><span class="symbol">;</span>
<span class="cbracket">}</span>
<span class="normal">input_stream </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gio/unstable/GFile.html#g-file-read">g_file_read</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">file</span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">error</span><span class="symbol">);</span>
<span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">file</span><span class="symbol">);</span>
<span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">input_stream </span><span class="symbol">==</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">)</span><span class="normal"> </span><span class="cbracket">{</span>
<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Message-Logging.html#g-error">g_error</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Error getting file input stream: %s"</span><span class="symbol">,</span><span class="normal"> error</span><span class="symbol">-></span><span class="normal">message</span><span class="symbol">);</span>
<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#g-error-free">g_error_free</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">error</span><span class="symbol">);</span>
<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">file_info</span><span class="symbol">);</span>
<span class="normal"> </span><span class="keyword">return</span><span class="symbol">;</span>
<span class="cbracket">}</span>
<span class="comment">/* Create the upload stream */</span>
<span class="normal">service </span><span class="symbol">=</span><span class="normal"> </span><span class="function">create_my_service</span><span class="normal"> </span><span class="symbol">();</span>
<span class="normal">domain </span><span class="symbol">=</span><span class="normal"> </span><span class="function">get_my_authorization_domain_from_service</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">service</span><span class="symbol">);</span>
<span class="normal">cancellable </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html#g-cancellable-new">g_cancellable_new</a></span><span class="normal"> </span><span class="symbol">();</span><span class="normal"> </span><span class="comment">/* cancel this to cancel the entire upload operation */</span>
<span class="normal">upload_stream </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GDataUploadStream.html#gdata-upload-stream-new-resumable">gdata_upload_stream_new_resumable</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">service</span><span class="symbol">,</span><span class="normal"> domain</span><span class="symbol">,</span><span class="normal"> SOUP_METHOD_POST</span><span class="symbol">,</span><span class="normal"> upload_uri</span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span>
<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gio/unstable/GFileInfo.html#g-file-info-get-display-name">g_file_info_get_display_name</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">file_info</span><span class="symbol">),</span><span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gio/unstable/GFileInfo.html#g-file-info-get-content-type">g_file_info_get_content_type</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">file_info</span><span class="symbol">),</span>
<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gio/unstable/GFileInfo.html#g-file-info-get-size">g_file_info_get_size</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">file_info</span><span class="symbol">),</span><span class="normal"> cancellable</span><span class="symbol">);</span>
<span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">file_info</span><span class="symbol">);</span>
<span class="comment">/* Perform the upload asynchronously */</span>
<span class="function"><a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html#g-output-stream-splice-async">g_output_stream_splice_async</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">upload_stream</span><span class="symbol">,</span><span class="normal"> input_stream</span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html#G-OUTPUT-STREAM-SPLICE-CLOSE-SOURCE:CAPS">G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE</a> </span><span class="symbol">|</span><span class="normal"> <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html#G-OUTPUT-STREAM-SPLICE-CLOSE-TARGET:CAPS">G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET</a></span><span class="symbol">,</span>
<span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#G-PRIORITY-DEFAULT:CAPS">G_PRIORITY_DEFAULT</a></span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a></span><span class="symbol">)</span><span class="normal"> upload_splice_cb</span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
<span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">upload_stream</span><span class="symbol">);</span>
<span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">input_stream</span><span class="symbol">);</span>
<span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">cancellable</span><span class="symbol">);</span>
<span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">domain</span><span class="symbol">);</span>
<span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">service</span><span class="symbol">);</span>
<span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
<span class="function">upload_splice_cb</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">GOutputStream</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">upload_stream</span><span class="symbol">,</span><span class="normal"> </span><span class="usertype">GAsyncResult</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">result</span><span class="symbol">,</span><span class="normal"> </span><span class="usertype">gpointer</span><span class="normal"> user_data</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal"> </span><span class="usertype">gssize</span><span class="normal"> length</span><span class="symbol">;</span>
<span class="normal"> </span><span class="usertype">GError</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">error </span><span class="symbol">=</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">;</span>
<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html#g-output-stream-splice-finish">g_output_stream_splice_finish</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">upload_stream</span><span class="symbol">,</span><span class="normal"> result</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">error</span><span class="symbol">);</span>
<span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">error </span><span class="symbol">!=</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a> </span><span class="symbol">&&</span><span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#g-error-matches">g_error_matches</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">error</span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/gio/unstable/gio-GIOError.html#G-IO-ERROR:CAPS">G_IO_ERROR</a></span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/gio/unstable/gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS">G_IO_ERROR_CANCELLED</a></span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">==</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS">FALSE</a></span><span class="symbol">))</span><span class="normal"> </span><span class="cbracket">{</span>
<span class="normal"> </span><span class="comment">/* Error upload the file; potentially an I/O error (GIOError), or an error response from the server</span>
<span class="comment"> * (GDataServiceError). */</span>
<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Message-Logging.html#g-error">g_error</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Error uploading file: %s"</span><span class="symbol">,</span><span class="normal"> error</span><span class="symbol">-></span><span class="normal">message</span><span class="symbol">);</span>
<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#g-error-free">g_error_free</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">error</span><span class="symbol">);</span>
<span class="normal"> </span><span class="cbracket">}</span>
<span class="normal"> </span><span class="comment">/* If the upload was successful, carry on to parse the result. Note that this will normally be handled by methods like</span>
<span class="comment"> * gdata_youtube_service_finish_video_upload(), gdata_picasaweb_service_finish_file_upload() and</span>
<span class="comment"> * gdata_documents_service_finish_upload() */</span>
<span class="normal"> </span><span class="function">parse_server_result</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="GDataUploadStream.html#gdata-upload-stream-get-response">gdata_upload_stream_get_response</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GDATA_UPLOAD_STREAM</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">upload_stream</span><span class="symbol">),</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">length</span><span class="symbol">),</span><span class="normal"> length</span><span class="symbol">);</span>
<span class="cbracket">}</span></pre></td>
</tr>
</tbody>
</table>
</div>
</div>
<p><br class="example-break">
</p>
</div>
<div class="refsect1">
<a name="GDataUploadStream.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GDATA-LINK-RESUMABLE-CREATE-MEDIA:CAPS"></a><h3>GDATA_LINK_RESUMABLE_CREATE_MEDIA</h3>
<pre class="programlisting">#define GDATA_LINK_RESUMABLE_CREATE_MEDIA "http://schemas.google.com/g/2005#resumable-create-media"
</pre>
<p>
The relation type URI of the resumable upload location for resources attached to this resource.
</p>
<p>
For more information, see the
<a class="ulink" href="http://code.google.com/apis/gdata/docs/resumable_upload.html#ResumableUploadInitiate" target="_top">GData resumable upload protocol
specification</a>.
</p>
<p class="since">Since 0.13.0</p>
</div>
<hr>
<div class="refsect2">
<a name="GDATA-LINK-RESUMABLE-EDIT-MEDIA:CAPS"></a><h3>GDATA_LINK_RESUMABLE_EDIT_MEDIA</h3>
<pre class="programlisting">#define GDATA_LINK_RESUMABLE_EDIT_MEDIA "http://schemas.google.com/g/2005#resumable-edit-media"
</pre>
<p>
The relation type URI of the resumable update location for resources attached to this resource.
</p>
<p>
For more information, see the
<a class="ulink" href="http://code.google.com/apis/gdata/docs/resumable_upload.html#ResumableUploadInitiate" target="_top">GData resumable upload protocol
specification</a>.
</p>
<p class="since">Since 0.13.0</p>
</div>
<hr>
<div class="refsect2">
<a name="GDataUploadStream-struct"></a><h3>GDataUploadStream</h3>
<pre class="programlisting">typedef struct _GDataUploadStream GDataUploadStream;</pre>
<p>
All the fields in the <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> structure are private and should never be accessed directly.
</p>
<p class="since">Since 0.5.0</p>
</div>
<hr>
<div class="refsect2">
<a name="GDataUploadStreamClass"></a><h3>GDataUploadStreamClass</h3>
<pre class="programlisting">typedef struct {
} GDataUploadStreamClass;
</pre>
<p>
All the fields in the <a class="link" href="GDataUploadStream.html#GDataUploadStreamClass" title="GDataUploadStreamClass"><span class="type">GDataUploadStreamClass</span></a> structure are private and should never be accessed directly.
</p>
<p class="since">Since 0.5.0</p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-upload-stream-new"></a><h3>gdata_upload_stream_new ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html"><span class="returnvalue">GOutputStream</span></a> * gdata_upload_stream_new (<em class="parameter"><code><a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a> *service</code></em>,
<em class="parameter"><code><a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="type">GDataAuthorizationDomain</span></a> *domain</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *method</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *upload_uri</code></em>,
<em class="parameter"><code><a class="link" href="GDataEntry.html" title="GDataEntry"><span class="type">GDataEntry</span></a> *entry</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *slug</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *content_type</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>);</pre>
<p>
Creates a new <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a>, allowing a file to be uploaded from a GData service using standard <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html"><span class="type">GOutputStream</span></a> API.
</p>
<p>
The HTTP method to use should be specified in <em class="parameter"><code>method</code></em>, and will typically be either <code class="literal">SOUP_METHOD_POST</code> (for insertions) or <code class="literal">SOUP_METHOD_PUT</code>
(for updates), according to the server and the <em class="parameter"><code>upload_uri</code></em>.
</p>
<p>
If <em class="parameter"><code>entry</code></em> is specified, it will be attached to the upload as the entry to which the file being uploaded belongs. Otherwise, just the file
written to the stream will be uploaded, and given a default entry as determined by the server.
</p>
<p>
<em class="parameter"><code>slug</code></em> and <em class="parameter"><code>content_type</code></em> must be specified before the upload begins, as they describe the file being streamed. <em class="parameter"><code>slug</code></em> is the filename given to the
file, which will typically be stored on the server and made available when downloading the file again. <em class="parameter"><code>content_type</code></em> must be the correct
content type for the file, and should be in the service's list of acceptable content types.
</p>
<p>
As well as the standard GIO errors, calls to the <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html"><span class="type">GOutputStream</span></a> API on a <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> can also return any relevant specific error from
<a class="link" href="GDataService.html#GDataServiceError" title="enum GDataServiceError"><span class="type">GDataServiceError</span></a>, or <a class="link" href="GDataService.html#GDATA-SERVICE-ERROR-PROTOCOL-ERROR:CAPS"><code class="literal">GDATA_SERVICE_ERROR_PROTOCOL_ERROR</code></a> in the general case.
</p>
<p>
If a <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> is provided in <em class="parameter"><code>cancellable</code></em>, the upload operation may be cancelled at any time from another thread using <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html#g-cancellable-cancel"><code class="function">g_cancellable_cancel()</code></a>.
In this case, any ongoing network activity will be stopped, and any pending or future calls to <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html"><span class="type">GOutputStream</span></a> API on the <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> will
return <a href="http://library.gnome.org/devel/gio/unstable/gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a>. Note that the <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> objects which can be passed to individual <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html"><span class="type">GOutputStream</span></a> operations will not cancel the
upload operation proper if cancelled — they will merely cancel that API call. The only way to cancel the upload operation completely is using this
<em class="parameter"><code>cancellable</code></em>.
</p>
<p>
Note that network communication won't begin until the first call to <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html#g-output-stream-write"><code class="function">g_output_stream_write()</code></a> on the <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>service</code></em> :</span></p></td>
<td>a <a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
<td>the <a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="type">GDataAuthorizationDomain</span></a> to authorize the upload, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>method</code></em> :</span></p></td>
<td>the HTTP method to use</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>upload_uri</code></em> :</span></p></td>
<td>the URI to upload</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>entry</code></em> :</span></p></td>
<td>the entry to upload as metadata, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>slug</code></em> :</span></p></td>
<td>the file's slug (filename)</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>content_type</code></em> :</span></p></td>
<td>the content type of the file being uploaded</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> for the entire upload stream, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html"><span class="type">GOutputStream</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>; unref with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.9.0</p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-upload-stream-new-resumable"></a><h3>gdata_upload_stream_new_resumable ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html"><span class="returnvalue">GOutputStream</span></a> * gdata_upload_stream_new_resumable (<em class="parameter"><code><a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a> *service</code></em>,
<em class="parameter"><code><a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="type">GDataAuthorizationDomain</span></a> *domain</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *method</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *upload_uri</code></em>,
<em class="parameter"><code><a class="link" href="GDataEntry.html" title="GDataEntry"><span class="type">GDataEntry</span></a> *entry</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *slug</code></em>,
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *content_type</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#goffset"><span class="type">goffset</span></a> content_length</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>);</pre>
<p>
Creates a new resumable <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a>, allowing a file to be uploaded from a GData service using standard <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html"><span class="type">GOutputStream</span></a> API. The upload will
use GData's resumable upload API, so should be more reliable than a normal upload (especially if the file is large). See the
<a class="ulink" href="http://code.google.com/apis/gdata/docs/resumable_upload.html" target="_top">GData documentation on resumable uploads</a> for more
information.
</p>
<p>
The HTTP method to use should be specified in <em class="parameter"><code>method</code></em>, and will typically be either <code class="literal">SOUP_METHOD_POST</code> (for insertions) or <code class="literal">SOUP_METHOD_PUT</code>
(for updates), according to the server and the <em class="parameter"><code>upload_uri</code></em>.
</p>
<p>
If <em class="parameter"><code>entry</code></em> is specified, it will be attached to the upload as the entry to which the file being uploaded belongs. Otherwise, just the file
written to the stream will be uploaded, and given a default entry as determined by the server.
</p>
<p>
<em class="parameter"><code>slug</code></em>, <em class="parameter"><code>content_type</code></em> and <em class="parameter"><code>content_length</code></em> must be specified before the upload begins, as they describe the file being streamed. <em class="parameter"><code>slug</code></em> is the filename
given to the file, which will typically be stored on the server and made available when downloading the file again. <em class="parameter"><code>content_type</code></em> must be the
correct content type for the file, and should be in the service's list of acceptable content types. <em class="parameter"><code>content_length</code></em> must be the size of the file
being uploaded (not including the XML for any associated <a class="link" href="GDataEntry.html" title="GDataEntry"><span class="type">GDataEntry</span></a>) in bytes. Zero is accepted if a metadata-only upload is being performed.
</p>
<p>
As well as the standard GIO errors, calls to the <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html"><span class="type">GOutputStream</span></a> API on a <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> can also return any relevant specific error from
<a class="link" href="GDataService.html#GDataServiceError" title="enum GDataServiceError"><span class="type">GDataServiceError</span></a>, or <a class="link" href="GDataService.html#GDATA-SERVICE-ERROR-PROTOCOL-ERROR:CAPS"><code class="literal">GDATA_SERVICE_ERROR_PROTOCOL_ERROR</code></a> in the general case.
</p>
<p>
If a <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> is provided in <em class="parameter"><code>cancellable</code></em>, the upload operation may be cancelled at any time from another thread using <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html#g-cancellable-cancel"><code class="function">g_cancellable_cancel()</code></a>.
In this case, any ongoing network activity will be stopped, and any pending or future calls to <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html"><span class="type">GOutputStream</span></a> API on the <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> will
return <a href="http://library.gnome.org/devel/gio/unstable/gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a>. Note that the <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> objects which can be passed to individual <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html"><span class="type">GOutputStream</span></a> operations will not cancel the
upload operation proper if cancelled — they will merely cancel that API call. The only way to cancel the upload operation completely is using this
<em class="parameter"><code>cancellable</code></em>.
</p>
<p>
Note that network communication won't begin until the first call to <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html#g-output-stream-write"><code class="function">g_output_stream_write()</code></a> on the <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>service</code></em> :</span></p></td>
<td>a <a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
<td>the <a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="type">GDataAuthorizationDomain</span></a> to authorize the upload, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>method</code></em> :</span></p></td>
<td>the HTTP method to use</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>upload_uri</code></em> :</span></p></td>
<td>the URI to upload</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>entry</code></em> :</span></p></td>
<td>the entry to upload as metadata, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>slug</code></em> :</span></p></td>
<td>the file's slug (filename)</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>content_type</code></em> :</span></p></td>
<td>the content type of the file being uploaded</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>content_length</code></em> :</span></p></td>
<td>the size (in bytes) of the file being uploaded</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> for the entire upload stream, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html"><span class="type">GOutputStream</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>; unref with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.13.0</p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-upload-stream-get-response"></a><h3>gdata_upload_stream_get_response ()</h3>
<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * gdata_upload_stream_get_response (<em class="parameter"><code><a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> *self</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gssize"><span class="type">gssize</span></a> *length</code></em>);</pre>
<p>
Returns the server's response to the upload operation performed by the <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a>. If the operation
is still underway, or the server's response hasn't been received yet, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned and <em class="parameter"><code>length</code></em> is set to <code class="code">-1</code>.
</p>
<p>
If there was an error during the upload operation (but it is complete), <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned, and <em class="parameter"><code>length</code></em> is set to <code class="code">0</code>.
</p>
<p>
While it is safe to call this function from any thread at any time during the network operation, the only way to guarantee that the response has
been set before calling this function is to have closed the <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> by calling <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html#g-output-stream-close"><code class="function">g_output_stream_close()</code></a> on it, without cancelling
the close operation. Once the stream has been closed, all network communication is guaranteed to have finished. Note that if a call to
<a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html#g-output-stream-close"><code class="function">g_output_stream_close()</code></a> is cancelled, <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html#g-output-stream-is-closed"><code class="function">g_output_stream_is_closed()</code></a> will immediately start to return <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, even if the <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> is still
attempting to flush the network buffers asynchronously — consequently, <a class="link" href="GDataUploadStream.html#gdata-upload-stream-get-response" title="gdata_upload_stream_get_response ()"><code class="function">gdata_upload_stream_get_response()</code></a> may still return <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> and a <em class="parameter"><code>length</code></em> of
<code class="code">-1</code>. The only reliable way to determine if the stream has been fully closed in this situation is to check the results
of <a class="link" href="GDataUploadStream.html#gdata-upload-stream-get-response" title="gdata_upload_stream_get_response ()"><code class="function">gdata_upload_stream_get_response()</code></a>, rather than <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html#g-output-stream-is-closed"><code class="function">g_output_stream_is_closed()</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
<td>a <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>return location for the length of the response, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<acronym title="Out parameter, where caller must allocate storage."><span class="acronym">out caller-allocates</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the server's response to the upload, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.5.0</p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-upload-stream-get-service"></a><h3>gdata_upload_stream_get_service ()</h3>
<pre class="programlisting"><a class="link" href="GDataService.html" title="GDataService"><span class="returnvalue">GDataService</span></a> * gdata_upload_stream_get_service (<em class="parameter"><code><a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> *self</code></em>);</pre>
<p>
Gets the service used to authorize the upload, as passed to <a class="link" href="GDataUploadStream.html#gdata-upload-stream-new" title="gdata_upload_stream_new ()"><code class="function">gdata_upload_stream_new()</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
<td>a <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the <a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a> used to authorize the upload. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.5.0</p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-upload-stream-get-authorization-domain"></a><h3>gdata_upload_stream_get_authorization_domain ()</h3>
<pre class="programlisting"><a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="returnvalue">GDataAuthorizationDomain</span></a> * gdata_upload_stream_get_authorization_domain
(<em class="parameter"><code><a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> *self</code></em>);</pre>
<p>
Gets the authorization domain used to authorize the upload, as passed to <a class="link" href="GDataUploadStream.html#gdata-upload-stream-new" title="gdata_upload_stream_new ()"><code class="function">gdata_upload_stream_new()</code></a>. It may be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if authorization is not
needed for the upload.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
<td>a <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the <a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="type">GDataAuthorizationDomain</span></a> used to authorize the upload, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.9.0</p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-upload-stream-get-cancellable"></a><h3>gdata_upload_stream_get_cancellable ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="returnvalue">GCancellable</span></a> * gdata_upload_stream_get_cancellable (<em class="parameter"><code><a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> *self</code></em>);</pre>
<p>
Gets the <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> for the entire upload operation, <a class="link" href="GDataUploadStream.html#GDataUploadStream--cancellable" title='The "cancellable" property'><span class="type">"cancellable"</span></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
<td>a <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> for the entire upload operation. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.8.0</p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-upload-stream-get-method"></a><h3>gdata_upload_stream_get_method ()</h3>
<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * gdata_upload_stream_get_method (<em class="parameter"><code><a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> *self</code></em>);</pre>
<p>
Gets the HTTP request method being used to upload the file, as passed to <a class="link" href="GDataUploadStream.html#gdata-upload-stream-new" title="gdata_upload_stream_new ()"><code class="function">gdata_upload_stream_new()</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
<td>a <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the HTTP request method in use</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.7.0</p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-upload-stream-get-upload-uri"></a><h3>gdata_upload_stream_get_upload_uri ()</h3>
<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * gdata_upload_stream_get_upload_uri (<em class="parameter"><code><a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> *self</code></em>);</pre>
<p>
Gets the URI the file is being uploaded to, as passed to <a class="link" href="GDataUploadStream.html#gdata-upload-stream-new" title="gdata_upload_stream_new ()"><code class="function">gdata_upload_stream_new()</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
<td>a <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the URI which the file is being uploaded to</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.5.0</p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-upload-stream-get-entry"></a><h3>gdata_upload_stream_get_entry ()</h3>
<pre class="programlisting"><a class="link" href="GDataEntry.html" title="GDataEntry"><span class="returnvalue">GDataEntry</span></a> * gdata_upload_stream_get_entry (<em class="parameter"><code><a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> *self</code></em>);</pre>
<p>
Gets the entry being used to upload metadata, if one was passed to <a class="link" href="GDataUploadStream.html#gdata-upload-stream-new" title="gdata_upload_stream_new ()"><code class="function">gdata_upload_stream_new()</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
<td>a <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the entry used for metadata, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.5.0</p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-upload-stream-get-slug"></a><h3>gdata_upload_stream_get_slug ()</h3>
<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * gdata_upload_stream_get_slug (<em class="parameter"><code><a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> *self</code></em>);</pre>
<p>
Gets the slug (filename) of the file being uploaded.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
<td>a <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the slug of the file being uploaded</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.5.0</p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-upload-stream-get-content-type"></a><h3>gdata_upload_stream_get_content_type ()</h3>
<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * gdata_upload_stream_get_content_type
(<em class="parameter"><code><a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> *self</code></em>);</pre>
<p>
Gets the content type of the file being uploaded.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
<td>a <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the content type of the file being uploaded</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.5.0</p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-upload-stream-get-content-length"></a><h3>gdata_upload_stream_get_content_length ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#goffset"><span class="returnvalue">goffset</span></a> gdata_upload_stream_get_content_length
(<em class="parameter"><code><a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> *self</code></em>);</pre>
<p>
Gets the size (in bytes) of the file being uploaded. This will be <code class="code">-1</code> for a non-resumable upload, and zero or greater
for a resumable upload.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
<td>a <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the size of the file being uploaded</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.13.0</p>
</div>
</div>
<div class="refsect1">
<a name="GDataUploadStream.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="GDataUploadStream--authorization-domain"></a><h3>The <code class="literal">"authorization-domain"</code> property</h3>
<pre class="programlisting"> "authorization-domain" <a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="type">GDataAuthorizationDomain</span></a>* : Read / Write / Construct Only</pre>
<p>
The authorization domain for the upload, against which the <a class="link" href="GDataService.html#GDataService--authorizer" title='The "authorizer" property'><span class="type">"authorizer"</span></a> for the <a class="link" href="GDataDownloadStream.html#GDataDownloadStream--service" title='The "service" property'><span class="type">"service"</span></a> should be
authorized. This may be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if authorization is not needed for the upload.
</p>
<p class="since">Since 0.9.0</p>
</div>
<hr>
<div class="refsect2">
<a name="GDataUploadStream--cancellable"></a><h3>The <code class="literal">"cancellable"</code> property</h3>
<pre class="programlisting"> "cancellable" <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a>* : Read / Write / Construct Only</pre>
<p>
An optional cancellable used to cancel the entire upload operation. If a <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> instance isn't provided for this property at
construction time (i.e. to <a class="link" href="GDataUploadStream.html#gdata-upload-stream-new" title="gdata_upload_stream_new ()"><code class="function">gdata_upload_stream_new()</code></a>), one will be created internally and can be retrieved using
<a class="link" href="GDataUploadStream.html#gdata-upload-stream-get-cancellable" title="gdata_upload_stream_get_cancellable ()"><code class="function">gdata_upload_stream_get_cancellable()</code></a> and used to cancel the upload operation with <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html#g-cancellable-cancel"><code class="function">g_cancellable_cancel()</code></a> just as if it was passed to
<a class="link" href="GDataUploadStream.html#gdata-upload-stream-new" title="gdata_upload_stream_new ()"><code class="function">gdata_upload_stream_new()</code></a>.
</p>
<p>
If the upload operation is cancelled using this <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a>, any ongoing network activity will be stopped, and any pending or future calls
to <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html"><span class="type">GOutputStream</span></a> API on the <a class="link" href="GDataUploadStream.html" title="GDataUploadStream"><span class="type">GDataUploadStream</span></a> will return <a href="http://library.gnome.org/devel/gio/unstable/gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a>. Note that the <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> objects which can be passed
to individual <a href="http://library.gnome.org/devel/gio/unstable/GOutputStream.html"><span class="type">GOutputStream</span></a> operations will not cancel the upload operation proper if cancelled — they will merely cancel that API call.
The only way to cancel the upload operation completely is using <a class="link" href="GDataUploadStream.html#GDataUploadStream--cancellable" title='The "cancellable" property'><span class="type">"cancellable"</span></a>.
</p>
<p class="since">Since 0.8.0</p>
</div>
<hr>
<div class="refsect2">
<a name="GDataUploadStream--content-length"></a><h3>The <code class="literal">"content-length"</code> property</h3>
<pre class="programlisting"> "content-length" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a> : Read / Write / Construct Only</pre>
<p>
The content length (in bytes) of the file being uploaded (i.e. as returned by <a href="http://library.gnome.org/devel/gio/unstable/GFileInfo.html#g-file-info-get-size"><code class="function">g_file_info_get_size()</code></a>). Note that this does not include the
length of the XML serialisation of <a class="link" href="GDataUploadStream.html#GDataUploadStream--entry" title='The "entry" property'><span class="type">"entry"</span></a>, if set.
</p>
<p>
If this is <code class="code">-1</code> the upload will be non-resumable; if it is non-negative, the upload will be resumable.
</p>
<p>Allowed values: >= -1</p>
<p>Default value: -1</p>
<p class="since">Since 0.13.0</p>
</div>
<hr>
<div class="refsect2">
<a name="GDataUploadStream--content-type"></a><h3>The <code class="literal">"content-type"</code> property</h3>
<pre class="programlisting"> "content-type" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write / Construct Only</pre>
<p>
The content type of the file being uploaded (i.e. as returned by <a href="http://library.gnome.org/devel/gio/unstable/GFileInfo.html#g-file-info-get-content-type"><code class="function">g_file_info_get_content_type()</code></a>).
</p>
<p>Default value: NULL</p>
<p class="since">Since 0.5.0</p>
</div>
<hr>
<div class="refsect2">
<a name="GDataUploadStream--entry"></a><h3>The <code class="literal">"entry"</code> property</h3>
<pre class="programlisting"> "entry" <a class="link" href="GDataEntry.html" title="GDataEntry"><span class="type">GDataEntry</span></a>* : Read / Write / Construct Only</pre>
<p>
The entry used for metadata to upload.
</p>
<p class="since">Since 0.5.0</p>
</div>
<hr>
<div class="refsect2">
<a name="GDataUploadStream--method"></a><h3>The <code class="literal">"method"</code> property</h3>
<pre class="programlisting"> "method" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write / Construct Only</pre>
<p>
The HTTP request method to use when uploading the file.
</p>
<p>Default value: NULL</p>
<p class="since">Since 0.7.0</p>
</div>
<hr>
<div class="refsect2">
<a name="GDataUploadStream--service"></a><h3>The <code class="literal">"service"</code> property</h3>
<pre class="programlisting"> "service" <a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a>* : Read / Write / Construct Only</pre>
<p>
The service which is used to authorize the upload, and to which the upload relates.
</p>
<p class="since">Since 0.5.0</p>
</div>
<hr>
<div class="refsect2">
<a name="GDataUploadStream--slug"></a><h3>The <code class="literal">"slug"</code> property</h3>
<pre class="programlisting"> "slug" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write / Construct Only</pre>
<p>
The slug of the file being uploaded. This is usually the display name of the file (i.e. as returned by <a href="http://library.gnome.org/devel/gio/unstable/GFileInfo.html#g-file-info-get-display-name"><code class="function">g_file_info_get_display_name()</code></a>).
</p>
<p>Default value: NULL</p>
<p class="since">Since 0.5.0</p>
</div>
<hr>
<div class="refsect2">
<a name="GDataUploadStream--upload-uri"></a><h3>The <code class="literal">"upload-uri"</code> property</h3>
<pre class="programlisting"> "upload-uri" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write / Construct Only</pre>
<p>
The URI to upload the data and metadata to.
</p>
<p>Default value: NULL</p>
<p class="since">Since 0.5.0</p>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.19.1</div>
</body>
</html>
|