Skip to content

Releases: AstartesGuardian/WebDAV-Server

Release list

Beta Release

Choose a tag to compare

@AdrienCastex AdrienCastex released this 19 Apr 18:30

Available entities

IContentManager StandardContentManager
CryptedContentManager
HTTPAuthenticationManager HTTPDefaultAuthentication
HTTPUser HTTPUser
IResourceManager VirtualResourceManager
VirtualManager VirtualManager
IResource VEntity
VRoot
VDirectory
VFile
VLink

User rights

Attribute name Description Type
webname::get Give the right to get the name/webname of a resource read
visible::get Give the right to get the visible status of a resource read
time::creation::get Give the right to get the creation date of a resource read
time::lastmodified::get Give the right to get the last modified date of a resource read
path::get Give the right to get the path of a resource read
type::get Give the right to get the type of a resource (ResourceType) read
lock::check Give the right to check if a lock is taken on a resource read
lock::get Give the right to get information about taken locks of a resource read
lock::set Give the right to set a lock on a resource write
lock::remove Give the right to remove a lock on a resource write
property::get Give the right to get the value of a property of a resource read
property::set Give the right to set the value of a property of a resource write
property::remove Give the right to remove the value of a property of a resource write
children::get Give the right to get the children resource of a resource read
content::get Give the right to get the content of a resource read
content::set Give the right to set the content of a resource read
size::get Give the right to get the size of a resource read
mimetype::get Give the right to get the mimetype of a resource read
file::create Give the right to create a file resource write
directory::create Give the right to create a directory resource (also called collection) write
link::create Give the right to create a link resource write
delete Give the right to delete a resource write
move Give the right to move/rename a resource write

Use

Standard

VirtualManager vm;
try
{
    vm = VirtualManager.load(new File("data.vm"));
}
catch (Exception ex)
{
    vm = new VirtualManager();
    VDirectory dir = new VDirectory(vm.getRoot(), "public");
}

vm.setRootDirectory(new File("D:\\Documents\\FTP_TEST"));
vm.addContentManager("direct", new StandardContentManager());

HTTPServerSettings settings = new HTTPServerSettings();
settings.setAllowedCommands(HTTPCommand.getStandardCommands());
settings.setAuthenticationManager(null);
settings.setHTTPVersion(1.1);
settings.setMaxNbRequests(100);
settings.setPrintErrors(true);
settings.setPrintRequests(true);
settings.setPrintResponses(true);
settings.setResourceManager(new VirtualResourceManager(vm));
settings.setRoot("");
settings.setServer("WebDAV Server");
settings.setMaxBufferSize(1048576);
settings.setStepBufferSize(5000);
settings.setTimeout(5);
settings.setUseResourceBuffer(false);


HTTPServer s = new HTTPServer(1700, settings, false, true);
s.run();

Crypted

VirtualManager vm;
try
{
    vm = VirtualManager.load(new File("data.vm"));
}
catch (Exception ex)
{
    vm = new VirtualManager();
    VDirectory dir = new VDirectory(vm.getRoot(), "public");
}

vm.setRootDirectory(new File("D:\\Documents\\FTP_TEST"));
vm.addContentManager("direct", new CryptedContentManager(ICrypter.Algorithm.AES_CBC_PKCS5Padding, "username", "password"));

HTTPServerSettings settings = new HTTPServerSettings();
settings.setAllowedCommands(HTTPCommand.getStandardCommands());
settings.setAuthenticationManager(null);
settings.setHTTPVersion(1.1);
settings.setMaxNbRequests(100);
settings.setPrintErrors(true);
settings.setPrintRequests(true);
settings.setPrintResponses(true);
settings.setResourceManager(new VirtualResourceManager(vm));
settings.setRoot("");
settings.setServer("WebDAV Server");
settings.setMaxBufferSize(1048576);
settings.setStepBufferSize(5000);
settings.setTimeout(5);
settings.setUseResourceBuffer(false);


HTTPServer s = new HTTPServer(1704, settings, false, true);
s.run();