How to use the @pylonide/jsdav/lib/shared/util.splitPath function in @pylonide/jsdav

To help you get started, we’ve selected a few @pylonide/jsdav examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pylonide / pylon / plugins-server / pylon.fs / fs / file.js View on Github external
putStream: function(handler, type, callback) {
    var path = this.path;
    // is it a chunked upload?
    var size = handler.httpRequest.headers["x-file-size"];
    if (size && size !== "undefined") {
      var parts = Util.splitPath(this.path);
      if (!handler.httpRequest.headers["x-file-name"])
        handler.httpRequest.headers["x-file-name"] = parts[1];
      handler.server.tree.getNodeForPath(parts[0], function(err, parent) {
        if (err)
          return callback(err);

        parent.writeFileChunk(handler, type, callback);
      });
    }
    else {
      this.vfs.mkfile(path, {}, function(err, meta) {
        if (err) {
          if (err.code == "EACCES")
            err = new Exc.Forbidden("Permission denied to write file:" + path);
          return callback(err);
        }
github pylonide / pylon / plugins-server / pylon.fs / fs / node.js View on Github external
getName: function() {
    return Util.splitPath(this.path)[1];
  },
github pylonide / pylon / plugins-server / pylon.fs / fs / node.js View on Github external
setName: function(name, callback) {
    var parentPath = Util.splitPath(this.path)[0];
    var newName    = Util.splitPath(name)[1];

    var newPath = parentPath + "/" + newName;
    var self = this;
    this.vfs.rename(newPath, {from: this.path}, function(err) {
      if (err)
        return callback(err);
      self.path = newPath;
      callback();
    });
  },

@pylonide/jsdav

jsDAV allows you to easily add WebDAV support to a NodeJS application. jsDAV is meant to cover the entire standard, and attempts to allow integration using an easy to understand API.

MIT
Latest version published 12 months ago

Package Health Score

66 / 100
Full package analysis

Similar packages