Skip to content

Standard WebDAV server

Adrien Castex edited this page Apr 4, 2015 · 8 revisions

Standard WebDAV server

It represents a normal way to access data. It can allow a user to share (unsecured) a folder of the computer.


Access to resources

It accesses directly to resources on the root directory specified in the HTTPServerSettings instance.

If the server receive GET /public/chocolate.exe HTTP/1.1 and the <resource_root> used is D:\Documents\WebDAVServer, the resource will be D:\Documents\WebDAVServer\public\chocolate.exe.

Classes

  • webdav.server.standard.StandardResource
  • webdav.server.standard.StandardResourceManager

How to use

First, you will have to import the class :

import webdav.server.standard.StandardResourceManager;

Then, you will have to create the HTTPServerSettings instance for the HTTPServer with StandardResourceManager.class :

HTTPServerSettings settings = new HTTPServerSettings(
  /* [...] */ StandardResourceManager.class /* [...] */
);

Quick use of a standard WebDAV server

HTTPServerSettings settings = new HTTPServerSettings(
  "WebDAV Server",
  HTTPCommand.getStandardCommands(),
  StandardResourceManager.class,
  "<my folder>"
);

HTTPServer s = new HTTPServer(1700, settings);
s.run(); // Run the server

Clone this wiki locally