Git Product home page Git Product logo

dart-webdav's People

Contributors

branzhu avatar czerwony-kapturek avatar hauketoenjes avatar provokateurin avatar sulisong avatar timestee avatar xioxin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dart-webdav's Issues

To prevent overwriting a file allow sending headers with an upload

If you want to prevent overwriting files that have been updated since the last time the file was retrieved we can use etags and the If-Match header. But to do that the upload method should pass on an optional Map of headers to the _send method (which can already does the right thing).

To many "/" in the request url

Hello,

i want to use your webdav client in my flutter app. I implemented it the following way:

Client client = Client("webdav.webdavserver.com", "user.name", "password", "",
    port: 8080, protocol: "https");

client.ls("/").then((list) {
    print(list);
});

The logs say the following:
I/flutter ( 6760): [wevdav] http send with method:PROPFIND path: url:https://webdav.webdavserver.com:8080//

My question is, if i am doing something wrong while using the library or is that a bug (intended behavior)?

Hauke

Example for editing a file in situ ?

Say there's a resource foo/bar.txt and it is only a line or two of CR-delimited text. Can a simple Flutter+Dart app show that being GET from the server, then PUT back to the same server after editing?

That's different to a download/upload scenario :)

Can you transfer the pub package to me?

I wanted to maintain a dart webdav package, but found that the name was already used. Since you no longer intend to maintain this package, I would like to be able to transfer ownership to me in pub. Thank you so much!

Sample Client class and other methods

I'm new to Dart and Flutter, can you please add an /examples folder containing some sample code for creating an Client object and calling some of the provided methods?

ls返回空目录是哪里错了

class _WebDavPageState extends State<WebDavPage> {
  final Client webDav = Client(
    'dav.jianguoyun.com/dav/',
    '[email protected]',
    'ag5hb2k87nabgm72',
    '/',
    protocol: 'https'
  );
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Center(
        child: RaisedButton(
          child: Text('Get File'),
          onPressed: () async {
            await webDav.ls("/").then((value) {
              print('value is $value');
            });
          },
        ),
      ),
    );
  }
}

控制台输出:

I/flutter ( 3865): [wevdav] http send with method:PROPFIND path:/ url:https://dav.jianguoyun.com/dav/iviki
I/flutter ( 3865): value is []

parser the XML response directly rather than using xmltojson

/// get file info list from `ls` command response
List<FileInfo> treeFromWevDavXml(String xmlStr) {
final Xml2Json myTransformer = Xml2Json();
myTransformer.parse(xmlStr);
final jsonResponse = json.decode(myTransformer.toParker());
final responses = jsonResponse['d:multistatus']['d:response'];
var tree = new List<FileInfo>();
if (responses is List) {
responses.forEach((response) {
final elem = response['d:propstat']['d:prop'];
FileInfo f = FileInfo(
response['d:href'],
prop(elem, 'getcontentlength'),
prop(elem, 'getlastmodified'),
prop(elem, 'creationdate'),
prop(elem, 'getcontenttype'));
tree.add(f);
});
}
return tree;
}

parser the XML response directly rather than using xmltojson.

简单测试ls列出文件异常

使用这个库简单测试功能报出异常:
2019-10-13 13:06:16.493 27695-27713/? I/flutter: [wevdav] http send with method:PROPFIND path:/ url:http://192.168.0.2:41651/
2019-10-13 13:06:16.585 27695-27713/? E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: Bad state: No element
#0 Iterable.get:single (dart:core/iterable.dart:552)
#1 treeFromWevDavXml.. (package:webdav/src/file.dart:65)
#2 Iterable.forEach (dart:core/iterable.dart:277)
#3 treeFromWevDavXml. (package:webdav/src/file.dart:61)
#4 Iterable.forEach (dart:core/iterable.dart:277)
#5 treeFromWevDavXml (package:webdav/src/file.dart:55)
#6 Client.ls (package:webdav/src/client.dart:205)

我的代码在:https://github.com/OpenIoTHub/OpenIoTHub/blob/f9c60b38d3ce0529a85594a67a09d4e3d6feab14/lib/pages/mdnsService/mDNSService/webDAV.dart#L81

How do I know the upload is complete

when i upload file to cloud, I want to know when it is completed(Success or failure )

uploadFile return Future , when i use it , it's return null , Is this a sign of completion?

Client webDavClient = Client(_address, _username, _password, '/', protocol: 'https');
Future<dynamic> result = await webDavClient.uploadFile(localPath, 'somePath/' + 'myFile.db');
print('result is $x');

this is message : result is null

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.