BBAPathManager.h
1.21 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
//
// BBAPathManager.h
// BBAPods-Utility
//
// Created by 白昆仑 on 2018/3/14.
// Copyright © 2018年 Baidu. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
FOUNDATION_EXTERN NSString * const BDPDocumentPathComponentInteraction;
@interface BBAPathManager : NSObject
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
+ (instancetype)sharedInstance;
/**
* iOS系统通用路径
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* 警告:该类仅提供"iOS通用文件夹路径"及"baiduboxapp根文件夹路径",不保存"业务存储路径"或"文件名",违者必究
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*/
// 所有路径,在未获取到 或 路径创建失败时返回空串(@"")
- (NSString *)documentDirPath; // 沙盒document文件夹路径
- (NSString *)cacheDirPath; // 沙盒cache文件夹路径
- (NSString *)libraryDirPath; // 沙盒library文件夹路径
- (NSString *)documentInteractionDirPath; // 通过Document Interaction功能导入的外部应用文件iOS默认存储路径
/**
* 路径检查 & 创建工具
*/
+ (BOOL)checkAndCreateDirectory:(NSString *)path; // 路径递归创建文件夹
@end
NS_ASSUME_NONNULL_END