Contents
Navigation
Home User Reference Other Resources


The QTPlgFile class is an utility class that provides you with a few useful facilities to deal with files using the capabilities of the QuickTime data handlers; using this class you can:

  • copy or download (if the data source refers to a network URL) files asynchronously
  • compress and decompress files synchronously
  • create alias to file or internet shortcut (if the data source refers to a network URL)







The QTPlgFile class constructors are called when you create a new instance of the class, while the ˜QTPlgFile class destructor, is called automatically when the class is no more in use. Also, you can invoke the class destructor by setting the instance of the class to nil.
Once a new class instance is returned, it is good practice to check the class property to be sure that the new object can be used. A QTPlgFile object is valid if a valid has been assigned to it. Though, when creating an instance of this class by using the , the data source has not been yet assigned and the class property returns false, it is lecit to continue to use the class. Anyway, using the new class instance makes sense only if you have set some data source to act upon.

The class implements the following initializer methods:
()
This is the default constructor. The data source is initialized to nil; you can use the class property to set up a valid data source
(other as QTPlgFile)
This is the copy constructor. The properties of the object to be copied will be used to initialize the new class instance properties
(dataRef as )
this constructor version tries to initialize the new class instance with the file found at the location specified by the dataRef parameter. This constructor accepts objects that specify only. If no location has been found no will be set and the new class instance will be

specifies the location of data; you can use objects that specify only
specifies your custom progress callback. If this property is set to a instance of the class, it will be invoked anytime you perform an asynchronous task
specifies if the class instance is performing an asynchronous task
specifies the dimensions, in bytes, of the temporary buffer allocated to perform a specific task. At time you can not change the default dimensions assigned to this buffer
specifies the remaining bytes to copy during an asynchronous copy. If you have not installed a custom , you can find this property useful to give some feedback to the user about the progress of the operation at work
specifies how many bytes have been already copied during an asynchronous copy. If you have not installed a custom , you can find this property useful to give some feedback to the user about the progress of the operation at work
indicates how far the copy has progressed. Its value ranges between 0.0 and 1.0. If you have not installed a custom , you can find this property useful to give some feedback to the user about the progress of the operation at work

(dst as folderitem)
use this method to create an alias file, specified by the dst parameter, of the the data reference source specified by the class property. If the data reference source is a url reference, then this method will create an internet shortcut file instead
returns nothing. Check the class property for errors
available on Macintosh platform only
(dst as folderitem, creator as string, type as string)
using this method, all of the data stored into the source specified by the class property will be compressed synchronously and written to the folderitem specified by the dst parameter; if the destination does already exist then it will be deleted and created ex novo. The destination folderitem will be marked with the creator and type parameters; if you do not need to use file type and cretor codes, pass an empty string for these parameters. Other than compressed data this method will store information about the original file that will be used during the ; the method will register the following informations:
  • file extension
  • file type
  • file creator
returns nothing. Check the class property for errors
All of the data are stored in a cross–platform format
(dst as folderitem)
use this method to decompress synchronously the data compressed with the class method and stored into the data reference source specified by the class property. This method writes the uncompressed data into the folderitem specified by the dst parameter; if the destination does already exist then it will be deleted and created ex novo. This method will restore the original file informations registered during the task
returns nothing. Check the class property for errors
(dst as folderitem, creator as string, type as string)
use this method to begin the asynchronous copy of the data at the location specified by the class property to the folderitem specified by the dst parameter; if the destination does already exist then it will be deleted and created ex novo. The destination folderitem will be marked with the creator and type parameters; if you do not need to use file type and cretor codes, pass an empty string for these parameters
returns nothing. Check the class property for errors
[Deprecated]: since version 6.0 of the plugin this method is deprecated and will be removed from a future plugin version; to perform asynchronous copy of data use the plugin class instead
()
by this method you ensure processing time to the currently asynchronous running process, if any; otherwise this method has no effect
returns nothing. Check the class property for errors
[Deprecated]: since version 6.0 of the plugin this method is deprecated and will be removed from a future plugin version; to perform asynchronous copy of data use the plugin class instead
()
use this method to kill the currently asynchronous running process, if any, and delete the destination folderitem created by the process; otherwise this method has no effect
returns nothing. Check the class property for errors
[Deprecated]: since version 6.0 of the plugin this method is deprecated and will be removed from a future plugin version; to perform asynchronous copy of data use the plugin class instead