-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip(client): add support for background upload
- Loading branch information
1 parent
47552ef
commit d00607d
Showing
5 changed files
with
126 additions
and
34 deletions.
There are no files selected for viewing
9 changes: 0 additions & 9 deletions
9
Example/Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// APIHelper.swift | ||
// | ||
// Generated by openapi-generator | ||
// https://openapi-generator.tech | ||
// | ||
|
||
import Foundation | ||
|
||
public struct FileHelper { | ||
/** | ||
This function will copy a video file to a temporary location so that it remains accessbile for further handling such as an upload to S3. | ||
- Parameter url: This is the url of the media item. | ||
- Returns: Return a new URL for the local copy of the vidoe file. | ||
*/ | ||
static func createTemporaryURLfrom(_ url: URL) -> URL { | ||
/// Create the temporary directory. | ||
let temporaryDirectoryURL = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true) | ||
/// create a temporary file for us to copy the video to. | ||
let temporaryFileURL = temporaryDirectoryURL.appendingPathComponent(url.lastPathComponent) | ||
/// Attempt the copy. | ||
do { | ||
try FileManager().copyItem(at: url.absoluteURL, to: temporaryFileURL) | ||
} catch { | ||
fatalError("There was an error copying the video file to the temporary location.") | ||
} | ||
|
||
return temporaryFileURL | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters