Skip to content
Adrien Castex edited this page Apr 19, 2015 · 5 revisions

Quick start guide
[Warning Obsolete]

Even if the main purpose of the project is to create personal resource manager to fit the personal needs, there are resource managers already included in the project. This way, you can use them to test the server or to achieve your goal.


Configure

The class HTTPServerSettings allow you to configure the server. Every parameter is optional.

HTTPServerSettings settings = new HTTPServerSettings(
  <server_name = "WebDav Server">,
  <command_list = HTTPCommand.getStandardCommands()>,
  <resource_manager_class = StandardResourceManager.class>,
  <resource_root = "">,
  <timeout = 5>,
  <nb_request_max_by_tcp_connection = 100>
);
  • Optional : <description = defaultValue>

Constructor

HTTPServer server = new HTTPServer(
  <port>,
  <settings>,
  <use_SSL = false>,
  <scan_port_if_specified_is_not_available = false>
);
  • Optional : <description = defaultValue>
  • Required : <description>

Run the server

Blocking call :

server.run(); // blocking call

Non-blocking call :

new Thread(server).start(); // asynchronous call

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

Quick use of a encrypted WebDAV server

LocalCryptedResourceManager.loadCipherCrypter(ICrypter.Algorithm.AES_ECB_PKCS5Padding);
LocalCryptedResourceManager.setKey("<my password>");

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

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

Clone this wiki locally