Browse Source

add fileid (id) on OCFileDto

Marino Faggiana 6 years ago
parent
commit
51dded4a69

+ 1 - 0
iOSClient/Library/OCCommunicationLib/OCFileDto.h

@@ -46,6 +46,7 @@
 @property (nonatomic, copy) NSString *etag;
 @property (nonatomic, copy) NSString *permissions;
 @property (nonatomic, copy) NSString *ocId;
+@property double id;
 @property BOOL isFavorite;
 @property BOOL isEncrypted;
 @property (nonatomic, copy) NSString *trashbinFileName;

+ 1 - 0
iOSClient/Library/OCCommunicationLib/OCFileDto.m

@@ -40,6 +40,7 @@
         self.etag = @"";
         self.permissions = @"";
         self.ocId = @"";
+        self.id = 0;
         self.trashbinFileName = @"";
         self.trashbinOriginalLocation = @"";
     }

+ 2 - 2
iOSClient/Library/OCCommunicationLib/OCWebDavClient/OCWebDAVClient.m

@@ -217,7 +217,7 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
 	NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil timeout:k_timeout_webdav];
     
     [request setValue: depth forHTTPHeaderField: @"Depth"];
-    [request setHTTPBody:[@"<?xml version=\"1.0\" encoding=\"UTF-8\"?><D:propfind xmlns:D=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\"><D:prop><D:resourcetype/><D:getlastmodified/><size xmlns=\"http://owncloud.org/ns\"/><favorite xmlns=\"http://owncloud.org/ns\"/><id xmlns=\"http://owncloud.org/ns\"/><D:getcontentlength/><D:getetag/><permissions xmlns=\"http://owncloud.org/ns\"/><D:getcontenttype/><nc:is-encrypted/><nc:has-preview/></D:prop></D:propfind>" dataUsingEncoding:NSUTF8StringEncoding]];
+    [request setHTTPBody:[@"<?xml version=\"1.0\" encoding=\"UTF-8\"?><D:propfind xmlns:D=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\"><D:prop><D:resourcetype/><D:getlastmodified/><size xmlns=\"http://owncloud.org/ns\"/><favorite xmlns=\"http://owncloud.org/ns\"/><id xmlns=\"http://owncloud.org/ns\"/><D:getcontentlength/><D:getetag/><oc:fileid/><permissions xmlns=\"http://owncloud.org/ns\"/><D:getcontenttype/><nc:is-encrypted/><nc:has-preview/></D:prop></D:propfind>" dataUsingEncoding:NSUTF8StringEncoding]];
     [request setValue:@"application/xml" forHTTPHeaderField:@"Content-Type"];
     
     
@@ -236,7 +236,7 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
     NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil timeout:k_timeout_webdav];
     
     [request setValue: depth forHTTPHeaderField: @"Depth"];
-    [request setHTTPBody:[@"<?xml version=\"1.0\" encoding=\"UTF-8\"?><D:propfind xmlns:D=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\"><D:prop><D:resourcetype/><D:getlastmodified/><size xmlns=\"http://owncloud.org/ns\"/><favorite xmlns=\"http://owncloud.org/ns\"/><id xmlns=\"http://owncloud.org/ns\"/><D:getcontentlength/><D:getetag/><permissions xmlns=\"http://owncloud.org/ns\"/><D:getcontenttype/><nc:is-encrypted/><nc:has-preview/></D:prop></D:propfind>" dataUsingEncoding:NSUTF8StringEncoding]];
+    [request setHTTPBody:[@"<?xml version=\"1.0\" encoding=\"UTF-8\"?><D:propfind xmlns:D=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\"><D:prop><D:resourcetype/><D:getlastmodified/><size xmlns=\"http://owncloud.org/ns\"/><favorite xmlns=\"http://owncloud.org/ns\"/><id xmlns=\"http://owncloud.org/ns\"/><D:getcontentlength/><D:getetag/><oc:fileid/><permissions xmlns=\"http://owncloud.org/ns\"/><D:getcontenttype/><nc:is-encrypted/><nc:has-preview/></D:prop></D:propfind>" dataUsingEncoding:NSUTF8StringEncoding]];
     [request setValue:@"application/xml" forHTTPHeaderField:@"Content-Type"];
     
     

+ 2 - 1
iOSClient/Library/OCCommunicationLib/OCWebDavClient/Parsers/OCXMLListParser.m

@@ -158,7 +158,8 @@
         
     } else if ([elementName isEqualToString:@"oc:id"]) {
         _currentFile.ocId = _xmlChars;
-        
+    } else if ([elementName isEqualToString:@"oc:fileid"]) {
+        _currentFile.id = (double)[_xmlChars doubleValue];
     } else if ([elementName hasSuffix:@":getetag"] && [_xmlChars length]) {
         
         //ETAG

+ 2 - 1
iOSClient/Library/OCCommunicationLib/OCWebDavClient/Parsers/OCXMLParser.m

@@ -199,7 +199,8 @@ NSString *OCCWebDAVURIKey           = @"uri";
         
     } else if ([elementName isEqualToString:@"oc:id"]) {
         _currentFile.ocId = _xmlChars;
-        
+    } else if ([elementName isEqualToString:@"oc:fileid"]) {
+        _currentFile.id = (double)[_xmlChars doubleValue];
     } else if ([elementName hasSuffix:@":getetag"] && [_xmlChars length]) {
         
         //ETAG