session-ios/SignalServiceKit/src/Storage/OWSOrphanedDataCleaner.h

31 lines
864 B
C
Raw Normal View History

//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
2017-07-07 16:26:09 +02:00
NS_ASSUME_NONNULL_BEGIN
// Notes:
//
// * On disk, we only bother cleaning up files, not directories.
// * For code simplicity, we don't guarantee that everything is
// cleaned up in a single pass. If an interaction is cleaned up,
// it's attachments might not be cleaned up until the next pass.
// If an attachment is cleaned up, it's file on disk might not
// be cleaned up until the next pass.
@interface OWSOrphanedDataCleaner : NSObject
- (instancetype)init NS_UNAVAILABLE;
+ (void)auditAsync;
2017-07-07 16:26:09 +02:00
// completion, if present, will be invoked on the main thread.
2017-12-01 01:57:56 +01:00
+ (void)auditAndCleanupAsync:(void (^_Nullable)(void))completion;
2017-07-07 16:26:09 +02:00
+ (NSSet<NSString *> *)filePathsInAttachmentsFolder;
+ (long long)fileSizeOfFilePaths:(NSArray<NSString *> *)filePaths;
@end
2017-07-07 16:26:09 +02:00
NS_ASSUME_NONNULL_END