![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/share/doc/gnustep-base-doc/Base/Reference/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>NSURLDownload class documentation</title> </head> <body> <font face="serif"> <a href="Base.html">Up</a> <br /> <h1><a name="title$NSURLDownload">NSURLDownload class documentation</a></h1> <h3>Authors</h3> <dl> <dt>Generated by Debian</dt> <dd> </dd> </dl> <div> <hr width="50%" align="left" /> <h3>Contents -</h3> <ol> <li> <a href="#001000000000">Software documentation for the NSURLDownload class</a> </li> <li> <a href="#002000000000">Software documentation for the NSObject(NSURLDownloadDelegate) category</a> </li> <li> <a href="#003000000000">Software documentation for the NSURLDownloadDelegate protocol</a> </li> </ol> <hr width="50%" align="left" /> </div> <h1><a name="001000000000"> Software documentation for the NSURLDownload class </a></h1> <h2><a name="class$NSURLDownload">NSURLDownload</a> : <a rel="gsdoc" href="NSObject.html#class$NSObject">NSObject</a></h2> <blockquote class="declared"> <dl> <dt><b>Declared in:</b></dt> <dd>Foundation/NSURLDownload.h</dd> </dl> </blockquote> <div class="availability"> <b>Availability:</b> MacOS-X 10.2.0, Base 1.13.0</div> <br /> <div class="desc"> Handles download to file. </div> <hr width="50%" align="left" /> <a href="#_NSURLDownload_ivars">Instance Variables</a> <br/><br/> <b>Method summary</b> <ul> <li><a rel="gsdoc" href="NSURLDownload.html#method$NSURLDownload+canResumeDownloadDecodedWithEncodingMIMEType$">+canResumeDownloadDecodedWithEncodingMIMEType:</a></li> <li><a rel="gsdoc" href="NSURLDownload.html#method$NSURLDownload-cancel">-cancel</a></li> <li><a rel="gsdoc" href="NSURLDownload.html#method$NSURLDownload-deletesFileUponFailure">-deletesFileUponFailure</a></li> <li><a rel="gsdoc" href="NSURLDownload.html#method$NSURLDownload-initWithRequest$delegate$">-initWithRequest:delegate:</a></li> <li><a rel="gsdoc" href="NSURLDownload.html#method$NSURLDownload-initWithResumeData$delegate$path$">-initWithResumeData:delegate:path:</a></li> <li><a rel="gsdoc" href="NSURLDownload.html#method$NSURLDownload-request">-request</a></li> <li><a rel="gsdoc" href="NSURLDownload.html#method$NSURLDownload-resumeData">-resumeData</a></li> <li><a rel="gsdoc" href="NSURLDownload.html#method$NSURLDownload-setDeletesFileUponFailure$">-setDeletesFileUponFailure:</a></li> <li><a rel="gsdoc" href="NSURLDownload.html#method$NSURLDownload-setDestination$allowOverwrite$">-setDestination:allowOverwrite:</a></li> </ul> <hr width="50%" align="left" /> <div class="method"> <h3><a name="method$NSURLDownload+canResumeDownloadDecodedWithEncodingMIMEType$">canResumeDownloadDecodedWithEncodingMIMEType: </a></h3> + (BOOL) <b>canResumeDownloadDecodedWithEncodingMIMEType:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)MIMEType;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.2.0, Base 1.13.0</div> <br /> <div class="desc"> Returns a flag saying whether the class can resume a download which was decoded with <var>MIMEType</var>. <br /> </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSURLDownload-cancel">cancel </a></h3> - (void) <b>cancel</b>;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.2.0, Base 1.13.0</div> <br /> <div class="desc"> Cancels the download and deletes any downloaded file. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSURLDownload-deletesFileUponFailure">deletesFileUponFailure </a></h3> - (BOOL) <b>deletesFileUponFailure</b>;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.2.0, Base 1.13.0</div> <br /> <div class="desc"> Returns a flag saying whether a partially downloaded file should be deleted on failure... <code>YES</code> by default. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSURLDownload-initWithRequest$delegate$">initWithRequest: delegate: </a></h3> - (id) <b>initWithRequest:</b> (<a rel="gsdoc" href="NSURLRequest.html#class$NSURLRequest">NSURLRequest</a>*)request<b> delegate:</b> (id)delegate;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.2.0, Base 1.13.0</div> <br /> <div class="desc"> Initialises the receiver and start the download process. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSURLDownload-initWithResumeData$delegate$path$">initWithResumeData: delegate: path: </a></h3> - (id) <b>initWithResumeData:</b> (<a rel="gsdoc" href="NSData.html#class$NSData">NSData</a>*)resumeData<b> delegate:</b> (id)delegate<b> path:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.2.0, Base 1.13.0</div> <br /> This is a designated initialiser for the class.<br /> <div class="desc"> Initialises the receiver with data from a previous partial download and resumes (or restarts) the downloading process. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSURLDownload-request">request </a></h3> - (<a rel="gsdoc" href="NSURLRequest.html#class$NSURLRequest">NSURLRequest</a>*) <b>request</b>;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.2.0, Base 1.13.0</div> <br /> <div class="desc"> Returns the receiver's request. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSURLDownload-resumeData">resumeData </a></h3> - (<a rel="gsdoc" href="NSData.html#class$NSData">NSData</a>*) <b>resumeData</b>;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.2.0, Base 1.13.0</div> <br /> <div class="desc"> Returns state data of an incomplete download... this data should be sufficient to resume/restart the download using the <a rel="gsdoc" href="#method$NSURLDownload-initWithResumeData$delegate$path$">-initWithResumeData:delegate:path:</a> method. <br /> Returns <code>nil</code> if a resume is probably impossible. <br /> NB. You need to call <a rel="gsdoc" href="#method$NSURLDownload-setDeletesFileUponFailure$">-setDeletesFileUponFailure:</a> to turn off deletion if you wish to be able to resume an incomplete download. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSURLDownload-setDeletesFileUponFailure$">setDeletesFileUponFailure: </a></h3> - (void) <b>setDeletesFileUponFailure:</b> (BOOL)deletesFileUponFailure;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.2.0, Base 1.13.0</div> <br /> <div class="desc"> Sets a flag to determine if downloaded file is be deleted upon failure. This is <code>YES</code> by default and needs to be set to <code>NO</code> if you want to be able to attempt to resume a failed download. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSURLDownload-setDestination$allowOverwrite$">setDestination: allowOverwrite: </a></h3> - (void) <b>setDestination:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path<b> allowOverwrite:</b> (BOOL)allowOverwrite;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.2.0, Base 1.13.0</div> <br /> <div class="desc"> Sets the <var>path</var> to which the file is downloaded. <br /> May be called (once only) after initialisation of the receiver or when the delegate receives a <a rel="gsdoc" href="#method$NSObject(NSURLDownloadDelegate)-download$decideDestinationWithSuggestedFilename$">-download:decideDestinationWithSuggestedFilename:</a> message. <br /> Appends a number to the filename if <var>allowOverwrite</var> is <code>NO</code> and a file already exists at <var>path</var>. <br /> See <a rel="gsdoc" href="#method$NSObject(NSURLDownloadDelegate)-download$didCreateDestination$">-download:didCreateDestination:</a> also. </div> <hr width="25%" align="left" /> </div> <a name="_NSURLDownload_ivars"/> <br/><hr width="50%" align="left" /> <h2>Instance Variables for NSURLDownload Class</h2> <h3><a name="ivariable$NSURLDownload*_NSURLDownloadInternal">_NSURLDownloadInternal</a></h3> @protected void* <b>_NSURLDownloadInternal</b>;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.2.0, Base 1.13.0</div> <br /> <div class="desc"> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </div> <hr width="25%" align="left" /> <br/><hr width="50%" align="left" /><br/> <h1><a name="002000000000"> Software documentation for the NSObject(NSURLDownloadDelegate) category </a></h1> <h2><a rel="gsdoc" href="NSObject.html#class$NSObject">NSObject</a>(<a name="category$NSObject(NSURLDownloadDelegate)">NSURLDownloadDelegate</a>)</h2> <blockquote class="declared"> <dl> <dt><b>Declared in:</b></dt> <dd>Foundation/NSURLDownload.h</dd> </dl> </blockquote> <div class="availability"> <b>Availability:</b> MacOS-X 10.7.0, Base 1.13.0</div> <br /> <div class="desc"> <em>Description forthcoming.</em> </div> <b>Method summary</b> <ul> <li><a rel="gsdoc" href="NSURLDownload.html#method$NSObject(NSURLDownloadDelegate)-download$decideDestinationWithSuggestedFilename$">-download:decideDestinationWithSuggestedFilename:</a></li> <li><a rel="gsdoc" href="NSURLDownload.html#method$NSObject(NSURLDownloadDelegate)-download$didCancelAuthenticationChallenge$">-download:didCancelAuthenticationChallenge:</a></li> <li><a rel="gsdoc" href="NSURLDownload.html#method$NSObject(NSURLDownloadDelegate)-download$didCreateDestination$">-download:didCreateDestination:</a></li> <li><a rel="gsdoc" href="NSURLDownload.html#method$NSObject(NSURLDownloadDelegate)-download$didFailWithError$">-download:didFailWithError:</a></li> <li><a rel="gsdoc" href="NSURLDownload.html#method$NSObject(NSURLDownloadDelegate)-download$didReceiveAuthenticationChallenge$">-download:didReceiveAuthenticationChallenge:</a></li> <li><a rel="gsdoc" href="NSURLDownload.html#method$NSObject(NSURLDownloadDelegate)-download$didReceiveDataOfLength$">-download:didReceiveDataOfLength:</a></li> <li><a rel="gsdoc" href="NSURLDownload.html#method$NSObject(NSURLDownloadDelegate)-download$didReceiveResponse$">-download:didReceiveResponse:</a></li> <li><a rel="gsdoc" href="NSURLDownload.html#method$NSObject(NSURLDownloadDelegate)-download$shouldDecodeSourceDataOfMIMEType$">-download:shouldDecodeSourceDataOfMIMEType:</a></li> <li><a rel="gsdoc" href="NSURLDownload.html#method$NSObject(NSURLDownloadDelegate)-download$willResumeWithResponse$fromByte$">-download:willResumeWithResponse:fromByte:</a></li> <li><a rel="gsdoc" href="NSURLDownload.html#method$NSObject(NSURLDownloadDelegate)-download$willSendRequest$redirectResponse$">-download:willSendRequest:redirectResponse:</a></li> <li><a rel="gsdoc" href="NSURLDownload.html#method$NSObject(NSURLDownloadDelegate)-downloadDidFinish$">-downloadDidFinish:</a></li> </ul> <hr width="50%" align="left" /> <div class="method"> <h3><a name="method$NSObject(NSURLDownloadDelegate)-download$decideDestinationWithSuggestedFilename$">download: decideDestinationWithSuggestedFilename: </a></h3> - (void) <b>download:</b> (<a rel="gsdoc" href="#class$NSURLDownload">NSURLDownload</a>*)download<b> decideDestinationWithSuggestedFilename:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)filename;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.2.0, Base 1.13.0</div> <br /> <div class="desc"> Called when it's time to establish a name for the downloaded file... the delegate may decide a name by inspecting the response. <br /> The delegate should call <a rel="gsdoc" href="#method$NSURLDownload-setDestination$allowOverwrite$"> -setDestination:allowOverwrite: </a> to set the <var>filename</var> to be used. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSURLDownloadDelegate)-download$didCancelAuthenticationChallenge$">download: didCancelAuthenticationChallenge: </a></h3> - (void) <b>download:</b> (<a rel="gsdoc" href="#class$NSURLDownload">NSURLDownload</a>*)download<b> didCancelAuthenticationChallenge:</b> (<a rel="gsdoc" href="NSURLAuthenticationChallenge.html#class$NSURLAuthenticationChallenge">NSURLAuthenticationChallenge</a>*)challenge;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.2.0, Base 1.13.0</div> <br /> <div class="desc"> Called when authentication of a request is cancelled. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSURLDownloadDelegate)-download$didCreateDestination$">download: didCreateDestination: </a></h3> - (void) <b>download:</b> (<a rel="gsdoc" href="#class$NSURLDownload">NSURLDownload</a>*)download<b> didCreateDestination:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)path;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.2.0, Base 1.13.0</div> <br /> <div class="desc"> Called when the <var>download</var> has created the downloaded file. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSURLDownloadDelegate)-download$didFailWithError$">download: didFailWithError: </a></h3> - (void) <b>download:</b> (<a rel="gsdoc" href="#class$NSURLDownload">NSURLDownload</a>*)download<b> didFailWithError:</b> (<a rel="gsdoc" href="NSError.html#class$NSError">NSError</a>*)error;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.2.0, Base 1.13.0</div> <br /> <div class="desc"> Called when the <var>download</var> fails. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSURLDownloadDelegate)-download$didReceiveAuthenticationChallenge$">download: didReceiveAuthenticationChallenge: </a></h3> - (void) <b>download:</b> (<a rel="gsdoc" href="#class$NSURLDownload">NSURLDownload</a>*)download<b> didReceiveAuthenticationChallenge:</b> (<a rel="gsdoc" href="NSURLAuthenticationChallenge.html#class$NSURLAuthenticationChallenge">NSURLAuthenticationChallenge</a>*)challenge;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.2.0, Base 1.13.0</div> <br /> <div class="desc"> Called when an authentication <var>challenge</var> is received. <br /> The delegate should send <a rel="gsdoc" href="NSURLAuthenticationChallenge.html#method$(NSURLAuthenticationChallengeSender)-useCredential$forAuthenticationChallenge$">-useCredential:forAuthenticationChallenge:</a> or <a rel="gsdoc" href="NSURLAuthenticationChallenge.html#method$(NSURLAuthenticationChallengeSender)-continueWithoutCredentialForAuthenticationChallenge$">-continueWithoutCredentialForAuthenticationChallenge:</a> or <a rel="gsdoc" href="#method$NSURLDownload-cancel">-cancel</a> to the connection sender when done. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSURLDownloadDelegate)-download$didReceiveDataOfLength$">download: didReceiveDataOfLength: </a></h3> - (void) <b>download:</b> (<a rel="gsdoc" href="#class$NSURLDownload">NSURLDownload</a>*)download<b> didReceiveDataOfLength:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSUInteger">NSUInteger</a>)length;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.2.0, Base 1.13.0</div> <br /> <div class="desc"> Called when some data has been received. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSURLDownloadDelegate)-download$didReceiveResponse$">download: didReceiveResponse: </a></h3> - (void) <b>download:</b> (<a rel="gsdoc" href="#class$NSURLDownload">NSURLDownload</a>*)download<b> didReceiveResponse:</b> (<a rel="gsdoc" href="NSURLResponse.html#class$NSURLResponse">NSURLResponse</a>*)response;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.2.0, Base 1.13.0</div> <br /> <div class="desc"> Called when a <var>response</var> is received. <br /> Multiple responses may be received on the same <var>download</var> (eg with server push) and the delegate should be prepared to treat each separately. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSURLDownloadDelegate)-download$shouldDecodeSourceDataOfMIMEType$">download: shouldDecodeSourceDataOfMIMEType: </a></h3> - (BOOL) <b>download:</b> (<a rel="gsdoc" href="#class$NSURLDownload">NSURLDownload</a>*)download<b> shouldDecodeSourceDataOfMIMEType:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)encodingType;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.2.0, Base 1.13.0</div> <br /> <div class="desc"> Called if the <var>download</var> file is encoded... the delegate should return <code>YES</code> if the downloaded data is to be decoded, <code>NO</code> otherwise. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSURLDownloadDelegate)-download$willResumeWithResponse$fromByte$">download: willResumeWithResponse: fromByte: </a></h3> - (void) <b>download:</b> (<a rel="gsdoc" href="#class$NSURLDownload">NSURLDownload</a>*)download<b> willResumeWithResponse:</b> (<a rel="gsdoc" href="NSURLResponse.html#class$NSURLResponse">NSURLResponse</a>*)response<b> fromByte:</b> (long long)startingByte;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.2.0, Base 1.13.0</div> <br /> <div class="desc"> Called when a <var>download</var> is resuming from previously stored data and a <var>response</var> has been received from the server. <br /> The startingBytes is the offset from which the downloaded data will actually commence... and may be zero if the entire <var>download</var> must be redone. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSURLDownloadDelegate)-download$willSendRequest$redirectResponse$">download: willSendRequest: redirectResponse: </a></h3> - (<a rel="gsdoc" href="NSURLRequest.html#class$NSURLRequest">NSURLRequest</a>*) <b>download:</b> (<a rel="gsdoc" href="#class$NSURLDownload">NSURLDownload</a>*)download<b> willSendRequest:</b> (<a rel="gsdoc" href="NSURLRequest.html#class$NSURLRequest">NSURLRequest</a>*)request<b> redirectResponse:</b> (<a rel="gsdoc" href="NSURLResponse.html#class$NSURLResponse">NSURLResponse</a>*)redirectResponse;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.2.0, Base 1.13.0</div> <br /> <div class="desc"> Called if a new <var>request</var> has to be sent due to redirection. <br /> Must return the <var>request</var> argument (or a modified copy of it) to have the process continue. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSURLDownloadDelegate)-downloadDidFinish$">downloadDidFinish: </a></h3> - (void) <b>downloadDidFinish:</b> (<a rel="gsdoc" href="#class$NSURLDownload">NSURLDownload</a>*)download;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.2.0, Base 1.13.0</div> <br /> <div class="desc"> Called when the <var>download</var> completes after having received all data. </div> <hr width="25%" align="left" /> </div> <h1><a name="003000000000"> Software documentation for the NSURLDownloadDelegate protocol </a></h1> <h2><a name="protocol$(NSURLDownloadDelegate)">NSURLDownloadDelegate</a></h2> <blockquote class="declared"> <dl> <dt><b>Declared in:</b></dt> <dd>Foundation/NSURLDownload.h</dd> </dl> </blockquote> <blockquote> <dl> <dt><b>Conforms to:</b></dt> <dd><a rel="gsdoc" href="NSObject.html#protocol$(NSObject)">NSObject</a></dd> </dl> </blockquote> <div class="availability"> <b>Availability:</b> MacOS-X 10.7.0, Base 1.13.0</div> <br /> <div class="desc"> <em>Description forthcoming.</em> </div> <br /> <a href="Base.html">Up</a> </font> </body> </html>