2017-07-04 18:42:33 +02:00
|
|
|
//
|
|
|
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
|
|
|
//
|
2016-07-28 04:29:27 +02:00
|
|
|
|
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.
|
2016-07-28 04:29:27 +02:00
|
|
|
@interface OWSOrphanedDataCleaner : NSObject
|
|
|
|
|
2017-07-04 18:42:33 +02:00
|
|
|
- (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;
|
2016-07-28 04:29:27 +02:00
|
|
|
|
|
|
|
@end
|
2017-07-07 16:26:09 +02:00
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|