Browse Source

Merge pull request #278 from provokateurin/feature/improve-webdav-props

Improve webdav props
pull/279/head
Kate 2 years ago committed by GitHub
parent
commit
50bf1b0ee1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/neon/neon_files/lib/blocs/browser.dart
  2. 56
      packages/nextcloud/bin/generate_props.dart
  3. 707
      packages/nextcloud/lib/src/webdav/props.dart
  4. 1077
      packages/nextcloud/lib/src/webdav/props.g.dart
  5. 14
      packages/nextcloud/test/webdav.dart

2
packages/neon/neon_files/lib/blocs/browser.dart

@ -46,7 +46,7 @@ class FilesBrowserBloc extends InteractiveBloc implements FilesBrowserBlocEvents
files, files,
() async => client.webdav.ls( () async => client.webdav.ls(
path.value.join('/'), path.value.join('/'),
prop: WebDavPropfindProp( prop: WebDavPropfindProp.fromBools(
davgetcontenttype: true, davgetcontenttype: true,
davgetetag: true, davgetetag: true,
davgetlastmodified: true, davgetlastmodified: true,

56
packages/nextcloud/bin/generate_props.dart

@ -11,14 +11,12 @@ void main() {
final type = prop[2]; final type = prop[2];
final name = prop[1]; final name = prop[1];
final variable = namespacePrefix + name.toLowerCase().replaceAll(RegExp('[^a-z]'), ''); final variable = namespacePrefix + name.toLowerCase().replaceAll(RegExp('[^a-z]'), '');
valueProps.addAll([ valueProps.add(
"@annotation.XmlElement(name: '$name', namespace: $namespaceVariable, includeIfNull: false)", "@annotation.XmlElement(name: '$name', namespace: $namespaceVariable, includeIfNull: false,)\n $type? $variable;",
'$type? $variable;', );
]); findProps.add(
findProps.addAll([ "@annotation.XmlElement(name: '$name', namespace: $namespaceVariable, includeIfNull: true, isSelfClosing: true,)\n List<String?>? $variable;",
"@annotation.XmlElement(name: '$name', namespace: $namespaceVariable, includeIfNull: false)", );
'bool? $variable;',
]);
variables.add(variable); variables.add(variable);
} }
File('lib/src/webdav/props.dart').writeAsStringSync( File('lib/src/webdav/props.dart').writeAsStringSync(
@ -29,9 +27,31 @@ void main() {
"import 'package:xml_annotation/xml_annotation.dart' as annotation;", "import 'package:xml_annotation/xml_annotation.dart' as annotation;",
"part 'props.g.dart';", "part 'props.g.dart';",
'', '',
...generateClass('WebDavPropfindProp', 'prop', 'namespaceDav', findProps, variables), ...generateClass(
...generateClass('WebDavProp', 'prop', 'namespaceDav', valueProps, variables), 'WebDavPropfindProp',
...generateClass('WebDavOcFilterRules', 'filter-rules', 'namespaceOwncloud', valueProps, variables), 'prop',
'namespaceDav',
findProps,
variables,
isPropfind: true,
),
...generateClass(
'WebDavProp',
'prop',
'namespaceDav',
valueProps,
variables,
isPropfind: false,
),
...generateClass(
'WebDavOcFilterRules',
'filter-rules',
'namespaceOwncloud',
valueProps,
variables,
isPropfind: false,
),
'',
].join('\n'), ].join('\n'),
); );
} }
@ -41,8 +61,9 @@ List<String> generateClass(
final String elementName, final String elementName,
final String namespace, final String namespace,
final List<String> props, final List<String> props,
final List<String> variables, final List<String> variables, {
) => required final bool isPropfind,
}) =>
[ [
'@annotation.XmlSerializable(createMixin: true)', '@annotation.XmlSerializable(createMixin: true)',
"@annotation.XmlRootElement(name: '$elementName', namespace: $namespace)", "@annotation.XmlRootElement(name: '$elementName', namespace: $namespace)",
@ -50,8 +71,15 @@ List<String> generateClass(
' $name({', ' $name({',
...variables.map((final variable) => ' this.$variable,'), ...variables.map((final variable) => ' this.$variable,'),
' });', ' });',
'',
if (isPropfind) ...[
' $name.fromBools({',
...variables.map((final variable) => ' final bool $variable = false,'),
' }) : ${variables.map((final variable) => '$variable = $variable ? [null] : null').join(', ')};',
'',
],
' factory $name.fromXmlElement(final XmlElement element) => _\$${name}FromXmlElement(element);', ' factory $name.fromXmlElement(final XmlElement element) => _\$${name}FromXmlElement(element);',
...props.map((final prop) => ' $prop'), ...props.map((final prop) => '\n $prop'),
'}', '}',
]; ];

707
packages/nextcloud/lib/src/webdav/props.dart

@ -36,61 +36,280 @@ class WebDavPropfindProp with _$WebDavPropfindPropXmlSerializableMixin {
this.ocssharepermissions, this.ocssharepermissions,
this.ocmsharepermissions, this.ocmsharepermissions,
}); });
WebDavPropfindProp.fromBools({
final bool davgetlastmodified = false,
final bool davgetetag = false,
final bool davgetcontenttype = false,
final bool davgetcontentlength = false,
final bool davresourcetype = false,
final bool ocid = false,
final bool ocfileid = false,
final bool ocfavorite = false,
final bool occommentshref = false,
final bool occommentscount = false,
final bool occommentsunread = false,
final bool ocdownloadurl = false,
final bool ocownerid = false,
final bool ocownerdisplayname = false,
final bool ocsize = false,
final bool ocpermissions = false,
final bool ncnote = false,
final bool ncdatafingerprint = false,
final bool nchaspreview = false,
final bool ncmounttype = false,
final bool ncisencrypted = false,
final bool ncmetadataetag = false,
final bool ncuploadtime = false,
final bool nccreationtime = false,
final bool ncrichworkspace = false,
final bool ocssharepermissions = false,
final bool ocmsharepermissions = false,
}) : davgetlastmodified = davgetlastmodified ? [null] : null,
davgetetag = davgetetag ? [null] : null,
davgetcontenttype = davgetcontenttype ? [null] : null,
davgetcontentlength = davgetcontentlength ? [null] : null,
davresourcetype = davresourcetype ? [null] : null,
ocid = ocid ? [null] : null,
ocfileid = ocfileid ? [null] : null,
ocfavorite = ocfavorite ? [null] : null,
occommentshref = occommentshref ? [null] : null,
occommentscount = occommentscount ? [null] : null,
occommentsunread = occommentsunread ? [null] : null,
ocdownloadurl = ocdownloadurl ? [null] : null,
ocownerid = ocownerid ? [null] : null,
ocownerdisplayname = ocownerdisplayname ? [null] : null,
ocsize = ocsize ? [null] : null,
ocpermissions = ocpermissions ? [null] : null,
ncnote = ncnote ? [null] : null,
ncdatafingerprint = ncdatafingerprint ? [null] : null,
nchaspreview = nchaspreview ? [null] : null,
ncmounttype = ncmounttype ? [null] : null,
ncisencrypted = ncisencrypted ? [null] : null,
ncmetadataetag = ncmetadataetag ? [null] : null,
ncuploadtime = ncuploadtime ? [null] : null,
nccreationtime = nccreationtime ? [null] : null,
ncrichworkspace = ncrichworkspace ? [null] : null,
ocssharepermissions = ocssharepermissions ? [null] : null,
ocmsharepermissions = ocmsharepermissions ? [null] : null;
factory WebDavPropfindProp.fromXmlElement(final XmlElement element) => _$WebDavPropfindPropFromXmlElement(element); factory WebDavPropfindProp.fromXmlElement(final XmlElement element) => _$WebDavPropfindPropFromXmlElement(element);
@annotation.XmlElement(name: 'getlastmodified', namespace: namespaceDav, includeIfNull: false)
bool? davgetlastmodified; @annotation.XmlElement(
@annotation.XmlElement(name: 'getetag', namespace: namespaceDav, includeIfNull: false) name: 'getlastmodified',
bool? davgetetag; namespace: namespaceDav,
@annotation.XmlElement(name: 'getcontenttype', namespace: namespaceDav, includeIfNull: false) includeIfNull: true,
bool? davgetcontenttype; isSelfClosing: true,
@annotation.XmlElement(name: 'getcontentlength', namespace: namespaceDav, includeIfNull: false) )
bool? davgetcontentlength; List<String?>? davgetlastmodified;
@annotation.XmlElement(name: 'resourcetype', namespace: namespaceDav, includeIfNull: false)
bool? davresourcetype; @annotation.XmlElement(
@annotation.XmlElement(name: 'id', namespace: namespaceOwncloud, includeIfNull: false) name: 'getetag',
bool? ocid; namespace: namespaceDav,
@annotation.XmlElement(name: 'fileid', namespace: namespaceOwncloud, includeIfNull: false) includeIfNull: true,
bool? ocfileid; isSelfClosing: true,
@annotation.XmlElement(name: 'favorite', namespace: namespaceOwncloud, includeIfNull: false) )
bool? ocfavorite; List<String?>? davgetetag;
@annotation.XmlElement(name: 'comments-href', namespace: namespaceOwncloud, includeIfNull: false)
bool? occommentshref; @annotation.XmlElement(
@annotation.XmlElement(name: 'comments-count', namespace: namespaceOwncloud, includeIfNull: false) name: 'getcontenttype',
bool? occommentscount; namespace: namespaceDav,
@annotation.XmlElement(name: 'comments-unread', namespace: namespaceOwncloud, includeIfNull: false) includeIfNull: true,
bool? occommentsunread; isSelfClosing: true,
@annotation.XmlElement(name: 'downloadURL', namespace: namespaceOwncloud, includeIfNull: false) )
bool? ocdownloadurl; List<String?>? davgetcontenttype;
@annotation.XmlElement(name: 'owner-id', namespace: namespaceOwncloud, includeIfNull: false)
bool? ocownerid; @annotation.XmlElement(
@annotation.XmlElement(name: 'owner-display-name', namespace: namespaceOwncloud, includeIfNull: false) name: 'getcontentlength',
bool? ocownerdisplayname; namespace: namespaceDav,
@annotation.XmlElement(name: 'size', namespace: namespaceOwncloud, includeIfNull: false) includeIfNull: true,
bool? ocsize; isSelfClosing: true,
@annotation.XmlElement(name: 'permissions', namespace: namespaceOwncloud, includeIfNull: false) )
bool? ocpermissions; List<String?>? davgetcontentlength;
@annotation.XmlElement(name: 'note', namespace: namespaceNextcloud, includeIfNull: false)
bool? ncnote; @annotation.XmlElement(
@annotation.XmlElement(name: 'data-fingerprint', namespace: namespaceNextcloud, includeIfNull: false) name: 'resourcetype',
bool? ncdatafingerprint; namespace: namespaceDav,
@annotation.XmlElement(name: 'has-preview', namespace: namespaceNextcloud, includeIfNull: false) includeIfNull: true,
bool? nchaspreview; isSelfClosing: true,
@annotation.XmlElement(name: 'mount-type', namespace: namespaceNextcloud, includeIfNull: false) )
bool? ncmounttype; List<String?>? davresourcetype;
@annotation.XmlElement(name: 'is-encrypted', namespace: namespaceNextcloud, includeIfNull: false)
bool? ncisencrypted; @annotation.XmlElement(
@annotation.XmlElement(name: 'metadata_etag', namespace: namespaceNextcloud, includeIfNull: false) name: 'id',
bool? ncmetadataetag; namespace: namespaceOwncloud,
@annotation.XmlElement(name: 'upload_time', namespace: namespaceNextcloud, includeIfNull: false) includeIfNull: true,
bool? ncuploadtime; isSelfClosing: true,
@annotation.XmlElement(name: 'creation_time', namespace: namespaceNextcloud, includeIfNull: false) )
bool? nccreationtime; List<String?>? ocid;
@annotation.XmlElement(name: 'rich-workspace', namespace: namespaceNextcloud, includeIfNull: false)
bool? ncrichworkspace; @annotation.XmlElement(
@annotation.XmlElement(name: 'share-permissions', namespace: namespaceOpenCollaborationServices, includeIfNull: false) name: 'fileid',
bool? ocssharepermissions; namespace: namespaceOwncloud,
@annotation.XmlElement(name: 'share-permissions', namespace: namespaceOpenCloudMesh, includeIfNull: false) includeIfNull: true,
bool? ocmsharepermissions; isSelfClosing: true,
)
List<String?>? ocfileid;
@annotation.XmlElement(
name: 'favorite',
namespace: namespaceOwncloud,
includeIfNull: true,
isSelfClosing: true,
)
List<String?>? ocfavorite;
@annotation.XmlElement(
name: 'comments-href',
namespace: namespaceOwncloud,
includeIfNull: true,
isSelfClosing: true,
)
List<String?>? occommentshref;
@annotation.XmlElement(
name: 'comments-count',
namespace: namespaceOwncloud,
includeIfNull: true,
isSelfClosing: true,
)
List<String?>? occommentscount;
@annotation.XmlElement(
name: 'comments-unread',
namespace: namespaceOwncloud,
includeIfNull: true,
isSelfClosing: true,
)
List<String?>? occommentsunread;
@annotation.XmlElement(
name: 'downloadURL',
namespace: namespaceOwncloud,
includeIfNull: true,
isSelfClosing: true,
)
List<String?>? ocdownloadurl;
@annotation.XmlElement(
name: 'owner-id',
namespace: namespaceOwncloud,
includeIfNull: true,
isSelfClosing: true,
)
List<String?>? ocownerid;
@annotation.XmlElement(
name: 'owner-display-name',
namespace: namespaceOwncloud,
includeIfNull: true,
isSelfClosing: true,
)
List<String?>? ocownerdisplayname;
@annotation.XmlElement(
name: 'size',
namespace: namespaceOwncloud,
includeIfNull: true,
isSelfClosing: true,
)
List<String?>? ocsize;
@annotation.XmlElement(
name: 'permissions',
namespace: namespaceOwncloud,
includeIfNull: true,
isSelfClosing: true,
)
List<String?>? ocpermissions;
@annotation.XmlElement(
name: 'note',
namespace: namespaceNextcloud,
includeIfNull: true,
isSelfClosing: true,
)
List<String?>? ncnote;
@annotation.XmlElement(
name: 'data-fingerprint',
namespace: namespaceNextcloud,
includeIfNull: true,
isSelfClosing: true,
)
List<String?>? ncdatafingerprint;
@annotation.XmlElement(
name: 'has-preview',
namespace: namespaceNextcloud,
includeIfNull: true,
isSelfClosing: true,
)
List<String?>? nchaspreview;
@annotation.XmlElement(
name: 'mount-type',
namespace: namespaceNextcloud,
includeIfNull: true,
isSelfClosing: true,
)
List<String?>? ncmounttype;
@annotation.XmlElement(
name: 'is-encrypted',
namespace: namespaceNextcloud,
includeIfNull: true,
isSelfClosing: true,
)
List<String?>? ncisencrypted;
@annotation.XmlElement(
name: 'metadata_etag',
namespace: namespaceNextcloud,
includeIfNull: true,
isSelfClosing: true,
)
List<String?>? ncmetadataetag;
@annotation.XmlElement(
name: 'upload_time',
namespace: namespaceNextcloud,
includeIfNull: true,
isSelfClosing: true,
)
List<String?>? ncuploadtime;
@annotation.XmlElement(
name: 'creation_time',
namespace: namespaceNextcloud,
includeIfNull: true,
isSelfClosing: true,
)
List<String?>? nccreationtime;
@annotation.XmlElement(
name: 'rich-workspace',
namespace: namespaceNextcloud,
includeIfNull: true,
isSelfClosing: true,
)
List<String?>? ncrichworkspace;
@annotation.XmlElement(
name: 'share-permissions',
namespace: namespaceOpenCollaborationServices,
includeIfNull: true,
isSelfClosing: true,
)
List<String?>? ocssharepermissions;
@annotation.XmlElement(
name: 'share-permissions',
namespace: namespaceOpenCloudMesh,
includeIfNull: true,
isSelfClosing: true,
)
List<String?>? ocmsharepermissions;
} }
@annotation.XmlSerializable(createMixin: true) @annotation.XmlSerializable(createMixin: true)
@ -125,60 +344,196 @@ class WebDavProp with _$WebDavPropXmlSerializableMixin {
this.ocssharepermissions, this.ocssharepermissions,
this.ocmsharepermissions, this.ocmsharepermissions,
}); });
factory WebDavProp.fromXmlElement(final XmlElement element) => _$WebDavPropFromXmlElement(element); factory WebDavProp.fromXmlElement(final XmlElement element) => _$WebDavPropFromXmlElement(element);
@annotation.XmlElement(name: 'getlastmodified', namespace: namespaceDav, includeIfNull: false)
@annotation.XmlElement(
name: 'getlastmodified',
namespace: namespaceDav,
includeIfNull: false,
)
String? davgetlastmodified; String? davgetlastmodified;
@annotation.XmlElement(name: 'getetag', namespace: namespaceDav, includeIfNull: false)
@annotation.XmlElement(
name: 'getetag',
namespace: namespaceDav,
includeIfNull: false,
)
String? davgetetag; String? davgetetag;
@annotation.XmlElement(name: 'getcontenttype', namespace: namespaceDav, includeIfNull: false)
@annotation.XmlElement(
name: 'getcontenttype',
namespace: namespaceDav,
includeIfNull: false,
)
String? davgetcontenttype; String? davgetcontenttype;
@annotation.XmlElement(name: 'getcontentlength', namespace: namespaceDav, includeIfNull: false)
@annotation.XmlElement(
name: 'getcontentlength',
namespace: namespaceDav,
includeIfNull: false,
)
int? davgetcontentlength; int? davgetcontentlength;
@annotation.XmlElement(name: 'resourcetype', namespace: namespaceDav, includeIfNull: false)
@annotation.XmlElement(
name: 'resourcetype',
namespace: namespaceDav,
includeIfNull: false,
)
WebDavResourcetype? davresourcetype; WebDavResourcetype? davresourcetype;
@annotation.XmlElement(name: 'id', namespace: namespaceOwncloud, includeIfNull: false)
@annotation.XmlElement(
name: 'id',
namespace: namespaceOwncloud,
includeIfNull: false,
)
String? ocid; String? ocid;
@annotation.XmlElement(name: 'fileid', namespace: namespaceOwncloud, includeIfNull: false)
@annotation.XmlElement(
name: 'fileid',
namespace: namespaceOwncloud,
includeIfNull: false,
)
String? ocfileid; String? ocfileid;
@annotation.XmlElement(name: 'favorite', namespace: namespaceOwncloud, includeIfNull: false)
@annotation.XmlElement(
name: 'favorite',
namespace: namespaceOwncloud,
includeIfNull: false,
)
int? ocfavorite; int? ocfavorite;
@annotation.XmlElement(name: 'comments-href', namespace: namespaceOwncloud, includeIfNull: false)
@annotation.XmlElement(
name: 'comments-href',
namespace: namespaceOwncloud,
includeIfNull: false,
)
String? occommentshref; String? occommentshref;
@annotation.XmlElement(name: 'comments-count', namespace: namespaceOwncloud, includeIfNull: false)
@annotation.XmlElement(
name: 'comments-count',
namespace: namespaceOwncloud,
includeIfNull: false,
)
int? occommentscount; int? occommentscount;
@annotation.XmlElement(name: 'comments-unread', namespace: namespaceOwncloud, includeIfNull: false)
@annotation.XmlElement(
name: 'comments-unread',
namespace: namespaceOwncloud,
includeIfNull: false,
)
int? occommentsunread; int? occommentsunread;
@annotation.XmlElement(name: 'downloadURL', namespace: namespaceOwncloud, includeIfNull: false)
@annotation.XmlElement(
name: 'downloadURL',
namespace: namespaceOwncloud,
includeIfNull: false,
)
String? ocdownloadurl; String? ocdownloadurl;
@annotation.XmlElement(name: 'owner-id', namespace: namespaceOwncloud, includeIfNull: false)
@annotation.XmlElement(
name: 'owner-id',
namespace: namespaceOwncloud,
includeIfNull: false,
)
String? ocownerid; String? ocownerid;
@annotation.XmlElement(name: 'owner-display-name', namespace: namespaceOwncloud, includeIfNull: false)
@annotation.XmlElement(
name: 'owner-display-name',
namespace: namespaceOwncloud,
includeIfNull: false,
)
String? ocownerdisplayname; String? ocownerdisplayname;
@annotation.XmlElement(name: 'size', namespace: namespaceOwncloud, includeIfNull: false)
@annotation.XmlElement(
name: 'size',
namespace: namespaceOwncloud,
includeIfNull: false,
)
int? ocsize; int? ocsize;
@annotation.XmlElement(name: 'permissions', namespace: namespaceOwncloud, includeIfNull: false)
@annotation.XmlElement(
name: 'permissions',
namespace: namespaceOwncloud,
includeIfNull: false,
)
String? ocpermissions; String? ocpermissions;
@annotation.XmlElement(name: 'note', namespace: namespaceNextcloud, includeIfNull: false)
@annotation.XmlElement(
name: 'note',
namespace: namespaceNextcloud,
includeIfNull: false,
)
String? ncnote; String? ncnote;
@annotation.XmlElement(name: 'data-fingerprint', namespace: namespaceNextcloud, includeIfNull: false)
@annotation.XmlElement(
name: 'data-fingerprint',
namespace: namespaceNextcloud,
includeIfNull: false,
)
String? ncdatafingerprint; String? ncdatafingerprint;
@annotation.XmlElement(name: 'has-preview', namespace: namespaceNextcloud, includeIfNull: false)
@annotation.XmlElement(
name: 'has-preview',
namespace: namespaceNextcloud,
includeIfNull: false,
)
bool? nchaspreview; bool? nchaspreview;
@annotation.XmlElement(name: 'mount-type', namespace: namespaceNextcloud, includeIfNull: false)
@annotation.XmlElement(
name: 'mount-type',
namespace: namespaceNextcloud,
includeIfNull: false,
)
String? ncmounttype; String? ncmounttype;
@annotation.XmlElement(name: 'is-encrypted', namespace: namespaceNextcloud, includeIfNull: false)
@annotation.XmlElement(
name: 'is-encrypted',
namespace: namespaceNextcloud,
includeIfNull: false,
)
int? ncisencrypted; int? ncisencrypted;
@annotation.XmlElement(name: 'metadata_etag', namespace: namespaceNextcloud, includeIfNull: false)
@annotation.XmlElement(
name: 'metadata_etag',
namespace: namespaceNextcloud,
includeIfNull: false,
)
String? ncmetadataetag; String? ncmetadataetag;
@annotation.XmlElement(name: 'upload_time', namespace: namespaceNextcloud, includeIfNull: false)
@annotation.XmlElement(
name: 'upload_time',
namespace: namespaceNextcloud,
includeIfNull: false,
)
int? ncuploadtime; int? ncuploadtime;
@annotation.XmlElement(name: 'creation_time', namespace: namespaceNextcloud, includeIfNull: false)
@annotation.XmlElement(
name: 'creation_time',
namespace: namespaceNextcloud,
includeIfNull: false,
)
int? nccreationtime; int? nccreationtime;
@annotation.XmlElement(name: 'rich-workspace', namespace: namespaceNextcloud, includeIfNull: false)
@annotation.XmlElement(
name: 'rich-workspace',
namespace: namespaceNextcloud,
includeIfNull: false,
)
String? ncrichworkspace; String? ncrichworkspace;
@annotation.XmlElement(name: 'share-permissions', namespace: namespaceOpenCollaborationServices, includeIfNull: false)
@annotation.XmlElement(
name: 'share-permissions',
namespace: namespaceOpenCollaborationServices,
includeIfNull: false,
)
int? ocssharepermissions; int? ocssharepermissions;
@annotation.XmlElement(name: 'share-permissions', namespace: namespaceOpenCloudMesh, includeIfNull: false)
@annotation.XmlElement(
name: 'share-permissions',
namespace: namespaceOpenCloudMesh,
includeIfNull: false,
)
String? ocmsharepermissions; String? ocmsharepermissions;
} }
@ -214,59 +569,195 @@ class WebDavOcFilterRules with _$WebDavOcFilterRulesXmlSerializableMixin {
this.ocssharepermissions, this.ocssharepermissions,
this.ocmsharepermissions, this.ocmsharepermissions,
}); });
factory WebDavOcFilterRules.fromXmlElement(final XmlElement element) => _$WebDavOcFilterRulesFromXmlElement(element); factory WebDavOcFilterRules.fromXmlElement(final XmlElement element) => _$WebDavOcFilterRulesFromXmlElement(element);
@annotation.XmlElement(name: 'getlastmodified', namespace: namespaceDav, includeIfNull: false)
@annotation.XmlElement(
name: 'getlastmodified',
namespace: namespaceDav,
includeIfNull: false,
)
String? davgetlastmodified; String? davgetlastmodified;
@annotation.XmlElement(name: 'getetag', namespace: namespaceDav, includeIfNull: false)
@annotation.XmlElement(
name: 'getetag',
namespace: namespaceDav,
includeIfNull: false,
)
String? davgetetag; String? davgetetag;
@annotation.XmlElement(name: 'getcontenttype', namespace: namespaceDav, includeIfNull: false)
@annotation.XmlElement(
name: 'getcontenttype',
namespace: namespaceDav,
includeIfNull: false,
)
String? davgetcontenttype; String? davgetcontenttype;
@annotation.XmlElement(name: 'getcontentlength', namespace: namespaceDav, includeIfNull: false)
@annotation.XmlElement(
name: 'getcontentlength',
namespace: namespaceDav,
includeIfNull: false,
)
int? davgetcontentlength; int? davgetcontentlength;
@annotation.XmlElement(name: 'resourcetype', namespace: namespaceDav, includeIfNull: false)
@annotation.XmlElement(
name: 'resourcetype',
namespace: namespaceDav,
includeIfNull: false,
)
WebDavResourcetype? davresourcetype; WebDavResourcetype? davresourcetype;
@annotation.XmlElement(name: 'id', namespace: namespaceOwncloud, includeIfNull: false)
@annotation.XmlElement(
name: 'id',
namespace: namespaceOwncloud,
includeIfNull: false,
)
String? ocid; String? ocid;
@annotation.XmlElement(name: 'fileid', namespace: namespaceOwncloud, includeIfNull: false)
@annotation.XmlElement(
name: 'fileid',
namespace: namespaceOwncloud,
includeIfNull: false,
)
String? ocfileid; String? ocfileid;
@annotation.XmlElement(name: 'favorite', namespace: namespaceOwncloud, includeIfNull: false)
@annotation.XmlElement(
name: 'favorite',
namespace: namespaceOwncloud,
includeIfNull: false,
)
int? ocfavorite; int? ocfavorite;
@annotation.XmlElement(name: 'comments-href', namespace: namespaceOwncloud, includeIfNull: false)
@annotation.XmlElement(
name: 'comments-href',
namespace: namespaceOwncloud,
includeIfNull: false,
)
String? occommentshref; String? occommentshref;
@annotation.XmlElement(name: 'comments-count', namespace: namespaceOwncloud, includeIfNull: false)
@annotation.XmlElement(
name: 'comments-count',
namespace: namespaceOwncloud,
includeIfNull: false,
)
int? occommentscount; int? occommentscount;
@annotation.XmlElement(name: 'comments-unread', namespace: namespaceOwncloud, includeIfNull: false)
@annotation.XmlElement(
name: 'comments-unread',
namespace: namespaceOwncloud,
includeIfNull: false,
)
int? occommentsunread; int? occommentsunread;
@annotation.XmlElement(name: 'downloadURL', namespace: namespaceOwncloud, includeIfNull: false)
@annotation.XmlElement(
name: 'downloadURL',
namespace: namespaceOwncloud,
includeIfNull: false,
)
String? ocdownloadurl; String? ocdownloadurl;
@annotation.XmlElement(name: 'owner-id', namespace: namespaceOwncloud, includeIfNull: false)
@annotation.XmlElement(
name: 'owner-id',
namespace: namespaceOwncloud,
includeIfNull: false,
)
String? ocownerid; String? ocownerid;
@annotation.XmlElement(name: 'owner-display-name', namespace: namespaceOwncloud, includeIfNull: false)
@annotation.XmlElement(
name: 'owner-display-name',
namespace: namespaceOwncloud,
includeIfNull: false,
)
String? ocownerdisplayname; String? ocownerdisplayname;
@annotation.XmlElement(name: 'size', namespace: namespaceOwncloud, includeIfNull: false)
@annotation.XmlElement(
name: 'size',
namespace: namespaceOwncloud,
includeIfNull: false,
)
int? ocsize; int? ocsize;
@annotation.XmlElement(name: 'permissions', namespace: namespaceOwncloud, includeIfNull: false)
@annotation.XmlElement(
name: 'permissions',
namespace: namespaceOwncloud,
includeIfNull: false,
)
String? ocpermissions; String? ocpermissions;
@annotation.XmlElement(name: 'note', namespace: namespaceNextcloud, includeIfNull: false)
@annotation.XmlElement(
name: 'note',
namespace: namespaceNextcloud,
includeIfNull: false,
)
String? ncnote; String? ncnote;
@annotation.XmlElement(name: 'data-fingerprint', namespace: namespaceNextcloud, includeIfNull: false)
@annotation.XmlElement(
name: 'data-fingerprint',
namespace: namespaceNextcloud,
includeIfNull: false,
)
String? ncdatafingerprint; String? ncdatafingerprint;
@annotation.XmlElement(name: 'has-preview', namespace: namespaceNextcloud, includeIfNull: false)
@annotation.XmlElement(
name: 'has-preview',
namespace: namespaceNextcloud,
includeIfNull: false,
)
bool? nchaspreview; bool? nchaspreview;
@annotation.XmlElement(name: 'mount-type', namespace: namespaceNextcloud, includeIfNull: false)
@annotation.XmlElement(
name: 'mount-type',
namespace: namespaceNextcloud,
includeIfNull: false,
)
String? ncmounttype; String? ncmounttype;
@annotation.XmlElement(name: 'is-encrypted', namespace: namespaceNextcloud, includeIfNull: false)
@annotation.XmlElement(
name: 'is-encrypted',
namespace: namespaceNextcloud,
includeIfNull: false,
)
int? ncisencrypted; int? ncisencrypted;
@annotation.XmlElement(name: 'metadata_etag', namespace: namespaceNextcloud, includeIfNull: false)
@annotation.XmlElement(
name: 'metadata_etag',
namespace: namespaceNextcloud,
includeIfNull: false,
)
String? ncmetadataetag; String? ncmetadataetag;
@annotation.XmlElement(name: 'upload_time', namespace: namespaceNextcloud, includeIfNull: false)
@annotation.XmlElement(
name: 'upload_time',
namespace: namespaceNextcloud,
includeIfNull: false,
)
int? ncuploadtime; int? ncuploadtime;
@annotation.XmlElement(name: 'creation_time', namespace: namespaceNextcloud, includeIfNull: false)
@annotation.XmlElement(
name: 'creation_time',
namespace: namespaceNextcloud,
includeIfNull: false,
)
int? nccreationtime; int? nccreationtime;
@annotation.XmlElement(name: 'rich-workspace', namespace: namespaceNextcloud, includeIfNull: false)
@annotation.XmlElement(
name: 'rich-workspace',
namespace: namespaceNextcloud,
includeIfNull: false,
)
String? ncrichworkspace; String? ncrichworkspace;
@annotation.XmlElement(name: 'share-permissions', namespace: namespaceOpenCollaborationServices, includeIfNull: false)
@annotation.XmlElement(
name: 'share-permissions',
namespace: namespaceOpenCollaborationServices,
includeIfNull: false,
)
int? ocssharepermissions; int? ocssharepermissions;
@annotation.XmlElement(name: 'share-permissions', namespace: namespaceOpenCloudMesh, includeIfNull: false)
@annotation.XmlElement(
name: 'share-permissions',
namespace: namespaceOpenCloudMesh,
includeIfNull: false,
)
String? ocmsharepermissions; String? ocmsharepermissions;
} }

1077
packages/nextcloud/lib/src/webdav/props.g.dart

File diff suppressed because it is too large Load Diff

14
packages/nextcloud/test/webdav.dart

@ -38,7 +38,7 @@ Future run(final DockerImage image) async {
test('List directory', () async { test('List directory', () async {
final responses = (await client.webdav.ls( final responses = (await client.webdav.ls(
'/', '/',
prop: WebDavPropfindProp( prop: WebDavPropfindProp.fromBools(
nchaspreview: true, nchaspreview: true,
davgetcontenttype: true, davgetcontenttype: true,
davgetlastmodified: true, davgetlastmodified: true,
@ -90,7 +90,7 @@ Future run(final DockerImage image) async {
final responses = (await client.webdav.ls( final responses = (await client.webdav.ls(
'/', '/',
prop: WebDavPropfindProp( prop: WebDavPropfindProp.fromBools(
ocsize: true, ocsize: true,
), ),
)) ))
@ -121,7 +121,7 @@ Future run(final DockerImage image) async {
final props = (await client.webdav.ls( final props = (await client.webdav.ls(
'/', '/',
prop: WebDavPropfindProp( prop: WebDavPropfindProp.fromBools(
davgetlastmodified: true, davgetlastmodified: true,
nccreationtime: true, nccreationtime: true,
), ),
@ -210,7 +210,7 @@ Future run(final DockerImage image) async {
test('Get file props', () async { test('Get file props', () async {
final props = (await client.webdav.ls( final props = (await client.webdav.ls(
'Nextcloud.png', 'Nextcloud.png',
prop: WebDavPropfindProp( prop: WebDavPropfindProp.fromBools(
davgetlastmodified: true, davgetlastmodified: true,
davgetetag: true, davgetetag: true,
davgetcontenttype: true, davgetcontenttype: true,
@ -281,7 +281,7 @@ Future run(final DockerImage image) async {
final props = (await client.webdav.ls( final props = (await client.webdav.ls(
'test', 'test',
prop: WebDavPropfindProp( prop: WebDavPropfindProp.fromBools(
davgetcontenttype: true, davgetcontenttype: true,
davgetlastmodified: true, davgetlastmodified: true,
davresourcetype: true, davresourcetype: true,
@ -315,7 +315,7 @@ Future run(final DockerImage image) async {
WebDavOcFilterRules( WebDavOcFilterRules(
ocfavorite: 1, ocfavorite: 1,
), ),
prop: WebDavPropfindProp( prop: WebDavPropfindProp.fromBools(
ocid: true, ocid: true,
ocfavorite: true, ocfavorite: true,
), ),
@ -346,7 +346,7 @@ Future run(final DockerImage image) async {
final props = (await client.webdav.ls( final props = (await client.webdav.ls(
'test.txt', 'test.txt',
prop: WebDavPropfindProp( prop: WebDavPropfindProp.fromBools(
ocfavorite: true, ocfavorite: true,
nccreationtime: true, nccreationtime: true,
ncuploadtime: true, ncuploadtime: true,

Loading…
Cancel
Save