-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
107 changed files
with
2,512 additions
and
101 deletions.
There are no files selected for viewing
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
97 changes: 97 additions & 0 deletions
97
Cryptomator.xcodeproj/xcshareddata/xcschemes/CryptomatorIntents.xcscheme
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,97 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "1340" | ||
wasCreatedForAppExtension = "YES" | ||
version = "2.0"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "4AD3D7D3282EBDE7008188CD" | ||
BuildableName = "CryptomatorIntents.appex" | ||
BlueprintName = "CryptomatorIntents" | ||
ReferencedContainer = "container:Cryptomator.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "4AE97DA724572E4900452814" | ||
BuildableName = "Cryptomator.app" | ||
BlueprintName = "Cryptomator" | ||
ReferencedContainer = "container:Cryptomator.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES"> | ||
<Testables> | ||
</Testables> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "" | ||
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn" | ||
launchStyle = "0" | ||
askForAppToLaunch = "Yes" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES" | ||
launchAutomaticallySubstyle = "2"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "4AE97DA724572E4900452814" | ||
BuildableName = "Cryptomator.app" | ||
BlueprintName = "Cryptomator" | ||
ReferencedContainer = "container:Cryptomator.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES" | ||
askForAppToLaunch = "Yes" | ||
launchAutomaticallySubstyle = "2"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "4AE97DA724572E4900452814" | ||
BuildableName = "Cryptomator.app" | ||
BlueprintName = "Cryptomator" | ||
ReferencedContainer = "container:Cryptomator.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
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
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
65 changes: 65 additions & 0 deletions
65
CryptomatorCommon/Sources/CryptomatorCommonCore/FileProviderXPC/FileImporting.swift
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,65 @@ | ||
// | ||
// FileImporting.swift | ||
// CryptomatorCommonCore | ||
// | ||
// Created by Philipp Schmid on 13.05.22. | ||
// Copyright © 2022 Skymatic GmbH. All rights reserved. | ||
// | ||
|
||
import FileProvider | ||
import Foundation | ||
import Promises | ||
|
||
@objc public protocol FileImporting: NSFileProviderServiceSource { | ||
/** | ||
Imports the file at the given `localURL` to the given `parentItemIdentifier`. | ||
|
||
- Parameter localURL: The URL of the file to be imported | ||
- Parameter parentItemIdentifier: The item identifier of the folder into which the file will be imported. | ||
- Parameter reply: Reply block which gets called with `nil` once the file has been imported locally. If an error occurs when importing the file locally, the reply block gets called with this error. | ||
*/ | ||
func importFile(at localURL: URL, toParentItemIdentifier parentItemIdentifier: String, reply: @escaping (NSError?) -> Void) | ||
|
||
/** | ||
Returns the identifier for an item at the given path. | ||
|
||
- Parameter path: The path of the item in the cloud | ||
- Parameter reply: Reply block which is called with the `rawValue` of the `NSFileProviderItemIdentifier` if there is an item for the passed path in the cloud. If an error occurs while checking the path in the cloud, the reply block is called with it. Furthermore, the reply block is called with an error if the item does not exist in the cloud. | ||
*/ | ||
func getIdentifierForItem(at path: String, reply: @escaping (NSString?, NSError?) -> Void) | ||
} | ||
|
||
public extension FileImporting { | ||
/** | ||
Imports the file at the given `localURL` to the given `parentItemIdentifier`. | ||
|
||
- Parameter localURL: The URL of the file to be imported | ||
- Parameter parentItemIdentifier: The item identifier of the folder into which the file will be imported. | ||
*/ | ||
func importFile(at localURL: URL, toParentItemIdentifier parentItemIdentifier: String) -> Promise<Void> { | ||
return wrap { | ||
self.importFile(at: localURL, toParentItemIdentifier: parentItemIdentifier, reply: $0) | ||
}.then { error -> Void in | ||
if let error = error { | ||
throw error | ||
} | ||
} | ||
} | ||
|
||
/** | ||
Returns the identifier for an item at the given path. | ||
|
||
- Parameter path: The path of the item in the cloud | ||
*/ | ||
func getIdentifierForItem(at path: String) -> Promise<NSString> { | ||
return wrap { | ||
self.getIdentifierForItem(at: path, reply: $0) | ||
}.then { | ||
return $0! | ||
} | ||
} | ||
} | ||
|
||
public extension NSFileProviderServiceName { | ||
static let fileImporting = NSFileProviderServiceName("org.cryptomator.ios.file-importing") | ||
} |
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
Oops, something went wrong.