Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature/shortcuts] iOS 13 Add Shortcut parameter support #491

Merged
merged 109 commits into from
Nov 26, 2019
Merged
Show file tree
Hide file tree
Changes from 99 commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
65028ae
Naming improvements based on latest SDK:
felix-schwarz Jun 30, 2019
9b4a828
#393 added an activity indicator which will be shown, if offline copi…
hosy Jul 3, 2019
94f2632
Merge branch 'master' into feature/naming
felix-schwarz Jul 4, 2019
2c00907
- Change SDK branch to master
felix-schwarz Jul 4, 2019
ce2fc9c
#76 user can import files using the iOS share sheet. all file types a…
hosy Jul 8, 2019
10e0928
Merge remote-tracking branch 'origin/master' into feature/naming
felix-schwarz Jul 8, 2019
f2480b4
- using new SDK with fixes for requesting core
hosy Jul 8, 2019
09b6e63
- Log device, version and locale information at the beginning of ever…
felix-schwarz Jul 8, 2019
ebc7dc3
fixed crash, changed bookmark name to shortname
hosy Jul 9, 2019
de7d854
changed UIAlertViewController for account selection to CardViewContro…
hosy Jul 9, 2019
af29a59
fixed icon badge creation for fastlane lane In-House Enterprise IPA g…
hosy Jul 10, 2019
1774cc9
install librsvg for fastlane via sh
hosy Jul 10, 2019
f212713
moved import file code to own class
hosy Jul 10, 2019
6a09780
added option to automatically resolve name conflicts, if file name al…
hosy Jul 10, 2019
f650478
Changed app version to 1.1.0
hosy Jul 10, 2019
a55e85f
enabled beta build and warning
hosy Jul 10, 2019
dcc0231
Keep the gallery alive after doing some action over an item (#447)
mneuwert Jul 10, 2019
be14b82
Media player implemented using AVKit (#429)
mneuwert Jul 10, 2019
78d8b03
Merge branch 'feature/log-info' into milestone/1.1
hosy Jul 10, 2019
d2e1467
Merge branch 'fix/delete-offline-activity-indicator' into milestone/1.1
hosy Jul 10, 2019
415a593
Merge branch 'feature/naming' into milestone/1.1
hosy Jul 10, 2019
6611dd4
Display error message in case file couldn’t be preview e.g. due to fi…
mneuwert Jul 10, 2019
4077876
Merge branch 'milestone/1.1' of github.com:owncloud/ios-app into mile…
hosy Jul 10, 2019
78ff966
Fixed UI test for creating folder, need to return a fixed name, becau…
hosy Jul 11, 2019
8be02df
added a description header and changed typo
hosy Jul 11, 2019
a1cf538
- fixed showing the directory picker controller, after the card view …
hosy Jul 12, 2019
4d4f10c
Merge branch 'milestone/1.1' into feature/share-sheet
hosy Jul 12, 2019
9dd6f9d
Version Bump to 126
Jul 12, 2019
9c935fe
- create local copy of import file, if needed
hosy Jul 15, 2019
0e5c4c2
- improved duplicate item deletion behaviour
felix-schwarz Jul 15, 2019
30cae47
Merge branch 'feature/share-sheet' into milestone/1.1
hosy Jul 15, 2019
992005c
Version Bump to 127
Jul 15, 2019
8e88a12
changed back signing identity
hosy Jul 15, 2019
4d18c69
Merge branch 'milestone/1.1' of github.com:owncloud/ios-app into mile…
hosy Jul 15, 2019
97212f1
Version Bump to 128
Jul 15, 2019
8759a3a
added required CFBundleTypeName key
hosy Jul 15, 2019
8ac51f9
Merge branch 'milestone/1.1' of github.com:owncloud/ios-app into mile…
hosy Jul 15, 2019
39e6172
Version Bump to 129
Jul 15, 2019
bd0732b
updated changelog
hosy Jul 15, 2019
216b1d6
use formSheet presentation style for the iPad when showing the docume…
hosy Jul 16, 2019
2e76789
Fix for images not being displayed in the gallery
mneuwert Jul 16, 2019
f39b614
Version Bump to 130
Jul 16, 2019
cab565c
Version Bump to 131
Jul 19, 2019
e7eaac8
[fix/sharing-search] Fixed min length for searching sharing users (#455)
hosy Jul 19, 2019
642a788
- Update ios-sdk to address finding (1) in ios-app #446
felix-schwarz Jul 23, 2019
92befda
Preventing updating UI in DisplayViewController while item is being c…
mneuwert Jul 23, 2019
1455467
Fixed a small warning
mneuwert Jul 23, 2019
483c4c1
Merge branch 'milestone/1.1' of https://github.com/owncloud/ios-app i…
mneuwert Jul 23, 2019
7b67d40
Tried to improve gallery logic concerning items modification
mneuwert Jul 23, 2019
3952a14
Added a setting allowing to decide user if media files shall be streamed
mneuwert Jul 23, 2019
5474b06
- Add debug output to Display*ViewController
felix-schwarz Jul 25, 2019
a043012
Fixed handling of deleted / moved item in the gallery
mneuwert Jul 25, 2019
a25823c
Merge branch 'milestone/1.1' of https://github.com/owncloud/ios-app i…
mneuwert Jul 25, 2019
5680ca8
Another small fix for handling of failed item move
mneuwert Jul 25, 2019
6374107
Version Bump to 132
Jul 26, 2019
2b3cba8
Added LSSupportsOpeningDocumentsInPlace key to Info.plist
mneuwert Jul 26, 2019
83a30cc
Merge branch 'milestone/1.1' of https://github.com/owncloud/ios-app i…
mneuwert Jul 26, 2019
034c7ed
Fixed Info.plist and added LSHandlerRank property
mneuwert Jul 26, 2019
1cbecd4
Fix for #455 issue: no search request triggered
mneuwert Jul 26, 2019
6961b9b
#463 Add Shortcut support with Parameters (iOS 13)
hosy Jul 30, 2019
d4fcad5
fixed save file intent, use security scope for copying file
hosy Jul 30, 2019
ff1c368
added create folder intent action
hosy Jul 31, 2019
c13b936
- removed progress instance variable
hosy Jul 31, 2019
882f3a8
added accept custom file types for parameter INFile
hosy Jul 31, 2019
2d62879
show always the account selection sheet and added a note, that only o…
hosy Jul 31, 2019
8caf9a7
use securtiy scoped file operation for importing a file
hosy Aug 1, 2019
640047e
Fix for the PR #447 (keep gallery alive) (#465)
mneuwert Aug 1, 2019
afd9053
[feature/bundle-import] Add support for certain bundle formats to the…
felix-schwarz Aug 8, 2019
57b855f
Version Bump to 133
Aug 9, 2019
dd6b625
[feature/sort direction] Allow sorting asc/desc for all sort methods …
hosy Aug 9, 2019
7bb5c4f
[fix/index-bar] Make Index Bar available in general file list (#469)
hosy Aug 9, 2019
349e7cf
Version Bump to 134
Aug 9, 2019
f89b344
Merge remote-tracking branch 'origin/master' into milestone/1.1
felix-schwarz Aug 13, 2019
869c86d
Version Bump to 135
Aug 13, 2019
934766f
Version Bump to 136
Aug 16, 2019
285f34a
Change behaviour of default expiration date (#476)
mneuwert Aug 16, 2019
de76821
Permission increasing UX in reshares (#467)
mneuwert Aug 19, 2019
efb7c27
Version Bump to 137
Aug 23, 2019
e973151
added Get File Info Intent
hosy Aug 27, 2019
32b5412
[feature/itempolicy] Item Policy / Available Offline support (#456)
felix-schwarz Aug 29, 2019
da38be2
- added error handling
hosy Aug 29, 2019
78329e9
Merge branch 'milestone/1.1' into feature/shortcuts
hosy Aug 29, 2019
1d28fa7
improved failure handling
hosy Aug 29, 2019
cabd3ef
added Intent for checking if a given path exists
hosy Aug 30, 2019
74d81e0
improved variable check
hosy Aug 30, 2019
7b08259
added Delete Item at Path Intent handler
hosy Aug 30, 2019
25d6275
return path for created folder and saved file in shortcuts intents
hosy Aug 30, 2019
03aeb0d
- changed all intent handler to provide accounts
hosy Sep 9, 2019
b626b3a
removed privateLink property from FileInfo
hosy Sep 9, 2019
804994b
- added sort type and sort direction WIP
hosy Sep 10, 2019
f90c172
Implemented Sort Direction and Sort Type for Directory Listing
hosy Sep 10, 2019
5ad46d4
adopt fastlane file for new "Intent" target
hosy Sep 11, 2019
c3a171c
code signing changes for fastlane
hosy Sep 11, 2019
c33bf32
- fixed validation errors on AppStore connect upload
hosy Sep 17, 2019
8b504ab
fixed crash on OS version below iOS 13
hosy Sep 18, 2019
656f0ef
removing type identifier, because files of type "text/plain" was not …
hosy Sep 23, 2019
dedd8a4
added optional parameter "filename" for SaveFileIntent
hosy Sep 23, 2019
d182d7a
added setting optional file extension
hosy Sep 25, 2019
6da800c
added localization support for Siri Intents
hosy Sep 25, 2019
1bac629
Code refactoring after code review findings
hosy Sep 26, 2019
ca6b6c4
Merge branch 'milestone/1.2' into feature/shortcuts
hosy Sep 26, 2019
d19d042
- code refactoring
hosy Sep 27, 2019
e065151
- moved shared code from app to framework
hosy Oct 2, 2019
7ae51e8
moved shared file to framework
hosy Oct 2, 2019
7ff86b4
- Update SDK to include latest fixes, including for the latest "/Docu…
felix-schwarz Oct 11, 2019
da9b40c
- correct the targeted commit for the ios-sdk git module
felix-schwarz Oct 11, 2019
412f103
Merge branch 'milestone/1.2' into feature/shortcuts
hosy Oct 21, 2019
46452ef
Merge branch 'milestone/1.2' into feature/shortcuts
hosy Oct 29, 2019
4de7edd
Merge branch 'milestone/1.3' into feature/shortcuts
hosy Nov 26, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
excluded:
- ownCloudTests
- ownCloudScreenshotsTests
- external

function_body_length: 100
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@
- Fixed background crash (PR #462)
- Log file improvements (#444)

## TestFlight Build 129 (July 2019)

- Import files from Share Sheet (#76)
- Create Folder in Directory Picker (#443)

## TestFlight Build 126 (July 2019)

- Native Media Player, with support for streaming (#395)
- Name Conflict Detection (#377)
- Activity Indicator for deleting offline copies (#393)
- Improved Log File (#446)
- Image Gallery improvement (#322)
- Error handling for corrupted files (#357)

## Release version 1.0.3 (July 2019)

- Add support for local user names with @ inside in sharing (PR #453)
Expand Down
Binary file modified design/cloud-symbols-thick.idraw
Binary file not shown.
39 changes: 35 additions & 4 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ platform :ios do
provisioningProfiles: {
"com.owncloud.ios-app" => "match AdHoc com.owncloud.ios-app",
"com.owncloud.ios-app.ownCloud-File-Provider" => "match AdHoc com.owncloud.ios-app.ownCloud-File-Provider",
"com.owncloud.ios-app.ownCloud-File-ProviderUI" => "match AdHoc com.owncloud.ios-app.ownCloud-File-ProviderUI"
"com.owncloud.ios-app.ownCloud-File-ProviderUI" => "match AdHoc com.owncloud.ios-app.ownCloud-File-ProviderUI",
"com.owncloud.ios-app.ownCloud-File-Intents" => "match AdHoc com.owncloud.ios-app.ownCloud-Intents"
#Add more Provisioning Profiles when extensions are added
}
}
Expand Down Expand Up @@ -71,6 +72,8 @@ platform :ios do
ENTERPRISE_FP_PROFILE = "Enterprise Distribution iOS Neo File Provider"
ENTERPRISE_FP_UI_ID = "com.owncloud.enterprise.ios-app.ownCloud-File-ProviderUI"
ENTERPRISE_FP_UI_PROFILE = "Enterprise Distribution iOS Neo File ProviderUI"
ENTERPRISE_INTENT_ID = "com.owncloud.enterprise.ios-app.ownCloud-Intents"
ENTERPRISE_INTENT_PROFILE = "Enterprise Distribution iOS Neo Intent"
ENTERPRISE_APP_FW_ID = "com.owncloud.enterprise.ownCloudApp"
ENTERPRISE_TEAM = "5QNK8L2PSC"
ENTERPRISE_IDENTITY = "iPhone Distribution: ownCloud GmbH"
Expand All @@ -95,10 +98,16 @@ platform :ios do

update_app_identifier(
xcodeproj: "ownCloud.xcodeproj",
plist_path: "ownCloudAppFramework/Info.plist",
plist_path: "ownCloudAppFramework/Resources/Info.plist",
app_identifier: ENTERPRISE_APP_FW_ID
)

update_app_identifier(
xcodeproj: "ownCloud.xcodeproj",
plist_path: "ownCloud Intents/Info.plist",
app_identifier: ENTERPRISE_INTENT_ID
)

update_app_group_identifiers(
entitlements_file: "ownCloud/ownCloud.entitlements",
app_group_identifiers: ["group.com.owncloud.enterprise.ios-app"]
Expand All @@ -109,10 +118,18 @@ platform :ios do
app_group_identifiers: ["group.com.owncloud.enterprise.ios-app"]
)

update_app_group_identifiers(
entitlements_file: "ownCloud Intents/ownCloud Intents.entitlements",
app_group_identifiers: ["group.com.owncloud.enterprise.ios-app"]
)

set_info_plist_value(path: "ownCloud File Provider/Info.plist", key: "OCAppGroupIdentifier", value: "group.com.owncloud.enterprise.ios-app")
set_info_plist_value(path: "ownCloud File Provider/Info.plist", key: "OCKeychainAccessGroupIdentifier", value: "group.com.owncloud.enterprise.ios-app")
set_info_plist_value(path: "ownCloud File Provider/Info.plist", key: "NSExtension", subkey: "NSExtensionFileProviderDocumentGroup", value: "group.com.owncloud.enterprise.ios-app")

set_info_plist_value(path: "ownCloud Intents/Info.plist", key: "OCAppGroupIdentifier", value: "group.com.owncloud.enterprise.ios-app")
set_info_plist_value(path: "ownCloud Intents/Info.plist", key: "OCKeychainAccessGroupIdentifier", value: "group.com.owncloud.enterprise.ios-app")

automatic_code_signing(
path: "ownCloud.xcodeproj",
use_automatic_signing: false,
Expand Down Expand Up @@ -143,6 +160,16 @@ platform :ios do
targets: ["ownCloud File ProviderUI"]
)

automatic_code_signing(
path: "ownCloud.xcodeproj",
use_automatic_signing: false,
team_id: ENTERPRISE_TEAM,
code_sign_identity: ENTERPRISE_IDENTITY,
profile_name: ENTERPRISE_INTENT_PROFILE,
bundle_identifier: ENTERPRISE_INTENT_ID,
targets: ["ownCloud Intents"]
)

automatic_code_signing(
path: "ownCloud.xcodeproj",
use_automatic_signing: false,
Expand All @@ -155,7 +182,10 @@ platform :ios do
# Add a badge with the latest short commit hash to the app icon
commit = last_git_commit
short_hash = commit[:abbreviated_commit_hash] # short sha of commit
add_badge(shield: "Bitrise-" + short_hash + "-blue", no_badge: true)
sh "curl https://badgen.net/badge/Bitrise/" + short_hash + "/blue > badge.svg"
sh "brew install librsvg"
sh "rsvg-convert badge.svg > badge.png"
sh "badge --custom badge.png --glob /../**/*.appiconset/*.{png,PNG}"

#Create the build
gym(
Expand All @@ -169,7 +199,8 @@ platform :ios do
provisioningProfiles: {
ENTERPRISE_APP_ID => ENTERPRISE_APP_PROFILE,
ENTERPRISE_FP_ID => ENTERPRISE_FP_PROFILE,
ENTERPRISE_FP_UI_ID => ENTERPRISE_FP_UI_PROFILE
ENTERPRISE_FP_UI_ID => ENTERPRISE_FP_UI_PROFILE,
ENTERPRISE_INTENT_ID => ENTERPRISE_INTENT_PROFILE
}
}
)
Expand Down
8 changes: 8 additions & 0 deletions img/filetypes/icon-available-offline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion ios-sdk
Submodule ios-sdk updated 110 files
2 changes: 2 additions & 0 deletions ownCloud File Provider/FileProviderExtension.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

@end

extern OCClaimExplicitIdentifier OCClaimExplicitIdentifierFileProvider;

#define FPLogCmdBegin(command, format,...) \
NSString *actionLogCmdUUID = nil; \
NSArray *actionLogTags = nil; \
Expand Down
171 changes: 15 additions & 156 deletions ownCloud File Provider/FileProviderExtension.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

#import <ownCloudSDK/ownCloudSDK.h>
#import <libzip/libzip.h>
#import <ownCloudApp/ownCloudApp.h>

#import "FileProviderExtension.h"
#import "FileProviderEnumerator.h"
Expand Down Expand Up @@ -223,7 +223,11 @@ - (void)startProvidingItemAtURL:(NSURL *)provideAtURL completionHandler:(void (^
{
FPLogCmdBegin(@"StartProviding", @"Downloading %@", item);

[self.core downloadItem:(OCItem *)item options:nil resultHandler:^(NSError *error, OCCore *core, OCItem *item, OCFile *file) {
[self.core downloadItem:(OCItem *)item options:@{

OCCoreOptionAddFileClaim : [OCClaim claimForLifetimeOfCore:core explicitIdentifier:OCClaimExplicitIdentifierFileProvider]

} resultHandler:^(NSError *error, OCCore *core, OCItem *item, OCFile *file) {
OCLogDebug(@"Starting to provide file:\nPAU: %@\nFURL: %@\nID: %@\nErr: %@\nlocalRelativePath: %@", provideAtURL, file.url, item.itemIdentifier, error, item.localRelativePath);

if ([error isOCErrorWithCode:OCErrorCancelled])
Expand Down Expand Up @@ -330,6 +334,9 @@ - (void)stopProvidingItemAtURL:(NSURL *)url
}

FPLogCmd(@"Item %@ is downloading %d: %@", item, item.isDownloading, downloadProgress);

// Remove temporary FileProvider claim
[core removeClaimsWithExplicitIdentifier:OCClaimExplicitIdentifierFileProvider onItem:(OCItem *)item refreshItem:YES completionHandler:nil];
}
}

Expand Down Expand Up @@ -503,102 +510,6 @@ - (void)deleteItemWithIdentifier:(NSFileProviderItemIdentifier)itemIdentifier co
}
}

+ (NSError *)compressContentsOf:(NSURL *)sourceDirectory asZipFile:(NSURL *)zipFileURL
{
zip_t *zipArchive = NULL;
int zipError = ZIP_ER_OK;
NSError *error = nil;
NSErrorDomain LibZipErrorDomain = @"LibZIPErrorDomain";
NSError *(^ErrorFromZipArchive)(zip_t *zipArchive) = ^(zip_t *zipArchive) {
zip_error_t *zipError = zip_get_error(zipArchive);

return ([NSError errorWithDomain:LibZipErrorDomain code:zipError->zip_err userInfo:nil]);
};

if ((zipArchive = zip_open(zipFileURL.path.UTF8String, ZIP_CREATE, &zipError)) != NULL)
{
NSDirectoryEnumerator<NSURL *> *directoryEnumerator;

NSUInteger basePathLength = sourceDirectory.path.length;

if (![sourceDirectory.path hasSuffix:@"/"])
{
basePathLength++;
}

if ((directoryEnumerator = [[NSFileManager defaultManager] enumeratorAtURL:sourceDirectory includingPropertiesForKeys:@[NSURLFileSizeKey,NSURLIsDirectoryKey] options:0 errorHandler:nil]) != nil)
{
for (NSURL *addURL in directoryEnumerator)
{
zip_source_t *fileSource = NULL;
NSNumber *isDirectory = nil, *size = nil;
NSString *relativePath = [addURL.path substringFromIndex:basePathLength];

if (relativePath.length == 0)
{
continue;
}

[addURL getResourceValue:&isDirectory forKey:NSURLIsDirectoryKey error:nil];
[addURL getResourceValue:&size forKey:NSURLFileSizeKey error:nil];

if (isDirectory.boolValue)
{
// Add directory
OCLogDebug(@"Adding directory %@ from %@", relativePath, addURL);

if (zip_dir_add(zipArchive, relativePath.UTF8String, ZIP_FL_ENC_UTF_8) < 0)
{
// Error
error = ErrorFromZipArchive(zipArchive);
OCLogError(@"Error adding directory %@: %@", relativePath, error);
}
}
else
{
// Add file
OCLogDebug(@"Adding file %@ from %@", relativePath, addURL);

if ((fileSource = zip_source_file(zipArchive, addURL.path.UTF8String, 0, (zip_int64_t)size.unsignedIntegerValue)) != NULL)
{
if (zip_file_add(zipArchive, relativePath.UTF8String, fileSource, ZIP_FL_ENC_UTF_8) < 0)
{
// Error
error = ErrorFromZipArchive(zipArchive);
OCLogError(@"Error compressing %@: %@", relativePath, error);

zip_source_free(fileSource);
}
}
else
{
// Error
error = ErrorFromZipArchive(zipArchive);
OCLogError(@"Error adding directory %@: %@", relativePath, error);
}
}
}
}

if (zip_close(zipArchive) < 0)
{
// Error
error = ErrorFromZipArchive(zipArchive);
OCLogError(@"Error closing zip archive %@: %@", zipFileURL.path, error);

zip_discard(zipArchive);
}
}
else
{
// Error
error = [NSError errorWithDomain:LibZipErrorDomain code:zipError userInfo:nil];
OCLogError(@"Error opening zip archive %@: %@", zipFileURL.path, error);
}

return (error);
}

- (void)importDocumentAtURL:(NSURL *)fileURL toParentItemIdentifier:(NSFileProviderItemIdentifier)parentItemIdentifier completionHandler:(void (^)(NSFileProviderItem _Nullable, NSError * _Nullable))completionHandler
{
NSError *error = nil;
Expand Down Expand Up @@ -629,7 +540,6 @@ - (void)importDocumentAtURL:(NSURL *)fileURL toParentItemIdentifier:(NSFileProvi
{
// Detect name collissions
OCItem *existingItem;
OCCoreImportTransformation transformation = nil;

if ((existingItem = [self.core cachedItemInParent:parentItem withName:importFileName isDirectory:NO error:NULL]) != nil)
{
Expand All @@ -641,63 +551,10 @@ - (void)importDocumentAtURL:(NSURL *)fileURL toParentItemIdentifier:(NSFileProvi

FPLogCmd(@"Importing %@ at %@ fromURL %@", importFileName, parentItem, fileURL);

NSString *resourceType=nil;
if ([fileURL getResourceValue:&resourceType forKey:NSURLFileResourceTypeKey error:&error])
{
FPLogCmd(@"Importing resourceType=%@", resourceType);

if ([resourceType isEqual:NSURLFileResourceTypeDirectory])
{
NSString *bundleType = fileURL.pathExtension.lowercaseString;

if ([bundleType isEqual:@"pages"] || // Pages
[bundleType isEqual:@"key"]) // Keynote
{
// Special handling for Pages and Keynote files
FPLogCmd(@"Importing with transformer for bundle-document of type=%@", bundleType);

transformation = ^(NSURL *sourceURL) {
NSError *error = nil;
NSURL *zipURL = [sourceURL URLByAppendingPathExtension:@".zip"];

if ((error = [FileProviderExtension compressContentsOf:sourceURL asZipFile:zipURL]) == nil)
{
if ([[NSFileManager defaultManager] removeItemAtURL:sourceURL error:&error])
{
if (![[NSFileManager defaultManager] moveItemAtURL:zipURL toURL:sourceURL error:&error])
{
FPLogCmd(@"Moving %@ to %@ failed with error=%@", OCLogPrivate(zipURL), OCLogPrivate(sourceURL), OCLogPrivate(error));
}
}
else
{
FPLogCmd(@"Removing %@ failed with error=%@", OCLogPrivate(sourceURL), OCLogPrivate(error));
}
}
else
{
FPLogCmd(@"Compressing %@ as %@ failed with error=%@", OCLogPrivate(sourceURL), OCLogPrivate(zipURL), OCLogPrivate(error));
}

FPLogCmd(@"Import transformation finished with error=%@", error);

return (error);
};
}
else
{
// Import of directories not supported
completionHandler(nil, [OCError(OCErrorFeatureNotSupportedForItem) resolvedError]);
return;
}
}
}

// Start import
[self.core importFileNamed:importFileName at:parentItem fromURL:fileURL isSecurityScoped:YES options:[NSDictionary dictionaryWithObjectsAndKeys:
@(importByCopying), OCCoreOptionImportByCopying,
[transformation copy], OCCoreOptionImportTransformation,
nil] placeholderCompletionHandler:^(NSError *error, OCItem *item) {
// Import item
[self.core importItemNamed:importFileName at:parentItem fromURL:fileURL isSecurityScoped:YES options:@{
OCCoreOptionImportByCopying : @(importByCopying)
} placeholderCompletionHandler:^(NSError *error, OCItem *item) {
FPLogCmd(@"Completed with placeholderItem=%@, error=%@", item, error);
completionHandler(item, [error resolvedError]);
} resultHandler:^(NSError *error, OCCore *core, OCItem *item, id parameter) {
Expand Down Expand Up @@ -1037,3 +894,5 @@ - (void)core:(OCCore *)core handleError:(NSError *)error issue:(OCIssue *)issue
}

@end

OCClaimExplicitIdentifier OCClaimExplicitIdentifierFileProvider = @"fileProvider";
2 changes: 1 addition & 1 deletion ownCloud File Provider/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>$(APP_SHORT_VERSION)</string>
<key>CFBundleVersion</key>
<string>130</string>
<string>137</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionFileProviderDocumentGroup</key>
Expand Down
2 changes: 1 addition & 1 deletion ownCloud File ProviderUI/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>$(APP_SHORT_VERSION)</string>
<key>CFBundleVersion</key>
<string>130</string>
<string>137</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionFileProviderActions</key>
Expand Down
Loading