|
|
@ -7,12 +7,7 @@ extension WebDavMultistatusFile on WebDavMultistatus { |
|
|
|
/// Convert the [WebDavMultistatus] into a [WebDavFile] for easier handling |
|
|
|
/// Convert the [WebDavMultistatus] into a [WebDavFile] for easier handling |
|
|
|
List<WebDavFile> toWebDavFiles(final WebDavClient client) => responses |
|
|
|
List<WebDavFile> toWebDavFiles(final WebDavClient client) => responses |
|
|
|
.where((final response) => response.href != null) |
|
|
|
.where((final response) => response.href != null) |
|
|
|
.map( |
|
|
|
.map((final response) => WebDavFile(response: response)) |
|
|
|
(final response) => WebDavFile( |
|
|
|
|
|
|
|
basePath: client.basePath, |
|
|
|
|
|
|
|
response: response, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
.toList(); |
|
|
|
.toList(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -20,12 +15,9 @@ extension WebDavMultistatusFile on WebDavMultistatus { |
|
|
|
class WebDavFile { |
|
|
|
class WebDavFile { |
|
|
|
/// Creates a new WebDavFile object with the given path |
|
|
|
/// Creates a new WebDavFile object with the given path |
|
|
|
WebDavFile({ |
|
|
|
WebDavFile({ |
|
|
|
required final String basePath, |
|
|
|
|
|
|
|
required final WebDavResponse response, |
|
|
|
required final WebDavResponse response, |
|
|
|
}) : _basePath = basePath, |
|
|
|
}) : _response = response; |
|
|
|
_response = response; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final String _basePath; |
|
|
|
|
|
|
|
final WebDavResponse _response; |
|
|
|
final WebDavResponse _response; |
|
|
|
|
|
|
|
|
|
|
|
/// Get the props of the file |
|
|
|
/// Get the props of the file |
|
|
@ -34,7 +26,7 @@ class WebDavFile { |
|
|
|
|
|
|
|
|
|
|
|
/// The path of file |
|
|
|
/// The path of file |
|
|
|
late final String path = |
|
|
|
late final String path = |
|
|
|
Uri.decodeFull(_response.href!.substring(Uri.encodeFull(_basePath).length, _response.href!.length)); |
|
|
|
Uri.decodeFull(_response.href!.substring(Uri.encodeFull(webdavBasePath).length, _response.href!.length)); |
|
|
|
|
|
|
|
|
|
|
|
/// The fileid namespaced by the instance id, globally unique |
|
|
|
/// The fileid namespaced by the instance id, globally unique |
|
|
|
late final String? id = props.ocid; |
|
|
|
late final String? id = props.ocid; |
|
|
|