Important: The information in this document is obsolete and should not be used for new development.
CyberDownloadExtension
The
- Superclasses
CyberExtension --> ODExtension --> ODRefCntObject --> ODObject
- Subclasses
- none
CyberDownloadExtension
class defines extra behaviors for a part that is to be used as a download part.Description
TheCyberDownloadExtension
class is an extension that allows a part to be used as a download part, which downloads content referenced by a Cyberdog item to disk. A Cyberdog download part has two extensions: aCyberDownloadExtension
subclass extension and aCyberPartExtension
subclass extension.
CyberDownloadExtension
is an abstract superclass that you must subclass and implement to create your own customized download part. Cyberdog provides a fully implemented download part; to use this download part, you do not need to subclass this class.The download part is used in several situations, such as the following:
The
- When the user drags a Cyberdog item from a display part (a Gopher display part, for example) and drops it in the Finder. In this case, the display part can create a download part and call its
CyberDownloadExtension
methods to download to disk the data referenced by the Cyberdog item. Optionally, the download part can display progress using its own window.- When the user opens a Cyberdog item (by clicking on an HTML link, for example). In this case, if the Cyberdog item cannot find a Cyberdog display part editor to bind to, the Cyberdog item can create a download part and call the download part's
OpenCyberItem
method. The download part downloads the data to disk, obtains an opener part, and calls the opener part'sOpenFile
method to open the file created during the download. The download part displays progress in the opener part.- When the user selects several Cyberdog items and then chooses the Get Items from Server command from either the Gopher or FTP menu. In this case, Cyberdog creates a single download part to download and save to disk the content referenced by all the selected Cyberdog items.
CyberDownloadExtension
interface provides two different methods for queuing requests to download the content referenced by a Cyberdog item and save it to a file:DownloadCyberItem
andPostDownloadRequest
. Both methods add a request to download data to the download part's queue. You initiate pending download requests by callingStartDownloads
.The
DownloadCyberItem
method is the simplest method to use; when you call it, you pass the Cyberdog item and the specification of the destination file. ThePostDownloadRequest
method allows you to register a function that Cyberdog can call to notify you when the download is complete. In addition, thePostDownloadRequest
method allows you to specify whether you want the downloaded file to be decompressed before it is saved.The download part requests and uses a Cyberdog item's associated stream to download the Cyberdog item. When the download part is finished processing its download requests, it destroys itself.
Methods
This section presents summary descriptions of theCyberDownloadExtension
methods grouped according to purpose, followed by detailed descriptions.Requesting a Download
Initiating a Download Request
CancelRequest
- Cancels a request to download data to disk.
DownloadCyberItem
- Requests the download of data referenced by a Cyberdog item to disk.
PostDownloadRequest
- Requests the download of data referenced by Cyberdog item to disk and registers a completion notification function.
StartDownloads
- Initiates the download requests queued for a download part.
Methods
- CancelRequest
- DownloadCyberItem
- PostDownloadRequest
- StartDownloads