Skip to content

Commit 26d00a8

Browse files
committed
feat(doc): Another small method documentation block comment.
Signed-off-by: Iva Horn <iva.horn@icloud.com>
1 parent a97cf8d commit 26d00a8

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

Sources/NextcloudFileProviderKit/Interface/RemoteInterface.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ public enum AuthenticationAttemptResultState: Int {
2323
case authenticationError, connectionError, success
2424
}
2525

26+
///
27+
/// Abstraction of the Nextcloud server APIs to call from the file provider extension.
28+
///
29+
/// Usually, the shared `NextcloudKit` instance is conforming to this and provided as an argument.
30+
/// NextcloudKit is not mockable as of writing, hence this protocol was defined to enable testing.
31+
///
2632
public protocol RemoteInterface {
2733

2834
func setDelegate(_ delegate: NextcloudKitDelegate)

Sources/NextcloudFileProviderKit/Utilities/LocalFiles.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public func pathForAppGroupContainer() -> URL? {
4444
///
4545
public func pathForFileProviderExtData() -> URL? {
4646
let containerUrl = pathForAppGroupContainer()
47-
return containerUrl?.appendingPathComponent("FileProviderExt/")
47+
return containerUrl?.appendingPathComponent("FileProviderExt")
4848
}
4949

5050
public func pathForFileProviderTempFilesForDomain(_ domain: NSFileProviderDomain) throws -> URL? {
@@ -56,7 +56,7 @@ public func pathForFileProviderTempFilesForDomain(_ domain: NSFileProviderDomain
5656
}
5757

5858
let fileProviderDataUrl = try fpManager.temporaryDirectoryURL()
59-
return fileProviderDataUrl.appendingPathComponent("TemporaryNextcloudFiles/")
59+
return fileProviderDataUrl.appendingPathComponent("TemporaryNextcloudFiles")
6060
}
6161

6262
///
@@ -65,7 +65,7 @@ public func pathForFileProviderTempFilesForDomain(_ domain: NSFileProviderDomain
6565
/// - Parameters:
6666
/// - filename: The filename to check.
6767
///
68-
/// - Returns: `true` if the filename is a lock file, `false`` otherwise.
68+
/// - Returns: `true` if the filename is a lock file, `false` otherwise.
6969
///
7070
public func isLockFileName(_ filename: String) -> Bool {
7171
// Microsoft Office lock files
@@ -79,6 +79,8 @@ public func isLockFileName(_ filename: String) -> Bool {
7979
///
8080
/// Example for Microsoft Office: `MyDoc.docx` is extracted from `~$MyDoc.docx`.
8181
/// Example for LibreOffice: `MyDoc.odt` is extracted from `.~lock.MyDoc.odt#`.
82+
///
83+
/// - Returns: Either the original file name parsed from the given lock file name or `nil`, if it is not a recognized lock file format.
8284
///
8385
public func originalFileName(fromLockFileName lockFilename: String) -> String? {
8486
if lockFilename.hasPrefix("~$") {

0 commit comments

Comments
 (0)