files.com 1.1.812 → 1.1.814
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/_VERSION +1 -1
- data/doc/Files/APIConnectionError.html +1 -1
- data/doc/Files/APIError.html +1 -1
- data/doc/Files/AccountAlreadyExistsError.html +1 -1
- data/doc/Files/AccountLineItem.html +1 -1
- data/doc/Files/AccountOverdueError.html +1 -1
- data/doc/Files/Action.html +1 -1
- data/doc/Files/ActionLog.html +1 -1
- data/doc/Files/ActionNotificationExport.html +1 -1
- data/doc/Files/ActionNotificationExportResult.html +1 -1
- data/doc/Files/AdditionalAuthenticationRequiredError.html +1 -1
- data/doc/Files/AgentNode.html +1 -1
- data/doc/Files/AgentNodeConnection.html +1 -1
- data/doc/Files/AgentNodeInstance.html +1 -1
- data/doc/Files/AgentPushUpdate.html +1 -1
- data/doc/Files/AgentPushUpdateBlockedError.html +1 -1
- data/doc/Files/AgentUnavailableError.html +1 -1
- data/doc/Files/AgentUpgradeRequiredError.html +1 -1
- data/doc/Files/AiAssistantPersonality.html +1 -1
- data/doc/Files/AiTask.html +1 -1
- data/doc/Files/AiTaskCannotBeRunManuallyError.html +1 -1
- data/doc/Files/AlreadyCompletedError.html +1 -1
- data/doc/Files/Api.html +20 -13
- data/doc/Files/ApiClient/RequestLogContext.html +29 -29
- data/doc/Files/ApiClient/TransferSettings.html +721 -0
- data/doc/Files/ApiClient.html +756 -204
- data/doc/Files/ApiKey.html +1 -1
- data/doc/Files/ApiKeyIsDisabledError.html +1 -1
- data/doc/Files/ApiKeyIsPathRestrictedError.html +1 -1
- data/doc/Files/ApiKeyNotFoundError.html +1 -1
- data/doc/Files/ApiKeyOnlyForDesktopAppError.html +1 -1
- data/doc/Files/ApiKeyOnlyForFileOperationsError.html +1 -1
- data/doc/Files/ApiKeyOnlyForMobileAppError.html +1 -1
- data/doc/Files/ApiKeyOnlyForOfficeIntegrationError.html +1 -1
- data/doc/Files/ApiKeySessionsNotSupportedError.html +1 -1
- data/doc/Files/ApiRequestLog.html +1 -1
- data/doc/Files/App.html +1 -1
- data/doc/Files/As2IncomingMessage.html +1 -1
- data/doc/Files/As2OutgoingMessage.html +1 -1
- data/doc/Files/As2Partner.html +1 -1
- data/doc/Files/As2Station.html +1 -1
- data/doc/Files/AttachmentTooLargeError.html +1 -1
- data/doc/Files/AuthenticationError.html +1 -1
- data/doc/Files/AuthenticationRequiredError.html +1 -1
- data/doc/Files/Auto.html +1 -1
- data/doc/Files/Automation.html +1 -1
- data/doc/Files/AutomationAuthoringSchema.html +1 -1
- data/doc/Files/AutomationCannotBeRunManuallyError.html +1 -1
- data/doc/Files/AutomationExecutionNode.html +1 -1
- data/doc/Files/AutomationLog.html +1 -1
- data/doc/Files/AutomationRun.html +1 -1
- data/doc/Files/AutomationsUnavailableError.html +1 -1
- data/doc/Files/BadRequestError.html +1 -1
- data/doc/Files/BandwidthSnapshot.html +1 -1
- data/doc/Files/Behavior.html +1 -1
- data/doc/Files/BehaviorNotAllowedOnRemoteServerError.html +1 -1
- data/doc/Files/BillingInformationHiddenError.html +1 -1
- data/doc/Files/BillingPermissionRequiredError.html +1 -1
- data/doc/Files/BufferedUploadDisabledForThisDestinationError.html +1 -1
- data/doc/Files/Bundle.html +1 -1
- data/doc/Files/BundleAction.html +1 -1
- data/doc/Files/BundleDownload.html +1 -1
- data/doc/Files/BundleMaximumUsesReachedError.html +1 -1
- data/doc/Files/BundleNotification.html +1 -1
- data/doc/Files/BundleOnlyAllowsPreviewsError.html +1 -1
- data/doc/Files/BundleOperationRequiresSubfolderError.html +1 -1
- data/doc/Files/BundlePath.html +1 -1
- data/doc/Files/BundlePathNotFoundError.html +1 -1
- data/doc/Files/BundlePermissionRequiredError.html +1 -1
- data/doc/Files/BundleRecipient.html +1 -1
- data/doc/Files/BundleRegistration.html +1 -1
- data/doc/Files/BundleRegistrationCodeFailedError.html +1 -1
- data/doc/Files/BundleRegistrationNotFoundError.html +1 -1
- data/doc/Files/CannotAdministerHigherLevelUserError.html +1 -1
- data/doc/Files/CannotDownloadDirectoryError.html +1 -1
- data/doc/Files/CannotLoginWhileUsingKeyError.html +1 -1
- data/doc/Files/CantActForOtherUserError.html +1 -1
- data/doc/Files/CantMoveWithMultipleLocationsError.html +1 -1
- data/doc/Files/ChatMessage.html +1 -1
- data/doc/Files/ChatSession.html +1 -1
- data/doc/Files/ChildSiteManagementPolicy.html +1 -1
- data/doc/Files/Clickwrap.html +1 -1
- data/doc/Files/CodeNotFoundError.html +1 -1
- data/doc/Files/ConfigurationLockedPathError.html +1 -1
- data/doc/Files/ContactAdminForPasswordChangeHelpError.html +1 -1
- data/doc/Files/CouldNotCreateParentError.html +1 -1
- data/doc/Files/CustomDomain.html +1 -1
- data/doc/Files/DatetimeParseError.html +1 -1
- data/doc/Files/DesktopConfigurationProfile.html +1 -1
- data/doc/Files/DestinationExistsError.html +1 -1
- data/doc/Files/DestinationFolderLimitedError.html +1 -1
- data/doc/Files/DestinationParentConflictError.html +1 -1
- data/doc/Files/DestinationParentDoesNotExistError.html +1 -1
- data/doc/Files/DestinationSameError.html +1 -1
- data/doc/Files/DestinationSiteMismatchError.html +1 -1
- data/doc/Files/DirectConnectionInfo.html +1 -1
- data/doc/Files/DnsRecord.html +1 -1
- data/doc/Files/DoesNotSupportSortingError.html +1 -1
- data/doc/Files/DuplicateShareRecipientError.html +1 -1
- data/doc/Files/EmailIncomingMessage.html +1 -1
- data/doc/Files/EmailLog.html +1 -1
- data/doc/Files/Error.html +2 -2
- data/doc/Files/Errors.html +1 -1
- data/doc/Files/EventChannel.html +1 -1
- data/doc/Files/EventDeliveryAttempt.html +1 -1
- data/doc/Files/EventRecord.html +1 -1
- data/doc/Files/EventSubscription.html +1 -1
- data/doc/Files/EventTarget.html +1 -1
- data/doc/Files/ExavaultApiRequestLog.html +1 -1
- data/doc/Files/ExceededRuntimeLimitError.html +1 -1
- data/doc/Files/Expectation.html +1 -1
- data/doc/Files/ExpectationAlreadyHasOpenWindowError.html +1 -1
- data/doc/Files/ExpectationEvaluation.html +1 -1
- data/doc/Files/ExpectationIncident.html +1 -1
- data/doc/Files/ExpectationNotManualTriggerError.html +1 -1
- data/doc/Files/ExpiredPrivateKeyError.html +1 -1
- data/doc/Files/ExpiredPublicKeyError.html +1 -1
- data/doc/Files/ExportFailureError.html +1 -1
- data/doc/Files/ExportNotReadyError.html +1 -1
- data/doc/Files/ExternalEvent.html +1 -1
- data/doc/Files/FailedToChangePasswordError.html +1 -1
- data/doc/Files/File.html +2019 -1515
- data/doc/Files/FileAction.html +1 -1
- data/doc/Files/FileActionError.html +1 -1
- data/doc/Files/FileComment.html +1 -1
- data/doc/Files/FileCommentReaction.html +1 -1
- data/doc/Files/FileLockedError.html +1 -1
- data/doc/Files/FileMigration.html +1 -1
- data/doc/Files/FileMigrationLog.html +1 -1
- data/doc/Files/FileNotFoundError.html +1 -1
- data/doc/Files/FileNotUploadedError.html +1 -1
- data/doc/Files/FilePendingProcessingError.html +1 -1
- data/doc/Files/FileProcessingErrorError.html +1 -1
- data/doc/Files/FileTooBigToDecryptError.html +1 -1
- data/doc/Files/FileTooBigToEncryptError.html +1 -1
- data/doc/Files/FileUploadNotFoundError.html +1 -1
- data/doc/Files/FileUploadPart.html +1 -1
- data/doc/Files/FileUploadedToWrongRegionError.html +1 -1
- data/doc/Files/FileUtils.html +1 -1
- data/doc/Files/FilenameTooLongError.html +1 -1
- data/doc/Files/FilesAgentFailedAuthorizationError.html +1 -1
- data/doc/Files/FilesNativeStorageOverloadedError.html +1 -1
- data/doc/Files/Folder.html +1 -1
- data/doc/Files/FolderAdminOrBillingPermissionRequiredError.html +1 -1
- data/doc/Files/FolderAdminPermissionRequiredError.html +1 -1
- data/doc/Files/FolderLockedError.html +1 -1
- data/doc/Files/FolderMustNotBeAFileError.html +1 -1
- data/doc/Files/FolderNotEmptyError.html +1 -1
- data/doc/Files/FoldersNotAllowedError.html +1 -1
- data/doc/Files/FormField.html +1 -1
- data/doc/Files/FormFieldSet.html +1 -1
- data/doc/Files/FtpActionLog.html +1 -1
- data/doc/Files/FullPermissionRequiredError.html +1 -1
- data/doc/Files/GpgKey.html +1 -1
- data/doc/Files/Group.html +1 -1
- data/doc/Files/GroupNotFoundError.html +1 -1
- data/doc/Files/GroupUser.html +1 -1
- data/doc/Files/History.html +1 -1
- data/doc/Files/HistoryExport.html +1 -1
- data/doc/Files/HistoryExportResult.html +1 -1
- data/doc/Files/HistoryPermissionRequiredError.html +1 -1
- data/doc/Files/HistoryUnavailableError.html +1 -1
- data/doc/Files/HolidayCalendar.html +1 -1
- data/doc/Files/HolidayRegion.html +1 -1
- data/doc/Files/Image.html +1 -1
- data/doc/Files/InAppAiAssistantUnavailableError.html +1 -1
- data/doc/Files/InboundS3Log.html +1 -1
- data/doc/Files/InboxNotFoundError.html +1 -1
- data/doc/Files/InboxRecipient.html +1 -1
- data/doc/Files/InboxRegistration.html +1 -1
- data/doc/Files/InboxRegistrationCodeFailedError.html +1 -1
- data/doc/Files/InboxUpload.html +1 -1
- data/doc/Files/InsufficientPermissionForParamsError.html +1 -1
- data/doc/Files/InsufficientPermissionForSiteError.html +1 -1
- data/doc/Files/IntegrationCentricProfile.html +1 -1
- data/doc/Files/InternalGeneralErrorError.html +1 -1
- data/doc/Files/InvalidBodyError.html +1 -1
- data/doc/Files/InvalidBundleCodeError.html +1 -1
- data/doc/Files/InvalidCredentialsError.html +1 -1
- data/doc/Files/InvalidCursorError.html +1 -1
- data/doc/Files/InvalidCursorTypeForSortError.html +1 -1
- data/doc/Files/InvalidEtagsError.html +1 -1
- data/doc/Files/InvalidFileTypeError.html +1 -1
- data/doc/Files/InvalidFilenameError.html +1 -1
- data/doc/Files/InvalidFilterAliasCombinationError.html +1 -1
- data/doc/Files/InvalidFilterFieldError.html +1 -1
- data/doc/Files/InvalidFilterParamError.html +1 -1
- data/doc/Files/InvalidFilterParamFormatError.html +1 -1
- data/doc/Files/InvalidFilterParamValueError.html +1 -1
- data/doc/Files/InvalidInputEncodingError.html +1 -1
- data/doc/Files/InvalidInterfaceError.html +1 -1
- data/doc/Files/InvalidOauthError.html +1 -1
- data/doc/Files/InvalidOauthProviderError.html +1 -1
- data/doc/Files/InvalidOrExpiredCodeError.html +1 -1
- data/doc/Files/InvalidParameterError.html +5 -1
- data/doc/Files/InvalidPathError.html +1 -1
- data/doc/Files/InvalidPriorityColorError.html +1 -1
- data/doc/Files/InvalidRangeError.html +1 -1
- data/doc/Files/InvalidReturnToUrlError.html +1 -1
- data/doc/Files/InvalidSearchQueryError.html +1 -1
- data/doc/Files/InvalidSessionError.html +1 -1
- data/doc/Files/InvalidSiteError.html +1 -1
- data/doc/Files/InvalidSortFieldError.html +1 -1
- data/doc/Files/InvalidSortFilterCombinationError.html +1 -1
- data/doc/Files/InvalidUploadOffsetError.html +1 -1
- data/doc/Files/InvalidUploadPartGapError.html +1 -1
- data/doc/Files/InvalidUploadPartSizeError.html +1 -1
- data/doc/Files/InvalidUsernameOrPasswordError.html +1 -1
- data/doc/Files/InvalidWorkspaceIdHeaderError.html +1 -1
- data/doc/Files/InvalidZipFileError.html +1 -1
- data/doc/Files/Invoice.html +1 -1
- data/doc/Files/InvoiceLineItem.html +1 -1
- data/doc/Files/IpAddress.html +1 -1
- data/doc/Files/KeyLifecycleRule.html +1 -1
- data/doc/Files/List.html +1 -1
- data/doc/Files/Lock.html +1 -1
- data/doc/Files/LockOperationBusyError.html +1 -1
- data/doc/Files/LockedOutError.html +1 -1
- data/doc/Files/LockoutRegionMismatchError.html +1 -1
- data/doc/Files/MetadataCategory.html +1 -1
- data/doc/Files/MetadataNotSupportedOnRemotesError.html +1 -1
- data/doc/Files/MethodNotAllowedError.html +1 -1
- data/doc/Files/MigrationInProgressError.html +1 -1
- data/doc/Files/MissingParameterError.html +1 -1
- data/doc/Files/ModelSaveErrorError.html +1 -1
- data/doc/Files/MoverAccessDeniedError.html +1 -1
- data/doc/Files/MoverPackageRequiredError.html +1 -1
- data/doc/Files/MultipleProcessingErrorsError.html +1 -1
- data/doc/Files/MultipleSortParamsNotAllowedError.html +1 -1
- data/doc/Files/MustAuthenticateWithApiKeyError.html +1 -1
- data/doc/Files/NeedAdminPermissionForInboxError.html +1 -1
- data/doc/Files/NestedNotFoundError.html +1 -1
- data/doc/Files/NoAccountForSiteError.html +1 -1
- data/doc/Files/NoValidInputParamsError.html +1 -1
- data/doc/Files/NonAdminsMustQueryByFolderOrPathError.html +1 -1
- data/doc/Files/NotAllowedToCreateBundleError.html +1 -1
- data/doc/Files/NotAuthenticatedError.html +1 -1
- data/doc/Files/NotAuthorizedError.html +1 -1
- data/doc/Files/NotEnqueuableSyncError.html +1 -1
- data/doc/Files/NotFoundError.html +1 -1
- data/doc/Files/NotImplementedError.html +1 -1
- data/doc/Files/Notification.html +1 -1
- data/doc/Files/OffsetUploadNotAllowedWithMalwareScanningError.html +1 -1
- data/doc/Files/OneTimePasswordIncorrectError.html +1 -1
- data/doc/Files/OutboundConnectionLog.html +1 -1
- data/doc/Files/PartNumberTooLargeError.html +1 -1
- data/doc/Files/Partner.html +1 -1
- data/doc/Files/PartnerChannel.html +1 -1
- data/doc/Files/PartnerChannelTemplate.html +1 -1
- data/doc/Files/PartnerConnection.html +1 -1
- data/doc/Files/PartnerSite.html +1 -1
- data/doc/Files/PartnerSiteRequest.html +1 -1
- data/doc/Files/PasswordChangeNotRequiredError.html +1 -1
- data/doc/Files/PasswordChangeRequiredError.html +1 -1
- data/doc/Files/PathCannotHaveTrailingWhitespaceError.html +1 -1
- data/doc/Files/PathTooLongError.html +1 -1
- data/doc/Files/PathUtil.html +1 -1
- data/doc/Files/Payment.html +1 -1
- data/doc/Files/PaymentLineItem.html +1 -1
- data/doc/Files/PaymentMethodErrorError.html +1 -1
- data/doc/Files/PendingWorkEvent.html +1 -1
- data/doc/Files/Permission.html +1 -1
- data/doc/Files/PlanNotFoundError.html +1 -1
- data/doc/Files/Preview.html +1 -1
- data/doc/Files/PreviewOnlyPermissionCannotDownloadError.html +1 -1
- data/doc/Files/ProcessingFailureError.html +1 -1
- data/doc/Files/PublicHostingRequestLog.html +1 -1
- data/doc/Files/PublicIpAddress.html +1 -1
- data/doc/Files/PublicKey.html +1 -1
- data/doc/Files/RateLimitedError.html +1 -1
- data/doc/Files/ReadOnlySessionError.html +1 -1
- data/doc/Files/ReadPermissionRequiredError.html +1 -1
- data/doc/Files/ReauthenticationFailedError.html +1 -1
- data/doc/Files/ReauthenticationFailedFinalError.html +1 -1
- data/doc/Files/ReauthenticationNeededActionError.html +1 -1
- data/doc/Files/ReauthenticationNeededFieldsError.html +1 -1
- data/doc/Files/ReauthenticationRateLimitedError.html +1 -1
- data/doc/Files/RecaptchaFailedError.html +1 -1
- data/doc/Files/RecipientAlreadySharedError.html +1 -1
- data/doc/Files/RemoteBandwidthSnapshot.html +1 -1
- data/doc/Files/RemoteDesktopDebugLoggingDisabledError.html +1 -1
- data/doc/Files/RemoteEntryReadOnlyError.html +1 -1
- data/doc/Files/RemoteMountBackend.html +1 -1
- data/doc/Files/RemoteServer.html +1 -1
- data/doc/Files/RemoteServerConfigurationFile.html +1 -1
- data/doc/Files/RemoteServerCredential.html +1 -1
- data/doc/Files/RemoteServerErrorError.html +1 -1
- data/doc/Files/Request.html +1 -1
- data/doc/Files/RequestBodyTooLargeError.html +1 -1
- data/doc/Files/RequestParamsContainInvalidCharacterError.html +1 -1
- data/doc/Files/RequestParamsInvalidError.html +1 -1
- data/doc/Files/RequestParamsRequiredError.html +1 -1
- data/doc/Files/ResourceBelongsToParentSiteError.html +1 -1
- data/doc/Files/ResourceLockedError.html +1 -1
- data/doc/Files/Response.html +1 -1
- data/doc/Files/Restore.html +1 -1
- data/doc/Files/RootFolderBehaviorSiteAdminRequiredError.html +1 -1
- data/doc/Files/RootFolderBehaviorSkipSiteAdminRequiredError.html +1 -1
- data/doc/Files/Schedule.html +1 -1
- data/doc/Files/ScheduledExport.html +1 -1
- data/doc/Files/ScimLog.html +1 -1
- data/doc/Files/SearchAllOnChildPathError.html +1 -1
- data/doc/Files/SearchUnavailableError.html +1 -1
- data/doc/Files/Secret.html +1 -1
- data/doc/Files/SelfManagedRequiredError.html +1 -1
- data/doc/Files/ServiceUnavailableError.html +1 -1
- data/doc/Files/Session.html +1 -1
- data/doc/Files/SettingsChange.html +1 -1
- data/doc/Files/SftpActionLog.html +1 -1
- data/doc/Files/SftpHostKey.html +1 -1
- data/doc/Files/ShareGroup.html +1 -1
- data/doc/Files/ShareGroupMember.html +1 -1
- data/doc/Files/SiemHttpDestination.html +1 -1
- data/doc/Files/SiemHttpDestinationEvent.html +1 -1
- data/doc/Files/Site.html +1 -1
- data/doc/Files/SiteAdminOrPartnerAdminPermissionRequiredError.html +1 -1
- data/doc/Files/SiteAdminOrWorkspaceAdminOrFolderAdminPermissionRequiredError.html +1 -1
- data/doc/Files/SiteAdminOrWorkspaceAdminOrPartnerAdminOrFolderAdminPermissionRequiredError.html +1 -1
- data/doc/Files/SiteAdminOrWorkspaceAdminOrPartnerAdminPermissionRequiredError.html +1 -1
- data/doc/Files/SiteAdminOrWorkspaceAdminPermissionRequiredError.html +1 -1
- data/doc/Files/SiteAdminRequiredError.html +1 -1
- data/doc/Files/SiteConfigurationError.html +1 -1
- data/doc/Files/SiteDisabledError.html +1 -1
- data/doc/Files/SiteFilesAreImmutableError.html +1 -1
- data/doc/Files/SiteNotFoundError.html +1 -1
- data/doc/Files/SiteSubdomainRedirect.html +1 -1
- data/doc/Files/SiteWasRemovedError.html +1 -1
- data/doc/Files/SizableIO.html +43 -41
- data/doc/Files/Snapshot.html +1 -1
- data/doc/Files/SsoEvent.html +1 -1
- data/doc/Files/SsoStrategy.html +1 -1
- data/doc/Files/Status.html +1 -1
- data/doc/Files/Style.html +1 -1
- data/doc/Files/SubfolderLockedError.html +1 -1
- data/doc/Files/Sync.html +1 -1
- data/doc/Files/SyncInProgressError.html +1 -1
- data/doc/Files/SyncLog.html +1 -1
- data/doc/Files/SyncRun.html +1 -1
- data/doc/Files/SyncRunLiveTransfer.html +1 -1
- data/doc/Files/SystemProfiler.html +1 -1
- data/doc/Files/TooManyConcurrentLoginsError.html +1 -1
- data/doc/Files/TooManyConcurrentRequestsError.html +1 -1
- data/doc/Files/TooManyLoginAttemptsError.html +1 -1
- data/doc/Files/TooManyRequestsError.html +1 -1
- data/doc/Files/TooManySharesError.html +1 -1
- data/doc/Files/Transfer/BufferLimitError.html +175 -0
- data/doc/Files/Transfer/ByteBudget/Reservation.html +301 -0
- data/doc/Files/Transfer/ByteBudget.html +748 -0
- data/doc/Files/Transfer/CancelledError.html +235 -0
- data/doc/Files/Transfer/Checkpoint.html +1371 -0
- data/doc/Files/Transfer/CheckpointError.html +173 -0
- data/doc/Files/Transfer/ClientTransport/ClientResponse.html +661 -0
- data/doc/Files/Transfer/ClientTransport/Reader.html +530 -0
- data/doc/Files/Transfer/ClientTransport.html +675 -0
- data/doc/Files/Transfer/Clock.html +189 -0
- data/doc/Files/Transfer/Control.html +667 -0
- data/doc/Files/Transfer/Controller/Attempt.html +465 -0
- data/doc/Files/Transfer/Controller.html +1166 -0
- data/doc/Files/Transfer/Coordinator/Timing.html +568 -0
- data/doc/Files/Transfer/Coordinator.html +534 -0
- data/doc/Files/Transfer/DownloadCoordinator/FileSink.html +976 -0
- data/doc/Files/Transfer/DownloadCoordinator/IoSink.html +1168 -0
- data/doc/Files/Transfer/DownloadCoordinator/Piece.html +875 -0
- data/doc/Files/Transfer/DownloadCoordinator.html +728 -0
- data/doc/Files/Transfer/FileSlots.html +480 -0
- data/doc/Files/Transfer/FrontendResponseError.html +235 -0
- data/doc/Files/Transfer/Holds.html +505 -0
- data/doc/Files/Transfer/HttpTransport.html +579 -0
- data/doc/Files/Transfer/Job.html +2338 -0
- data/doc/Files/Transfer/Options.html +924 -0
- data/doc/Files/Transfer/PausedError.html +319 -0
- data/doc/Files/Transfer/Policy.html +1642 -0
- data/doc/Files/Transfer/RequestPermits.html +160 -0
- data/doc/Files/Transfer/SourceChangedError.html +235 -0
- data/doc/Files/Transfer/StorageResponse.html +546 -0
- data/doc/Files/Transfer/StorageRetry.html +1098 -0
- data/doc/Files/Transfer/UploadCoordinator/Grant.html +1048 -0
- data/doc/Files/Transfer/UploadCoordinator/Part.html +1048 -0
- data/doc/Files/Transfer/UploadCoordinator/Region.html +295 -0
- data/doc/Files/Transfer/UploadCoordinator/Segments.html +299 -0
- data/doc/Files/Transfer/UploadCoordinator/Source.html +725 -0
- data/doc/Files/Transfer/UploadCoordinator/StreamSource.html +664 -0
- data/doc/Files/Transfer/UploadCoordinator.html +546 -0
- data/doc/Files/Transfer/UploadPlan.html +522 -0
- data/doc/Files/Transfer/VersionChangedError.html +235 -0
- data/doc/Files/Transfer.html +134 -0
- data/doc/Files/TrialExpiredError.html +1 -1
- data/doc/Files/TrialLockedError.html +1 -1
- data/doc/Files/TwoFactorAuthenticationCodeAlreadySentError.html +1 -1
- data/doc/Files/TwoFactorAuthenticationCountryBlacklistedError.html +1 -1
- data/doc/Files/TwoFactorAuthenticationErrorError.html +1 -1
- data/doc/Files/TwoFactorAuthenticationGeneralErrorError.html +1 -1
- data/doc/Files/TwoFactorAuthenticationMethodUnsupportedErrorError.html +1 -1
- data/doc/Files/TwoFactorAuthenticationRequiredError.html +1 -1
- data/doc/Files/TwoFactorAuthenticationSetupExpiredError.html +1 -1
- data/doc/Files/TwoFactorAuthenticationUnsubscribedRecipientError.html +1 -1
- data/doc/Files/URI.html +1 -1
- data/doc/Files/UnrecognizedSortIndexError.html +1 -1
- data/doc/Files/UnsupportedCurrencyError.html +1 -1
- data/doc/Files/UnsupportedHttpResponseFormatError.html +1 -1
- data/doc/Files/UnsupportedMediaTypeError.html +1 -1
- data/doc/Files/UpdatesNotAllowedForRemotesError.html +1 -1
- data/doc/Files/UploadsUnavailableError.html +1 -1
- data/doc/Files/UsageByTopLevelDir.html +1 -1
- data/doc/Files/UsageDailySnapshot.html +1 -1
- data/doc/Files/UsageSnapshot.html +1 -1
- data/doc/Files/User.html +1 -1
- data/doc/Files/UserAdditionalEmailRecipient.html +1 -1
- data/doc/Files/UserCipherUse.html +1 -1
- data/doc/Files/UserIdInvalidError.html +1 -1
- data/doc/Files/UserIdOnUserEndpointError.html +1 -1
- data/doc/Files/UserIdWithoutSiteAdminError.html +1 -1
- data/doc/Files/UserLifecycleRule.html +1 -1
- data/doc/Files/UserNotFoundError.html +1 -1
- data/doc/Files/UserRequest.html +1 -1
- data/doc/Files/UserRequestsEnabledRequiredError.html +1 -1
- data/doc/Files/UserRequiredError.html +1 -1
- data/doc/Files/UserSecurityEvent.html +1 -1
- data/doc/Files/UserSftpClientUse.html +1 -1
- data/doc/Files/Util/LogSettings.html +1 -1
- data/doc/Files/Util.html +1 -1
- data/doc/Files/WebDavActionLog.html +1 -1
- data/doc/Files/WebhookTest.html +1 -1
- data/doc/Files/Workspace.html +1 -1
- data/doc/Files/WriteAndBundlePermissionRequiredError.html +1 -1
- data/doc/Files/WritePermissionRequiredError.html +1 -1
- data/doc/Files/ZipListEntry.html +1 -1
- data/doc/Files.html +116 -116
- data/doc/_index.html +314 -4
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +1 -1
- data/doc/index.html +1 -1
- data/doc/method_list.html +4703 -2415
- data/doc/top-level-namespace.html +1 -1
- data/docs/file.md +346 -0
- data/lib/files.com/api.rb +6 -1
- data/lib/files.com/api_client.rb +220 -32
- data/lib/files.com/models/file.rb +124 -17
- data/lib/files.com/sizable_io.rb +1 -0
- data/lib/files.com/transfer/budgets.rb +123 -0
- data/lib/files.com/transfer/checkpoint.rb +113 -0
- data/lib/files.com/transfer/clock.rb +14 -0
- data/lib/files.com/transfer/controller.rb +549 -0
- data/lib/files.com/transfer/download_coordinator.rb +906 -0
- data/lib/files.com/transfer/errors.rb +100 -0
- data/lib/files.com/transfer/http_transport.rb +337 -0
- data/lib/files.com/transfer/job.rb +778 -0
- data/lib/files.com/transfer/options.rb +126 -0
- data/lib/files.com/transfer/policy.rb +91 -0
- data/lib/files.com/transfer/storage_retry.rb +169 -0
- data/lib/files.com/transfer/upload_coordinator.rb +657 -0
- data/lib/files.com/transfer/upload_plan.rb +157 -0
- data/lib/files.com.rb +13 -0
- data/spec/lib/api_client_spec.rb +125 -3
- data/spec/models/file_transfer_spec.rb +70 -4
- data/spec/support/transfer_server.rb +113 -14
- data/spec/transfer/adaptive_download_spec.rb +1102 -0
- data/spec/transfer/adaptive_upload_spec.rb +1602 -0
- data/spec/transfer/concurrency_controller_spec.rb +382 -0
- data/spec/workspace_id_spec.rb +19 -14
- metadata +59 -1
|
@@ -0,0 +1,728 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>
|
|
7
|
+
Class: Files::Transfer::DownloadCoordinator
|
|
8
|
+
|
|
9
|
+
— Documentation by YARD 0.9.45
|
|
10
|
+
|
|
11
|
+
</title>
|
|
12
|
+
|
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css">
|
|
14
|
+
|
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css">
|
|
16
|
+
|
|
17
|
+
<script type="text/javascript">
|
|
18
|
+
pathId = "Files::Transfer::DownloadCoordinator";
|
|
19
|
+
relpath = '../../';
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
|
24
|
+
|
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
</head>
|
|
29
|
+
<body>
|
|
30
|
+
<div id="main_progress" aria-hidden="true"></div>
|
|
31
|
+
|
|
32
|
+
<div class="nav_wrap">
|
|
33
|
+
<iframe id="nav" src="../../class_list.html?1"></iframe>
|
|
34
|
+
<div id="resizer"></div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div id="main" tabindex="-1">
|
|
38
|
+
<div id="header">
|
|
39
|
+
<div id="menu">
|
|
40
|
+
|
|
41
|
+
<a href="../../_index.html">Index (D)</a> »
|
|
42
|
+
<span class='title'><span class='object_link'><a href="../../Files.html" title="Files (module)">Files</a></span></span> » <span class='title'><span class='object_link'><a href="../Transfer.html" title="Files::Transfer (module)">Transfer</a></span></span>
|
|
43
|
+
»
|
|
44
|
+
<span class="title">DownloadCoordinator</span>
|
|
45
|
+
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<div id="search">
|
|
49
|
+
|
|
50
|
+
<a class="full_list_link" id="class_list_link"
|
|
51
|
+
href="../../class_list.html">
|
|
52
|
+
|
|
53
|
+
<svg width="24" height="24">
|
|
54
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
|
55
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
|
56
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
|
57
|
+
</svg>
|
|
58
|
+
</a>
|
|
59
|
+
|
|
60
|
+
</div>
|
|
61
|
+
<div class="clear"></div>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<div id="content"><h1>Class: Files::Transfer::DownloadCoordinator
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
</h1>
|
|
69
|
+
<div class="box_info">
|
|
70
|
+
|
|
71
|
+
<dl>
|
|
72
|
+
<dt>Inherits:</dt>
|
|
73
|
+
<dd>
|
|
74
|
+
<span class="inheritName"><span class='object_link'><a href="Coordinator.html" title="Files::Transfer::Coordinator (class)">Coordinator</a></span></span>
|
|
75
|
+
|
|
76
|
+
<ul class="fullTree">
|
|
77
|
+
<li>Object</li>
|
|
78
|
+
|
|
79
|
+
<li class="next"><span class='object_link'><a href="Coordinator.html" title="Files::Transfer::Coordinator (class)">Coordinator</a></span></li>
|
|
80
|
+
|
|
81
|
+
<li class="next">Files::Transfer::DownloadCoordinator</li>
|
|
82
|
+
|
|
83
|
+
</ul>
|
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
|
85
|
+
|
|
86
|
+
</dd>
|
|
87
|
+
</dl>
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
<dl>
|
|
100
|
+
<dt>Defined in:</dt>
|
|
101
|
+
<dd>lib/files.com/transfer/download_coordinator.rb
|
|
102
|
+
</dd>
|
|
103
|
+
</dl>
|
|
104
|
+
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<h2>Overview</h2><div class="docstring">
|
|
108
|
+
<div class="discussion">
|
|
109
|
+
<p>Downloads one remote file through a Job, in ranges fetched concurrently when storage binds a version.</p>
|
|
110
|
+
<p>Its API requests, the download URL's lookup and its renewals, use the context the caller's thread fixed from the
|
|
111
|
+
record's options as the download began (Coordinator.api_context), carried on as a lookup moves to a regional
|
|
112
|
+
origin. Its content requests go through ApiClient.download_client as the caller's thread resolves it when the
|
|
113
|
+
download begins: over the job's own connections when that client is the SDK's own with its default connection
|
|
114
|
+
unchanged, otherwise through the client itself, one request at a time, its responses streamed (see
|
|
115
|
+
ClientTransport); a client whose adapter cannot stream is refused before anything is requested or written. On the
|
|
116
|
+
caller's thread it first asks for the opening range (8 MiB, or a quarter of buffer_bytes when that is less) with
|
|
117
|
+
Accept-Encoding: identity. A 206 with a strong ETag and an exact Content-Range and Content-Length binds the
|
|
118
|
+
download to that version: every later range is requested with If-Match and must come back as a 206 with the
|
|
119
|
+
exact Content-Range, total, length and ETag, and a 412, or a whole response with any other ETag, stops it with
|
|
120
|
+
VersionChangedError before anything of it is written. Ranges complete in any order, each read straight into one
|
|
121
|
+
String of its length, wait in memory within buffer_bytes, and are written to the destination in order on the
|
|
122
|
+
caller's thread, which progress, when given, is then called on. A range is on the network, for its controller,
|
|
123
|
+
until its whole body has arrived and been checked. Every request, the opening one and a proof included, waits
|
|
124
|
+
while a throttle's Retry-After holds its destination back for the job (Holds), and publishes one it gets before
|
|
125
|
+
its request permit is given back. A range goes to the URL it was admitted for, even once that has been renewed,
|
|
126
|
+
and a 403 for it is judged by that URL's own expiry.</p>
|
|
127
|
+
<p>Without a strong ETag, storage's whole response is streamed instead, as one request. A retry of it starts again
|
|
128
|
+
from the first byte: the destination, a local file or an IO that can seek back, is truncated to where it started
|
|
129
|
+
only as the retry's first bytes are written; any other IO gets the failure instead of the same bytes twice. A
|
|
130
|
+
cancellation or pause keeps what was written. Bytes are written exactly as stored, never decompressed.</p>
|
|
131
|
+
<p>A resumed download first checks, before it sends or changes anything, that its destination is the same one and
|
|
132
|
+
still holds exactly the bytes it wrote, by reading them back, a slice at a time charged to buffer_bytes, and
|
|
133
|
+
comparing their SHA-256 digest; a destination that cannot give them back refuses the resume. Anything after those
|
|
134
|
+
bytes stays until storage's response has proved its version: until the first new bytes are written, or, when every
|
|
135
|
+
byte was written before the pause, until storage answers for the file's last byte with that version.</p>
|
|
136
|
+
<p>A response carrying X-Files-Frontend-App came from the Files.com web app, not storage, and stops the download
|
|
137
|
+
with FrontendResponseError before any of it is written. A refused transfer or a failed write closes a caller's
|
|
138
|
+
IO, as without transfer:; other failures leave it open, holding what was written.</p>
|
|
139
|
+
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
<div class="tags">
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
</div><h2>Defined Under Namespace</h2>
|
|
146
|
+
<p class="children">
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="DownloadCoordinator/FileSink.html" title="Files::Transfer::DownloadCoordinator::FileSink (class)">FileSink</a></span>, <span class='object_link'><a href="DownloadCoordinator/IoSink.html" title="Files::Transfer::DownloadCoordinator::IoSink (class)">IoSink</a></span>, <span class='object_link'><a href="DownloadCoordinator/Piece.html" title="Files::Transfer::DownloadCoordinator::Piece (class)">Piece</a></span>
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
</p>
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
<h2>
|
|
158
|
+
Constant Summary
|
|
159
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
|
160
|
+
</h2>
|
|
161
|
+
|
|
162
|
+
<dl class="constants">
|
|
163
|
+
|
|
164
|
+
<dt id="RENEWALS-constant" class="">RENEWALS =
|
|
165
|
+
|
|
166
|
+
</dt>
|
|
167
|
+
<dd><pre class="code"><span class='int'>2</span></pre></dd>
|
|
168
|
+
|
|
169
|
+
<dt id="MISMATCH-constant" class="">MISMATCH =
|
|
170
|
+
|
|
171
|
+
</dt>
|
|
172
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Transfer response did not match the request</span><span class='tstring_end'>"</span></span></pre></dd>
|
|
173
|
+
|
|
174
|
+
<dt id="EXPIRED-constant" class="">EXPIRED =
|
|
175
|
+
|
|
176
|
+
</dt>
|
|
177
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>The download URL the API returned has expired, and renewing it did not give one still valid</span><span class='tstring_end'>"</span></span></pre></dd>
|
|
178
|
+
|
|
179
|
+
<dt id="VERIFY_CHUNK_BYTES-constant" class="">VERIFY_CHUNK_BYTES =
|
|
180
|
+
<div class="docstring">
|
|
181
|
+
<div class="discussion">
|
|
182
|
+
<p>The most of a resumed destination's bytes read back at once to check them; never more than a range.</p>
|
|
183
|
+
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
<div class="tags">
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
</div>
|
|
190
|
+
</dt>
|
|
191
|
+
<dd><pre class="code"><span class='int'>1024</span> <span class='op'>*</span> <span class='int'>1024</span></pre></dd>
|
|
192
|
+
|
|
193
|
+
<dt id="ControlStop-constant" class="">ControlStop =
|
|
194
|
+
|
|
195
|
+
</dt>
|
|
196
|
+
<dd><pre class="code"><span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>StandardError</span><span class='rparen'>)</span></pre></dd>
|
|
197
|
+
|
|
198
|
+
</dl>
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
<h2>
|
|
209
|
+
Class Method Summary
|
|
210
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
211
|
+
</h2>
|
|
212
|
+
|
|
213
|
+
<ul class="summary">
|
|
214
|
+
|
|
215
|
+
<li class="public ">
|
|
216
|
+
<span class="summary_signature">
|
|
217
|
+
|
|
218
|
+
<a href="#digest_of-class_method" title="digest_of (class method)">.<strong>digest_of</strong>(io, bytes, chunk) ⇒ Object </a>
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
</span>
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
<span class="summary_desc"><div class='inline'><p>A SHA-256 digest of the next bytes of io, read chunk bytes at a time, into one buffer when io takes one, or false when io ends before them.</p></div></span>
|
|
233
|
+
|
|
234
|
+
</li>
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
<li class="public ">
|
|
238
|
+
<span class="summary_signature">
|
|
239
|
+
|
|
240
|
+
<a href="#download_content-class_method" title="download_content (class method)">.<strong>download_content</strong>(job, file, io, progress: nil) ⇒ Object </a>
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
</span>
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
255
|
+
|
|
256
|
+
</li>
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
<li class="public ">
|
|
260
|
+
<span class="summary_signature">
|
|
261
|
+
|
|
262
|
+
<a href="#download_file-class_method" title="download_file (class method)">.<strong>download_file</strong>(job, file, local_path, progress: nil) ⇒ Object </a>
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
</span>
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
<span class="summary_desc"><div class='inline'><p>Opens local_path only once the job gives the download a file slot.</p></div></span>
|
|
277
|
+
|
|
278
|
+
</li>
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
<li class="public ">
|
|
282
|
+
<span class="summary_signature">
|
|
283
|
+
|
|
284
|
+
<a href="#resume-class_method" title="resume (class method)">.<strong>resume</strong>(job, checkpoint, destination, options, progress: nil) ⇒ Object </a>
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
</span>
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
299
|
+
|
|
300
|
+
</li>
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
<li class="public ">
|
|
304
|
+
<span class="summary_signature">
|
|
305
|
+
|
|
306
|
+
<a href="#takes_buffer%3F-class_method" title="takes_buffer? (class method)">.<strong>takes_buffer?</strong>(io) ⇒ Boolean </a>
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
</span>
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
<span class="summary_desc"><div class='inline'><p>Whether io's read and pread take a buffer to read into, as an IO's, a StringIO's and a Tempfile's do.</p></div></span>
|
|
321
|
+
|
|
322
|
+
</li>
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
</ul>
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
<h2>
|
|
329
|
+
Instance Method Summary
|
|
330
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
331
|
+
</h2>
|
|
332
|
+
|
|
333
|
+
<ul class="summary">
|
|
334
|
+
|
|
335
|
+
<li class="public ">
|
|
336
|
+
<span class="summary_signature">
|
|
337
|
+
|
|
338
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(job, file, open_sink, checkpoint: nil, lease: nil, progress: nil) ⇒ DownloadCoordinator </a>
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
</span>
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
<span class="note title constructor">constructor</span>
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
<span class="summary_desc"><div class='inline'><p>Fixes, on the caller's thread, the file's path and any download URL its record holds, the API context from its options, and the transport for its content requests, which refuses a client whose adapter cannot stream.</p></div></span>
|
|
355
|
+
|
|
356
|
+
</li>
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
</ul>
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Coordinator.html" title="Files::Transfer::Coordinator (class)">Coordinator</a></span></h3>
|
|
374
|
+
<p class="inherited"><span class='object_link'><a href="Coordinator.html#api_context-class_method" title="Files::Transfer::Coordinator.api_context (method)">api_context</a></span>, <span class='object_link'><a href="Coordinator.html#run-instance_method" title="Files::Transfer::Coordinator#run (method)">#run</a></span></p>
|
|
375
|
+
<div id="constructor_details" class="method_details_list">
|
|
376
|
+
<h2>Constructor Details</h2>
|
|
377
|
+
|
|
378
|
+
<div class="method_details first">
|
|
379
|
+
<h3 class="signature first" id="initialize-instance_method">
|
|
380
|
+
|
|
381
|
+
#<strong>initialize</strong>(job, file, open_sink, checkpoint: nil, lease: nil, progress: nil) ⇒ <tt><span class='object_link'><a href="" title="Files::Transfer::DownloadCoordinator (class)">DownloadCoordinator</a></span></tt>
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
</h3><div class="docstring">
|
|
388
|
+
<div class="discussion">
|
|
389
|
+
<p>Fixes, on the caller's thread, the file's path and any download URL its record holds, the API context from its
|
|
390
|
+
options, and the transport for its content requests, which refuses a client whose adapter cannot stream.</p>
|
|
391
|
+
|
|
392
|
+
</div>
|
|
393
|
+
</div>
|
|
394
|
+
<div class="tags">
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
</div><table class="source_code">
|
|
398
|
+
<tr>
|
|
399
|
+
<td>
|
|
400
|
+
<pre class="lines">
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
308
|
|
404
|
+
309
|
|
405
|
+
310
|
|
406
|
+
311
|
|
407
|
+
312
|
|
408
|
+
313
|
|
409
|
+
314
|
|
410
|
+
315
|
|
411
|
+
316
|
|
412
|
+
317
|
|
413
|
+
318
|
|
414
|
+
319
|
|
415
|
+
320
|
|
416
|
+
321
|
|
417
|
+
322
|
|
418
|
+
323
|
|
419
|
+
324
|
|
420
|
+
325
|
|
421
|
+
326
|
|
422
|
+
327
|
|
423
|
+
328
|
|
424
|
+
329
|
|
425
|
+
330
|
|
426
|
+
331
|
|
427
|
+
332
|
|
428
|
+
333
|
|
429
|
+
334
|
|
430
|
+
335
|
|
431
|
+
336
|
|
432
|
+
337
|
|
433
|
+
338</pre>
|
|
434
|
+
</td>
|
|
435
|
+
<td>
|
|
436
|
+
<pre class="code"><span class="info file"># File 'lib/files.com/transfer/download_coordinator.rb', line 308</span>
|
|
437
|
+
|
|
438
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_job'>job</span><span class='comma'>,</span> <span class='id identifier rubyid_file'>file</span><span class='comma'>,</span> <span class='id identifier rubyid_open_sink'>open_sink</span><span class='comma'>,</span> <span class='label'>checkpoint:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>lease:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>progress:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
439
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_job'>job</span><span class='rparen'>)</span>
|
|
440
|
+
<span class='ivar'>@path</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Checkpoint.html" title="Files::Transfer::Checkpoint (class)">Checkpoint</a></span></span><span class='period'>.</span><span class='id identifier rubyid_frozen'><span class='object_link'><a href="Checkpoint.html#frozen-class_method" title="Files::Transfer::Checkpoint.frozen (method)">frozen</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
|
441
|
+
<span class='ivar'>@download_uri</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Checkpoint.html" title="Files::Transfer::Checkpoint (class)">Checkpoint</a></span></span><span class='period'>.</span><span class='id identifier rubyid_frozen'><span class='object_link'><a href="Checkpoint.html#frozen-class_method" title="Files::Transfer::Checkpoint.frozen (method)">frozen</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_download_uri'>download_uri</span><span class='rparen'>)</span>
|
|
442
|
+
<span class='ivar'>@options</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Coordinator.html" title="Files::Transfer::Coordinator (class)">Coordinator</a></span></span><span class='period'>.</span><span class='id identifier rubyid_api_context'><span class='object_link'><a href="Coordinator.html#api_context-class_method" title="Files::Transfer::Coordinator.api_context (method)">api_context</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
|
443
|
+
<span class='ivar'>@open_sink</span> <span class='op'>=</span> <span class='id identifier rubyid_open_sink'>open_sink</span>
|
|
444
|
+
<span class='ivar'>@sink</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
445
|
+
<span class='ivar'>@lease</span> <span class='op'>=</span> <span class='id identifier rubyid_lease'>lease</span>
|
|
446
|
+
<span class='ivar'>@progress</span> <span class='op'>=</span> <span class='id identifier rubyid_progress'>progress</span>
|
|
447
|
+
<span class='ivar'>@transport</span> <span class='op'>=</span> <span class='id identifier rubyid_job'>job</span><span class='period'>.</span><span class='id identifier rubyid_transport_for'>transport_for</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Files.html" title="Files (module)">Files</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../ApiClient.html" title="Files::ApiClient (class)">ApiClient</a></span></span><span class='period'>.</span><span class='id identifier rubyid_download_client'><span class='object_link'><a href="../ApiClient.html#download_client-class_method" title="Files::ApiClient.download_client (method)">download_client</a></span></span><span class='comma'>,</span> <span class='label'>download:</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
|
448
|
+
<span class='ivar'>@range_bytes</span> <span class='op'>=</span> <span class='lbracket'>[</span> <span class='const'><span class='object_link'><a href="Policy.html" title="Files::Transfer::Policy (class)">Policy</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Policy.html#DOWNLOAD_RANGE_BYTES-constant" title="Files::Transfer::Policy::DOWNLOAD_RANGE_BYTES (constant)">DOWNLOAD_RANGE_BYTES</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_job'>job</span><span class='period'>.</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_buffer_bytes'>buffer_bytes</span> <span class='op'>/</span> <span class='int'>4</span> <span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_min'>min</span>
|
|
449
|
+
<span class='ivar'>@mode</span> <span class='op'>=</span> <span class='symbol'>:probe</span>
|
|
450
|
+
<span class='ivar'>@written</span> <span class='op'>=</span> <span class='int'>0</span>
|
|
451
|
+
<span class='ivar'>@counted</span> <span class='op'>=</span> <span class='int'>0</span>
|
|
452
|
+
<span class='ivar'>@digest</span> <span class='op'>=</span> <span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>Digest</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>SHA256</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|
453
|
+
<span class='ivar'>@total</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
454
|
+
<span class='ivar'>@version</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
455
|
+
<span class='ivar'>@generation</span> <span class='op'>=</span> <span class='int'>0</span>
|
|
456
|
+
<span class='ivar'>@open</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
457
|
+
<span class='ivar'>@next_number</span> <span class='op'>=</span> <span class='int'>0</span>
|
|
458
|
+
<span class='ivar'>@next_write</span> <span class='op'>=</span> <span class='int'>0</span>
|
|
459
|
+
<span class='ivar'>@refusals</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_compare_by_identity'>compare_by_identity</span>
|
|
460
|
+
<span class='ivar'>@write_failure</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
461
|
+
<span class='ivar'>@origin</span> <span class='op'>=</span> <span class='id identifier rubyid_checkpoint'>checkpoint</span>
|
|
462
|
+
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_checkpoint'>checkpoint</span><span class='op'>&.</span><span class='id identifier rubyid_version'>version</span>
|
|
463
|
+
|
|
464
|
+
<span class='ivar'>@written</span> <span class='op'>=</span> <span class='id identifier rubyid_checkpoint'>checkpoint</span><span class='period'>.</span><span class='id identifier rubyid_completed_bytes'>completed_bytes</span>
|
|
465
|
+
<span class='ivar'>@counted</span> <span class='op'>=</span> <span class='ivar'>@written</span>
|
|
466
|
+
<span class='ivar'>@version</span> <span class='op'>=</span> <span class='id identifier rubyid_checkpoint'>checkpoint</span><span class='period'>.</span><span class='id identifier rubyid_version'>version</span>
|
|
467
|
+
<span class='ivar'>@total</span> <span class='op'>=</span> <span class='id identifier rubyid_checkpoint'>checkpoint</span><span class='period'>.</span><span class='id identifier rubyid_total_bytes'>total_bytes</span>
|
|
468
|
+
<span class='kw'>end</span></pre>
|
|
469
|
+
</td>
|
|
470
|
+
</tr>
|
|
471
|
+
</table>
|
|
472
|
+
</div>
|
|
473
|
+
|
|
474
|
+
</div>
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
<div id="class_method_details" class="method_details_list">
|
|
478
|
+
<h2>Class Method Details</h2>
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
<div class="method_details first">
|
|
482
|
+
<h3 class="signature first" id="digest_of-class_method">
|
|
483
|
+
|
|
484
|
+
.<strong>digest_of</strong>(io, bytes, chunk) ⇒ <tt>Object</tt>
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
</h3><div class="docstring">
|
|
491
|
+
<div class="discussion">
|
|
492
|
+
<p>A SHA-256 digest of the next bytes of io, read chunk bytes at a time, into one buffer when io takes one, or false
|
|
493
|
+
when io ends before them.</p>
|
|
494
|
+
|
|
495
|
+
</div>
|
|
496
|
+
</div>
|
|
497
|
+
<div class="tags">
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
</div><table class="source_code">
|
|
501
|
+
<tr>
|
|
502
|
+
<td>
|
|
503
|
+
<pre class="lines">
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
53
|
|
507
|
+
54
|
|
508
|
+
55
|
|
509
|
+
56
|
|
510
|
+
57
|
|
511
|
+
58
|
|
512
|
+
59
|
|
513
|
+
60
|
|
514
|
+
61
|
|
515
|
+
62
|
|
516
|
+
63
|
|
517
|
+
64
|
|
518
|
+
65
|
|
519
|
+
66</pre>
|
|
520
|
+
</td>
|
|
521
|
+
<td>
|
|
522
|
+
<pre class="code"><span class="info file"># File 'lib/files.com/transfer/download_coordinator.rb', line 53</span>
|
|
523
|
+
|
|
524
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_digest_of'>digest_of</span><span class='lparen'>(</span><span class='id identifier rubyid_io'>io</span><span class='comma'>,</span> <span class='id identifier rubyid_bytes'>bytes</span><span class='comma'>,</span> <span class='id identifier rubyid_chunk'>chunk</span><span class='rparen'>)</span>
|
|
525
|
+
<span class='id identifier rubyid_digest'>digest</span> <span class='op'>=</span> <span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>Digest</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>SHA256</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|
526
|
+
<span class='id identifier rubyid_buffer'>buffer</span> <span class='op'>=</span> <span class='const'>String</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>capacity:</span> <span class='id identifier rubyid_chunk'>chunk</span><span class='comma'>,</span> <span class='label'>encoding:</span> <span class='const'>Encoding</span><span class='op'>::</span><span class='const'>BINARY</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_takes_buffer?'>takes_buffer?</span><span class='lparen'>(</span><span class='id identifier rubyid_io'>io</span><span class='rparen'>)</span>
|
|
527
|
+
<span class='id identifier rubyid_remaining'>remaining</span> <span class='op'>=</span> <span class='id identifier rubyid_bytes'>bytes</span>
|
|
528
|
+
<span class='kw'>while</span> <span class='id identifier rubyid_remaining'>remaining</span><span class='period'>.</span><span class='id identifier rubyid_positive?'>positive?</span>
|
|
529
|
+
<span class='id identifier rubyid_wanted'>wanted</span> <span class='op'>=</span> <span class='lbracket'>[</span> <span class='id identifier rubyid_remaining'>remaining</span><span class='comma'>,</span> <span class='id identifier rubyid_chunk'>chunk</span> <span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_min'>min</span>
|
|
530
|
+
<span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier rubyid_buffer'>buffer</span> <span class='op'>?</span> <span class='id identifier rubyid_io'>io</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='id identifier rubyid_wanted'>wanted</span><span class='comma'>,</span> <span class='id identifier rubyid_buffer'>buffer</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_io'>io</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='id identifier rubyid_wanted'>wanted</span><span class='rparen'>)</span>
|
|
531
|
+
<span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
|
532
|
+
|
|
533
|
+
<span class='id identifier rubyid_digest'>digest</span><span class='period'>.</span><span class='id identifier rubyid_update'>update</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
|
534
|
+
<span class='id identifier rubyid_remaining'>remaining</span> <span class='op'>-=</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_bytesize'>bytesize</span>
|
|
535
|
+
<span class='kw'>end</span>
|
|
536
|
+
<span class='id identifier rubyid_digest'>digest</span>
|
|
537
|
+
<span class='kw'>end</span></pre>
|
|
538
|
+
</td>
|
|
539
|
+
</tr>
|
|
540
|
+
</table>
|
|
541
|
+
</div>
|
|
542
|
+
|
|
543
|
+
<div class="method_details ">
|
|
544
|
+
<h3 class="signature " id="download_content-class_method">
|
|
545
|
+
|
|
546
|
+
.<strong>download_content</strong>(job, file, io, progress: nil) ⇒ <tt>Object</tt>
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
</h3><table class="source_code">
|
|
553
|
+
<tr>
|
|
554
|
+
<td>
|
|
555
|
+
<pre class="lines">
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
287
|
|
559
|
+
288
|
|
560
|
+
289</pre>
|
|
561
|
+
</td>
|
|
562
|
+
<td>
|
|
563
|
+
<pre class="code"><span class="info file"># File 'lib/files.com/transfer/download_coordinator.rb', line 287</span>
|
|
564
|
+
|
|
565
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_download_content'>download_content</span><span class='lparen'>(</span><span class='id identifier rubyid_job'>job</span><span class='comma'>,</span> <span class='id identifier rubyid_file'>file</span><span class='comma'>,</span> <span class='id identifier rubyid_io'>io</span><span class='comma'>,</span> <span class='label'>progress:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
566
|
+
<span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_job'>job</span><span class='comma'>,</span> <span class='id identifier rubyid_file'>file</span><span class='comma'>,</span> <span class='tlambda'>-></span> <span class='tlambeg'>{</span> <span class='const'><span class='object_link'><a href="DownloadCoordinator/IoSink.html" title="Files::Transfer::DownloadCoordinator::IoSink (class)">IoSink</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="DownloadCoordinator/IoSink.html#initialize-instance_method" title="Files::Transfer::DownloadCoordinator::IoSink#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_io'>io</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>progress:</span> <span class='id identifier rubyid_progress'>progress</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span>
|
|
567
|
+
<span class='kw'>end</span></pre>
|
|
568
|
+
</td>
|
|
569
|
+
</tr>
|
|
570
|
+
</table>
|
|
571
|
+
</div>
|
|
572
|
+
|
|
573
|
+
<div class="method_details ">
|
|
574
|
+
<h3 class="signature " id="download_file-class_method">
|
|
575
|
+
|
|
576
|
+
.<strong>download_file</strong>(job, file, local_path, progress: nil) ⇒ <tt>Object</tt>
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
</h3><div class="docstring">
|
|
583
|
+
<div class="discussion">
|
|
584
|
+
<p>Opens local_path only once the job gives the download a file slot.</p>
|
|
585
|
+
|
|
586
|
+
</div>
|
|
587
|
+
</div>
|
|
588
|
+
<div class="tags">
|
|
589
|
+
|
|
590
|
+
|
|
591
|
+
</div><table class="source_code">
|
|
592
|
+
<tr>
|
|
593
|
+
<td>
|
|
594
|
+
<pre class="lines">
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
283
|
|
598
|
+
284
|
|
599
|
+
285</pre>
|
|
600
|
+
</td>
|
|
601
|
+
<td>
|
|
602
|
+
<pre class="code"><span class="info file"># File 'lib/files.com/transfer/download_coordinator.rb', line 283</span>
|
|
603
|
+
|
|
604
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_download_file'>download_file</span><span class='lparen'>(</span><span class='id identifier rubyid_job'>job</span><span class='comma'>,</span> <span class='id identifier rubyid_file'>file</span><span class='comma'>,</span> <span class='id identifier rubyid_local_path'>local_path</span><span class='comma'>,</span> <span class='label'>progress:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
605
|
+
<span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_job'>job</span><span class='comma'>,</span> <span class='id identifier rubyid_file'>file</span><span class='comma'>,</span> <span class='tlambda'>-></span> <span class='tlambeg'>{</span> <span class='const'><span class='object_link'><a href="DownloadCoordinator/FileSink.html" title="Files::Transfer::DownloadCoordinator::FileSink (class)">FileSink</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="DownloadCoordinator/FileSink.html#initialize-instance_method" title="Files::Transfer::DownloadCoordinator::FileSink#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_local_path'>local_path</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>wb</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_local_path'>local_path</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>progress:</span> <span class='id identifier rubyid_progress'>progress</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span>
|
|
606
|
+
<span class='kw'>end</span></pre>
|
|
607
|
+
</td>
|
|
608
|
+
</tr>
|
|
609
|
+
</table>
|
|
610
|
+
</div>
|
|
611
|
+
|
|
612
|
+
<div class="method_details ">
|
|
613
|
+
<h3 class="signature " id="resume-class_method">
|
|
614
|
+
|
|
615
|
+
.<strong>resume</strong>(job, checkpoint, destination, options, progress: nil) ⇒ <tt>Object</tt>
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
</h3><table class="source_code">
|
|
622
|
+
<tr>
|
|
623
|
+
<td>
|
|
624
|
+
<pre class="lines">
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
291
|
|
628
|
+
292
|
|
629
|
+
293
|
|
630
|
+
294
|
|
631
|
+
295
|
|
632
|
+
296
|
|
633
|
+
297
|
|
634
|
+
298
|
|
635
|
+
299
|
|
636
|
+
300
|
|
637
|
+
301
|
|
638
|
+
302
|
|
639
|
+
303
|
|
640
|
+
304</pre>
|
|
641
|
+
</td>
|
|
642
|
+
<td>
|
|
643
|
+
<pre class="code"><span class="info file"># File 'lib/files.com/transfer/download_coordinator.rb', line 291</span>
|
|
644
|
+
|
|
645
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_resume'>resume</span><span class='lparen'>(</span><span class='id identifier rubyid_job'>job</span><span class='comma'>,</span> <span class='id identifier rubyid_checkpoint'>checkpoint</span><span class='comma'>,</span> <span class='id identifier rubyid_destination'>destination</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='comma'>,</span> <span class='label'>progress:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
646
|
+
<span class='id identifier rubyid_checkpoint'>checkpoint</span><span class='period'>.</span><span class='id identifier rubyid_resuming'>resuming</span><span class='lparen'>(</span><span class='symbol'>:download</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_lease'>lease</span><span class='op'>|</span>
|
|
647
|
+
<span class='id identifier rubyid_remote'>remote</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../Files.html" title="Files (module)">Files</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../File.html" title="Files::File (class)">File</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../File.html#initialize-instance_method" title="Files::File#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_checkpoint'>checkpoint</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
|
648
|
+
<span class='id identifier rubyid_open_sink'>open_sink</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_checkpoint'>checkpoint</span><span class='period'>.</span><span class='id identifier rubyid_local_path'>local_path</span>
|
|
649
|
+
<span class='tlambda'>-></span> <span class='tlambeg'>{</span> <span class='const'><span class='object_link'><a href="DownloadCoordinator/FileSink.html" title="Files::Transfer::DownloadCoordinator::FileSink (class)">FileSink</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="DownloadCoordinator/FileSink.html#initialize-instance_method" title="Files::Transfer::DownloadCoordinator::FileSink#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_checkpoint'>checkpoint</span><span class='period'>.</span><span class='id identifier rubyid_local_path'>local_path</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>r+b</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_checkpoint'>checkpoint</span><span class='period'>.</span><span class='id identifier rubyid_local_path'>local_path</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
|
650
|
+
<span class='kw'>else</span>
|
|
651
|
+
<span class='id identifier rubyid__'>_</span><span class='comma'>,</span> <span class='id identifier rubyid_io'>io</span><span class='comma'>,</span> <span class='id identifier rubyid_start'>start</span> <span class='op'>=</span> <span class='id identifier rubyid_checkpoint'>checkpoint</span><span class='period'>.</span><span class='id identifier rubyid_sink'>sink</span>
|
|
652
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="CheckpointError.html" title="Files::Transfer::CheckpointError (class)">CheckpointError</a></span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Bad parameter: resume the download into the IO it paused in</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_destination'>destination</span><span class='period'>.</span><span class='id identifier rubyid_equal?'>equal?</span><span class='lparen'>(</span><span class='id identifier rubyid_io'>io</span><span class='rparen'>)</span>
|
|
653
|
+
|
|
654
|
+
<span class='tlambda'>-></span> <span class='tlambeg'>{</span> <span class='const'><span class='object_link'><a href="DownloadCoordinator/IoSink.html" title="Files::Transfer::DownloadCoordinator::IoSink (class)">IoSink</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="DownloadCoordinator/IoSink.html#initialize-instance_method" title="Files::Transfer::DownloadCoordinator::IoSink#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_destination'>destination</span><span class='comma'>,</span> <span class='label'>start:</span> <span class='id identifier rubyid_start'>start</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
|
655
|
+
<span class='kw'>end</span>
|
|
656
|
+
<span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_job'>job</span><span class='comma'>,</span> <span class='id identifier rubyid_remote'>remote</span><span class='comma'>,</span> <span class='id identifier rubyid_open_sink'>open_sink</span><span class='comma'>,</span> <span class='label'>checkpoint:</span> <span class='id identifier rubyid_checkpoint'>checkpoint</span><span class='comma'>,</span> <span class='label'>lease:</span> <span class='id identifier rubyid_lease'>lease</span><span class='comma'>,</span> <span class='label'>progress:</span> <span class='id identifier rubyid_progress'>progress</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span>
|
|
657
|
+
<span class='kw'>end</span>
|
|
658
|
+
<span class='kw'>end</span></pre>
|
|
659
|
+
</td>
|
|
660
|
+
</tr>
|
|
661
|
+
</table>
|
|
662
|
+
</div>
|
|
663
|
+
|
|
664
|
+
<div class="method_details ">
|
|
665
|
+
<h3 class="signature " id="takes_buffer?-class_method">
|
|
666
|
+
|
|
667
|
+
.<strong>takes_buffer?</strong>(io) ⇒ <tt>Boolean</tt>
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
</h3><div class="docstring">
|
|
674
|
+
<div class="discussion">
|
|
675
|
+
<p>Whether io's read and pread take a buffer to read into, as an IO's, a StringIO's and a Tempfile's do.</p>
|
|
676
|
+
|
|
677
|
+
</div>
|
|
678
|
+
</div>
|
|
679
|
+
<div class="tags">
|
|
680
|
+
|
|
681
|
+
<p class="tag_title">Returns:</p>
|
|
682
|
+
<ul class="return">
|
|
683
|
+
|
|
684
|
+
<li>
|
|
685
|
+
|
|
686
|
+
|
|
687
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
</li>
|
|
692
|
+
|
|
693
|
+
</ul>
|
|
694
|
+
|
|
695
|
+
</div><table class="source_code">
|
|
696
|
+
<tr>
|
|
697
|
+
<td>
|
|
698
|
+
<pre class="lines">
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
69
|
|
702
|
+
70
|
|
703
|
+
71</pre>
|
|
704
|
+
</td>
|
|
705
|
+
<td>
|
|
706
|
+
<pre class="code"><span class="info file"># File 'lib/files.com/transfer/download_coordinator.rb', line 69</span>
|
|
707
|
+
|
|
708
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_takes_buffer?'>takes_buffer?</span><span class='lparen'>(</span><span class='id identifier rubyid_io'>io</span><span class='rparen'>)</span>
|
|
709
|
+
<span class='id identifier rubyid_io'>io</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>IO</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_io'>io</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>StringIO</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='lparen'>(</span><span class='kw'>defined?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Tempfile</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_io'>io</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Tempfile</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
|
710
|
+
<span class='kw'>end</span></pre>
|
|
711
|
+
</td>
|
|
712
|
+
</tr>
|
|
713
|
+
</table>
|
|
714
|
+
</div>
|
|
715
|
+
|
|
716
|
+
</div>
|
|
717
|
+
|
|
718
|
+
</div>
|
|
719
|
+
|
|
720
|
+
<div id="footer">
|
|
721
|
+
Generated on Tue Nov 3 18:04:22 2026 by
|
|
722
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
723
|
+
0.9.45 (ruby-4.0.9).
|
|
724
|
+
</div>
|
|
725
|
+
|
|
726
|
+
</div>
|
|
727
|
+
</body>
|
|
728
|
+
</html>
|