Mobile API Reference  MicroStrategy 2019
FileUtils.h
Go to the documentation of this file.
1 //
2 // FileUtils.h
3 // MSTR Foundation
4 //
5 // Created by Amirali Charania on 2/24/09.
6 // Copyright 2009 MicroStrategy. All rights reserved.
7 //
8 
9 #import <Foundation/Foundation.h>
10 
11 #define SOFTWARE_ENCRYPTION_PREFIX @"MSTR_SE_"
12 
13 // if you don't want use encryption for reading/writing file, just comment out the following define "ENCRYPTION_ENABLED".
14 #define ENCRYPTION_LOGGING_ENABLED NO
15 
16 @interface FileUtils : NSObject {
17 
18 }
19 
20 +(NSString*)documentDirectory;
21 +(NSString*)cachesDirectory;
22 +(NSString*)libraryDirectory;
23 +(NSString*)tempDirectory;
24 +(NSData*)readDataAtPath:(NSString*)path error:(NSError**)error;
25 +(size_t)readData:(void*)dataBuf atPath:(NSString*)path offset:(long)offset
26  length:(size_t)length error:(NSError**)error;
27 +(size_t)readDataInBuffer:(void**)dataBuf atPath:(NSString*)path offset:(long)offset
28  length:(size_t)length error:(NSError**)error;
29 +(NSInteger)writeData:(NSData*)data atPath:(NSString*)path error:(NSError**)error;
30 +(NSInteger)deleteDataAtPath:(NSString*)path error:(NSError**)error;
31 +(NSInteger)appendData:(NSData*)data atPath:(NSString*)path error:(NSError**)error;
32 +(void)clearTmpDirectory;
33 +(BOOL)setAttributes:(NSDictionary *)attributes ofItemAtPath:(NSString*)path error:(NSError **)error;
34 +(NSDictionary *)attributesOfItemAtPath:(NSString *)path error:(NSError **)error;
35 +(BOOL)fileExistsAtPath:(NSString*)path;
36 +(BOOL)fileExistsAtPath:(NSString*)path isDirectory:(BOOL*)isDirectory;
37 +(NSArray*)contentsOfDirectoryAtPath:(NSString*)path error:(NSError**)error;
38 +(BOOL)removeItemAtPath:(NSString*)path error:(NSError**)error;
39 +(BOOL)createDirectoryAtPath:(NSString*)path withIntermediateDirectories:(BOOL)createIntermediates
40  attributes:(NSDictionary*)attributes error:(NSError**)error;
41 +(BOOL)createFileAtPath:(NSString*)path contents:(NSData*)contents attributes:(NSDictionary*)attributes;
42 +(NSInteger)moveItemAtPath:(NSString*)path toPath:(NSString*)toPath error:(NSError**)error;
43 +(NSInteger)copyItemAtPath:(NSString*)path toPath:(NSString*)toPath error:(NSError**)error;
44 +(void)waitUntilUnlockOperationIsFinished;
45 +(NSOutputStream*)newOutputStreamToFileAtPath:(NSString*)filePath append:(BOOL)append;
46 +(NSInputStream*)newInputStreamWithFileAtPath:(NSString*)filePath;
47 +(void)writeDictionary:(NSDictionary*)dictionary toFileAtPath:(NSString*)filePath;
48 +(NSDictionary*)dictionaryAtFilePath:(NSString*)filePath;
49 +(NSString *)mimeTypeForFileAtPath:(NSString *)path;
50 +(NSArray*)subpathsAtPath:(NSString *)path;
51 +(BOOL)isMappedFileSupported;
52 +(NSData*)readDataWithNoProtectionAtPath:(NSString*)path error:(NSError**)error encrypt:(bool)encrypt;
53 +(NSInteger)writeDataWithNoProtection:(NSData*)data atPath:(NSString*)path error:(NSError**)error encrypt:(bool)encrypt;
54 +(NSInteger)appendDataWithNoProtection:(NSData*)data atPath:(NSString*)path error:(NSError**)error encrypt:(bool)encrypt;
55 +(long long)decryptDataAtPath:(NSString*)path;
56 +(void)stopAllFileOperations;
57 +(void)startAllFileOperations;
58 +(size_t)incrementalDecryptSoftwareEncryptedDataAtPath:(NSString*)path;
59 +(NSString *) decryptedExternalFileForFileAtPath:(NSString *)encryptedFilePath;
60 +(void) removeDecryptedFileForFile:(NSString *)file;
61 @end
62 
63 
64 
signed char BOOL
Definition: PDCwtypes.h:101
Definition: FileUtils.h:16