Updated nextcloud neon api to latest

This commit is contained in:
2023-08-08 20:26:53 +02:00
parent 86c3a397da
commit 45a829082b
6 changed files with 9 additions and 9 deletions

View File

@ -43,8 +43,8 @@ class _FileUploadDialogState extends State<FileUploadDialog> {
setState(() {
state = FileUploadState.checkConflict;
});
await (await WebdavApi.webdav).mkdirs(widget.remotePath.join("/"));
List<WebDavResponse> result = (await webdavClient.ls(widget.remotePath.join("/"))).responses;
await (await WebdavApi.webdav).mkcol(widget.remotePath.join("/"));
List<WebDavResponse> result = (await webdavClient.propfind(widget.remotePath.join("/"))).responses;
if(result.any((element) => element.href!.endsWith("/$targetFileName"))) {
setState(() {
state = FileUploadState.conflict;
@ -57,7 +57,7 @@ class _FileUploadDialogState extends State<FileUploadDialog> {
}
}
Future<HttpClientResponse> uploadTask = webdavClient.upload(File(widget.localPath).readAsBytesSync(), fullRemotePath);
Future<HttpClientResponse> uploadTask = webdavClient.putFile(File(widget.localPath), FileStat.statSync(widget.localPath), fullRemotePath); // TODO use onProgress from putFile
uploadTask.then((value) => Future<HttpClientResponse?>.value(value)).catchError((e) {
setState(() {
state = FileUploadState.error;