Support for splitting archive
This commit is contained in:
@@ -657,7 +657,7 @@ BOOL _fileIsSymbolicLink(const unz_file_info *fileInfo);
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray<NSString *> *)paths withPassword:(NSString *)password
|
||||
{
|
||||
SSZipArchive *zipArchive = [[SSZipArchive alloc] initWithPath:path];
|
||||
BOOL success = [zipArchive openWithSplitSize:0];
|
||||
BOOL success = [zipArchive open];
|
||||
if (success) {
|
||||
for (NSString *filePath in paths) {
|
||||
success &= [zipArchive writeFile:filePath withPassword:password];
|
||||
@@ -689,6 +689,16 @@ BOOL _fileIsSymbolicLink(const unz_file_info *fileInfo);
|
||||
return [self createZipFileAtPath:path withContentsOfDirectory:directoryPath keepParentDirectory:keepParentDirectory compressionLevel:Z_DEFAULT_COMPRESSION password:password AES:YES diskSize:0 progressHandler:progressHandler];
|
||||
}
|
||||
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path
|
||||
withContentsOfDirectory:(NSString *)directoryPath
|
||||
keepParentDirectory:(BOOL)keepParentDirectory
|
||||
compressionLevel:(int)compressionLevel
|
||||
password:(nullable NSString *)password
|
||||
AES:(BOOL)aes
|
||||
progressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler {
|
||||
return [self createZipFileAtPath:path withContentsOfDirectory:directoryPath keepParentDirectory:keepParentDirectory compressionLevel:compressionLevel password:password AES:aes diskSize:0 progressHandler:progressHandler];
|
||||
}
|
||||
|
||||
+ (BOOL)createZipFileAtPath:(NSString *)path
|
||||
withContentsOfDirectory:(NSString *)directoryPath
|
||||
keepParentDirectory:(BOOL)keepParentDirectory
|
||||
@@ -749,6 +759,11 @@ BOOL _fileIsSymbolicLink(const unz_file_info *fileInfo);
|
||||
return self;
|
||||
}
|
||||
|
||||
- (BOOL)open
|
||||
{
|
||||
return [self openWithSplitSize:0];
|
||||
}
|
||||
|
||||
- (BOOL)openWithSplitSize:(int)disk_size
|
||||
{
|
||||
NSAssert((_zip == NULL), @"Attempting to open an archive which is already open");
|
||||
|
||||
Reference in New Issue
Block a user