mop-flutter-sdk/ios/Classes/FinAppletExt/Common/Manager/FATExtFileManager.m

61 lines
1.7 KiB
Dart
Raw Permalink Normal View History

2023-08-02 19:36:40 +08:00
//
// FATExtFileManager.m
// FinAppletExt
//
// Created by Haley on 2020/8/17.
// Copyright © 2020 finogeeks. All rights reserved.
//
#import "FATExtFileManager.h"
#import "FATExtUtil.h"
#import <FinApplet/FinApplet.h>
static NSString *FATEXT_PROJECT_ROOT = @"FinChatRoot";
static NSString *FATEXT_PROJECT_ROOT_App = @"app";
static NSString *FATEXT_PROJECT_ROOT_Framework = @"framework";
@implementation FATExtFileManager
+ (NSString *)projectRootDirPath {
NSString *rootPath;
if ([FATExtUtil currentProductIdentificationIsEmpty]) {
rootPath = [NSTemporaryDirectory() stringByAppendingPathComponent:FATEXT_PROJECT_ROOT];
} else {
rootPath = [NSTemporaryDirectory() stringByAppendingPathComponent:[FATExtUtil currentProductIdentification]];
}
return rootPath;
}
+ (NSString *)projectRootAppsDirPath {
NSString *rootPath = [[FATExtFileManager projectRootDirPath] stringByAppendingFormat:@"/%@", FATEXT_PROJECT_ROOT_App];
return rootPath;
}
/**
@return
*/
+ (NSString *)appRootDirPath:(NSString *)appId {
NSString *rootPath = [FATExtFileManager projectRootAppsDirPath];
NSString *appDirPath = [rootPath stringByAppendingPathComponent:appId];
return appDirPath;
}
/**
@return NSString *
*/
+ (NSString *)appTempDirPath:(NSString *)appId {
NSString *currtUserId = [FATExtUtil currentUserId];
NSString *tempFileCachePath = [[FATExtFileManager appRootDirPath:appId] stringByAppendingPathComponent:[currtUserId fat_md5String]];
tempFileCachePath = [tempFileCachePath stringByAppendingPathComponent:@"Temp"];
return tempFileCachePath;
}
@end