FIRStorageUploadTask_Private.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright 2017 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. @class GTMSessionUploadFetcher;
  17. NS_ASSUME_NONNULL_BEGIN
  18. @interface FIRStorageUploadTask ()
  19. /**
  20. * The data to be uploaded (if uploading bytes).
  21. */
  22. @property(readonly, copy, nonatomic, nullable) NSData *uploadData;
  23. /**
  24. * The name of a file on disk to be uploaded (if uploading from a file).
  25. */
  26. @property(readonly, copy, nonatomic, nullable) NSURL *fileURL;
  27. /**
  28. * The FIRStorageMetadata about the object being uploaded.
  29. */
  30. @property(readonly, copy, nonatomic) FIRStorageMetadata *uploadMetadata;
  31. /**
  32. * GTMSessionUploadFetcher used by all uploads.
  33. */
  34. @property(strong, atomic) GTMSessionUploadFetcher *uploadFetcher;
  35. /**
  36. * Initializes an upload task with a base FIRStorageReference and GTMSessionFetcherService.
  37. * @param reference The base FIRStorageReference which fetchers use for configuration.
  38. * @param service The GTMSessionFetcherService which will create fetchers.
  39. * @param queue The shared queue to use for all Storage operations.
  40. * @param uploadData The NSData object to be uploaded.
  41. * @return Returns an instance of FIRStorageUploadTask.
  42. */
  43. - (instancetype)initWithReference:(FIRStorageReference *)reference
  44. fetcherService:(GTMSessionFetcherService *)service
  45. dispatchQueue:(dispatch_queue_t)queue
  46. data:(NSData *)uploadData
  47. metadata:(FIRStorageMetadata *)metadata;
  48. /**
  49. * Initializes an upload task with a base FIRStorageReference and GTMSessionFetcherService.
  50. * @param reference The base FIRStorageReference which fetchers use for configuration.
  51. * @param service The GTMSessionFetcherService which will create fetchers.
  52. * @param queue The shared queue to use for all Storage operations.
  53. * @param fileURL The system file URL to upload from.
  54. * @return Returns an instance of FIRStorageUploadTask.
  55. */
  56. - (instancetype)initWithReference:(FIRStorageReference *)reference
  57. fetcherService:(GTMSessionFetcherService *)service
  58. dispatchQueue:(dispatch_queue_t)queue
  59. file:(NSURL *)fileURL
  60. metadata:(FIRStorageMetadata *)metadata;
  61. @end
  62. NS_ASSUME_NONNULL_END