use of io.milton.restlet.WebDavRestlet in project lobcder by skoulouzis.
the class RestletFileserver method main.
public static void main(String[] args) throws Exception {
Component component = new Component();
component.getServers().add(Protocol.HTTP, 8080);
// Restlet logs requests by default
// component.getLogService().setEnabled(false);
component.getDefaultHost().attach(new Application() {
@Override
public Restlet createInboundRoot() {
FileSystemResourceFactory factory = new FileSystemResourceFactory(new File(System.getProperty("user.home")), new NullSecurityManager());
factory.setContentService(new SimpleFileContentService());
factory.setLockManager(new FsMemoryLockManager());
return new WebDavRestlet(factory);
}
});
component.start();
System.out.println("Restlet demo fileserver started, open http://localhost:8080 in your browser or WebDAV client...");
}
Aggregations