All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sshtools.vfs.webdav.WebdavFileSystem Maven / Gradle / Ivy

Go to download

WebDAV Commons VFS provider which is a fork of commons-vfs-webdav-sardine (and thus Sardine based too). Currently minor bug fixes, alignment with latest HTTPClient library and other tweaks.

There is a newer version: 4.1.0
Show newest version
package com.sshtools.vfs.webdav;

import java.util.Collection;

import org.apache.commons.vfs2.Capability;
import org.apache.commons.vfs2.FileName;
import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSystem;
import org.apache.commons.vfs2.FileSystemOptions;
import org.apache.commons.vfs2.provider.AbstractFileName;
import org.apache.commons.vfs2.provider.AbstractFileSystem;

import com.github.sardine.Sardine;

public class WebdavFileSystem extends AbstractFileSystem implements FileSystem {

	private Sardine sardine;

	protected WebdavFileSystem(FileName rootName, Sardine sardine, FileSystemOptions fileSystemOptions) {
		super(rootName, null /* there is no parent layer for a webdav file system */, fileSystemOptions);
		this.sardine = sardine;
	}

	@Override
	protected FileObject createFile(AbstractFileName name) throws Exception {
		return new WebdavFileObject(name, this, sardine);
	}

    /**
     * Adds the capabilities of this file system.
     */
    @Override
    protected void addCapabilities(final Collection caps)
    {
        caps.addAll(WebdavFileProvider.capabilities);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy