forked from blinksh/blink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBlinkPaths.m
63 lines (50 loc) · 1.19 KB
/
BlinkPaths.m
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//
// BlinkPaths.m
// Blink
//
// Created by Yury Korolev on 5/14/18.
// Copyright © 2018 Carlos Cabañero Projects SL. All rights reserved.
//
#import "BlinkPaths.h"
@implementation BlinkPaths
+ (NSString *)documents
{
return [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
}
+ (NSURL *)documentsURL
{
return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] firstObject];
}
+ (NSString *)blink
{
return [self documents];
}
+ (NSURL *)blinkURL
{
return [self documentsURL];
}
+ (NSString *)blinkKeysFile
{
return [[self blink] stringByAppendingPathComponent:@"keys"];
}
+ (NSString *)blinkHostsFile
{
return [[self blink] stringByAppendingPathComponent:@"hosts"];
}
+ (NSString *)blinkSyncItemsFile
{
return [[self blink] stringByAppendingPathComponent:@"syncItems"];
}
+ (NSString *)historyFile
{
return [[self documents] stringByAppendingPathComponent:@".blink_history"];
}
+ (NSString *)knownHostsFile
{
return [[self documents] stringByAppendingPathComponent:@"known_hosts"];
}
+ (NSString *)defaultsFile
{
return [[self documents] stringByAppendingPathComponent:@"defaults"];
}
@end