How to use webdav-fs - 4 common examples

To help you get started, we’ve selected a few webdav-fs 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 buttercup / buttercup-desktop / src / renderer / redux / modules / file-manager.js View on Github external
import path from 'path';
import { combineReducers } from 'redux';

import webdavFs from 'webdav-fs';
import anyFs from 'any-fs';

const wfs = webdavFs('', 'buttercup', '');
const afs = anyFs(wfs);

// Constants ->
const SET_CURRENT_PATH = 'buttercup/manager/SET_CURRENT_PATH';
const SET_CONTENTS = 'buttercup/manager/SET_CONTENTS';
const LOADING_STARTED = 'buttercup/manager/LOADING_STARTED';
const LOADING_FINISHED = 'buttercup/manager/LOADING_FINISHED';
const ADD_DIRECTORY = 'buttercup/manager/ADD_DIRECTORY';
const SELECT_FILE_INDEX = 'buttercup/manager/SELECT_FILE_INDEX';

// Reducers ->
function currentPath(state = '', action) {
  switch (action.type) {
    case SET_CURRENT_PATH:
      return action.payload;
    default:
github buttercup / buttercup-desktop / src / renderer / system / auth.js View on Github external
export function getFsInstance(type, settings) {
  switch (type) {
    case 'dropbox':
      return anyFs(
        dropboxFs({
          apiKey: settings.token
        })
      );
    case 'webdav':
      return anyFs(
        webdavFs(settings.endpoint, settings.username, settings.password)
      );
    default:
      return null;
  }
}
github buttercup / buttercup-browser-extension / source / setup / js / OwnCloudArchiveEntryForm.jsx View on Github external
createFS() {
        if (this.state.owncloudAddress.trim().length <= 0) {
            return null;
        }
        let wfs;
        const owncloudAddress = url.resolve(this.state.owncloudAddress, "remote.php/webdav/");
        if (this.state.owncloudUsername && this.state.owncloudUsername.trim().length > 0) {
            if (this.state.owncloudPassword.trim().length <= 0) {
                return null;
            }
            wfs = createWebDAVFS(
                owncloudAddress,
                this.state.owncloudUsername,
                this.state.owncloudPassword
            );
            return anyFs(wfs);
        }
        return null;
    }
github buttercup / buttercup-browser-extension / source / setup / js / WebDAVArchiveEntryForm.jsx View on Github external
createFS() {
        if (this.state.webdav_address.trim().length <= 0) {
            return null;
        }
        let wfs;
        if (this.state.webdav_username && this.state.webdav_username.trim().length > 0) {
            if (this.state.webdav_password.trim().length <= 0) {
                return null;
            }
            wfs = createWebDAVFS(
                this.state.webdav_address,
                this.state.webdav_username,
                this.state.webdav_password
            );
            return anyFs(wfs);
        }
        return null;
    }

webdav-fs

WebDAV wrapper for Node's fs

MIT
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis

Popular webdav-fs functions