-
Notifications
You must be signed in to change notification settings - Fork 143
Expand file tree
/
Copy pathNSURL+OCVaultTools.m
More file actions
42 lines (34 loc) 路 1.05 KB
/
Copy pathNSURL+OCVaultTools.m
File metadata and controls
42 lines (34 loc) 路 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
// NSURL+OCVaultTools.m
// ownCloudApp
//
// Created by Felix Schwarz on 30.01.25.
// Copyright 漏 2025 ownCloud GmbH. All rights reserved.
//
/*
* Copyright (C) 2025, ownCloud GmbH.
*
* This code is covered by the GNU Public License Version 3.
*
* For distribution utilizing Apple mechanisms please see https://owncloud.org/contribute/iOS-license-exception/
* You should have received a copy of this license along with this program. If not, see <http://www.gnu.org/licenses/gpl-3.0.en.html>.
*
*/
#import <ownCloudSDK/ownCloudSDK.h>
#import "NSURL+OCVaultTools.h"
@implementation NSURL (OCVaultTools)
- (BOOL)isLocatedWithinVaultStorage
{
return ([self isLocatedWithin:OCVault.storageRootURL standardizeParent:NO]); // OCVault.storageRootURL is already standardized
}
- (BOOL)isLocalFile
{
NSURLFileResourceType resourceType = nil;
NSError *error = nil;
if (self.isFileURL && [self getResourceValue:&resourceType forKey:NSURLFileResourceTypeKey error:&error])
{
return ([resourceType isEqual:NSURLFileResourceTypeRegular]);
}
return (NO);
}
@end