Milton core libraries, second major version
Please review licensing agreements carefully before use.
Milton Java WebDAV / CalDAV / CardDAV Server Library that runs on Windows, Mac, Linux, Android and iOS.
Home Page: https://milton.io
License: Other
Hi,
the Collection Entity Tag (CTag) can also be used with CardDav.
Is it possible to add the CTagProperty()
to the CardDavProtocol
?
It seems there is already a AnnoAddressBookResource.getCTag()
which is never invoked.
Thanks
when try mvn jetty:run
, error happens:
[ERROR] Error executing Maven. [ERROR] The specified user settings file does not exist: D:\software\JetBrains\workspace\miltonwebdav\ource
how to config 'ource'? file or directory? I can not find it in the examples and the tutorial
Problem
Milton 2.7.1.3 built failed
Cause
Invalid repo:
<repository>
<id>milton-repo</id>
<url>http://milton.io/maven/</url>
</repository>
and default Maven repo
Impact
Unresolved dependencies
E.g. for milton-client
, the deps below cannot be resolved:
http://milton.io/maven/io/milton/milton-api/2.7.1.3/milton-api-2.7.1.3.pom
https://repo.maven.apache.org/maven2/io/milton/milton-api/2.7.1.3/milton-api-2.7.1.3.pom
http://milton.io/maven/io/milton/cardme/1.0.0/cardme-1.0.0.pom
https://repo.maven.apache.org/maven2/io/milton/cardme/1.0.0/cardme-1.0.0.pom
Hello, guys!
I want to responsibly disclose security issues I've found in milton webdav server? How can I do it safely?
Thanks.
Method parseEvent() dosn't check input valitity. If the data doesn't contain any VEVENT a NullPointerException occurs:
public void parseEvent(EventResource r, String data) throws IOException, ParserException {
CalendarBuilder builder = new CalendarBuilder();
Calendar calendar = builder.build(new ByteArrayInputStream(data.getBytes("UTF-8")));
VEvent ev = this.event(calendar);
When I disable CalDav and issue an OPTIONS request to a /carddav
endpoint, the DAV HTTP response header still returns "calendar-access" (Calendar Access Support).
DAV: 1, 2, access-control, 3, calendar-access, calendarserver-principal-property-search, calendar-schedule, extended-mkcol, calendar-proxy, calendar-auto-schedule, schedule-inbox, schedule-outbox, addressbook
Example:
HttpManagerBuilderEnt builder = new HttpManagerBuilderEnt();
....
builder.setEnableDigestAuth(false);
builder.setEnableFormAuth(false);
builder.setEnableCookieAuth(false);
builder.setCaldavEnabled(false);
return builder.buildHttpManager();
Kind regards,
Robert Winkler
I use anno
@ResourceController
public class WebdavController {
private URI projectBase = null;
@AccessControlList
public List<AccessControlledResource.Priviledge> getPriviledges(File target, String currentUser ) {
return AccessControlledResource.READ_WRITE;
}
@Root
public WebdavController getRoot() {
return this;
}
@Get
public InputStream getFile(File f) throws IOException {
return FileUtils.openInputStream(f);
}
@ChildrenOf
public Collection<File> getUploads(WebdavController root) {
return FileUtils.listFiles(xxxxx);
}
@PutChild
public File upload(File f, String newName, byte[] bytes) {
return f;
}
@UniqueId
public long getUUID(File f) {
return 10L;
}
<filter-name>MiltonFilter</filter-name>
<filter-class>io.milton.servlet.MiltonFilter</filter-class>
<init-param>
<param-name>resource.factory.class</param-name>
<param-value>io.milton.http.annotated.AnnotationResourceFactory</param-value>
</init-param>
<init-param>
<param-name>controllerPackagesToScan</param-name>
<param-value>cn.myapps.core.webdav</param-value>
</init-param>
<init-param>
<param-name>contextPath</param-name>
<param-value>/dav</param-value>
</init-param>
<init-param>
<param-name>extraAuthenticationHandlers</param-name>
<param-value>cn.myapps.core.webdav.TokenAuthenticationHandler</param-value>
</init-param>
<init-param>
<param-name>enableBasicAuth</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>enableDigestAuth</param-name>
<param-value>false</param-value>
</init-param>
</filter>
when I try LOCK http://xxxxx/dav/abc.docx, I got http 501
Hi,
Is this draft RFC supported ?
https://tools.ietf.org/html/draft-daboo-carddav-directory-gateway-02#page-4
It is implemented by apple devices to allow searching in a global directory without syncing everything.
If so do you have any pointer on how to use it in milton ?
Hi, I'm using milton, and my upload code as follows:
@PutChild @Transactional public FileContentItem uploadFile(FolderContentItem parent, String name, byte[] bytes){ String traceId = UuidGenUtil.createUuid(); try { QUERY_LOGGER.info("[uploadFile][NetdiskController],action=Request, name={}, size={},traceId={}",name,bytes.length,traceId);
In windows, i can upload file successfully, but with Mac Finder, the length of bytes is always 0, Anyone know why?
It would be really helpful to have the artifacts published to Maven Central. By not having these artifacts in Maven Central, it prevents other projects from being published into Maven Central as well. Is there an issue preventing these artifacts from being published there?
Hello. I'm trying to build and deploy Milton version 2.7.4.4 in my Java WebDAV Application, my question is in the home page of the milton2 project under the file structure there is a build-error tag show, is this mention that builds of this version is a failure?
I appreciate Milton's developer help me.
We are using the Milton community version 2.6.5.5 and we found the problem with the packages scanning for classes with Milton annotations (method ReflectionUtils#getClassNamesFromPackage).
Inside this method the package protocol is checked and depends of protocol the correct logic for scanning is used. I assume that everything works fine in single war/jar file but in our enterprise application we have separated parts for web part and for mentioned web part the following package URL is returned:
zip:C:/server/domain/...directories.../war/WEB-INF/lib/webpart.jar!/com/example/core/milton
Unfortunately in this situation the protocol zip is returned and not jar (though that milton annotated classes are inside the jar file as you can see on the path) and the Milton (WebDav) controller is not initialized. It looks like as a serious problem and I think that it occurs on every application which contains a controller within embedded jar file (due to the protocol which is used for JAR files).
In my opinion the line for checking the protocol should also contains the "zip" value. The simplest solution:
if (packageURL.getProtocol().equals("jar") || packageURL.getProtocol().equals("zip")) {...}
Currently using milton in a project, that uses the Java 9 module system with module-path instead of class-path, is not possible due to the split package problem:
milton-server-ce
depends on commons-beanutils:1.8.2
which is not compatible with the module system due to split-package problemmilton-server-ce
depends on milton-api
. Both contain packages with the same name, e.g. io.milton.http
.Please add support for the Java 9 module system by adding module information and define clear exports for packages.
Hello,
A NPE is thrown from io.milton.http.webdav.MkColHandler.process, line 85 upon request for creating directory / file with name '/'.
Following is the stack trace:
15:01:52.291 INFO io.milton.http.HttpManager - MKCOL :: http://127.0.0.1:8081/abc%20-%207f6f50e8-904e-4b33-9c18-fde8e86c4f1f// start
15:01:52.311 ERROR io.milton.http.StandardFilter - exception sending content
java.lang.NullPointerException: null
at io.milton.http.webdav.MkColHandler.process(MkColHandler.java:85) ~[milton-server-ce-2.6.2.2.jar:na]
at io.milton.http.webdav.MkColHandler.process(MkColHandler.java:65) ~[milton-server-ce-2.6.2.2.jar:na]
at io.milton.http.StandardFilter.process(StandardFilter.java:51) ~[milton-server-ce-2.6.2.2.jar:na]
at io.milton.http.FilterChain.process(FilterChain.java:40) [milton-server-ce-2.6.2.2.jar:na]
at io.milton.http.HttpManager.process(HttpManager.java:153) [milton-server-ce-2.6.2.2.jar:na]
at io.milton.servlet.MiltonServlet.service(MiltonServlet.java:127) [milton-server-ce-2.6.2.2.jar:na]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:594) [org.eclipse.jetty.aggregate.jetty-all-server_8.1.0.v20120127.jar:8.1.0.v20120127]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:485) [org.eclipse.jetty.aggregate.jetty-all-server_8.1.0.v20120127.jar:8.1.0.v20120127]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:69) [org.ops4j.pax.web.pax-web-jetty_3.1.1.jar:na]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) [org.eclipse.jetty.aggregate.jetty-all-server_8.1.0.v20120127.jar:8.1.0.v20120127]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:521) [org.eclipse.jetty.aggregate.jetty-all-server_8.1.0.v20120127.jar:8.1.0.v20120127]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233) [org.eclipse.jetty.aggregate.jetty-all-server_8.1.0.v20120127.jar:8.1.0.v20120127]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065) [org.eclipse.jetty.aggregate.jetty-all-server_8.1.0.v20120127.jar:8.1.0.v20120127]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:240) [org.ops4j.pax.web.pax-web-jetty_3.1.1.jar:na]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:412) [org.eclipse.jetty.aggregate.jetty-all-server_8.1.0.v20120127.jar:8.1.0.v20120127]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192) [org.eclipse.jetty.aggregate.jetty-all-server_8.1.0.v20120127.jar:8.1.0.v20120127]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999) [org.eclipse.jetty.aggregate.jetty-all-server_8.1.0.v20120127.jar:8.1.0.v20120127]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) [org.eclipse.jetty.aggregate.jetty-all-server_8.1.0.v20120127.jar:8.1.0.v20120127]
at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:77) [org.ops4j.pax.web.pax-web-jetty_3.1.1.jar:na]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111) [org.eclipse.jetty.aggregate.jetty-all-server_8.1.0.v20120127.jar:8.1.0.v20120127]
at org.eclipse.jetty.server.Server.handle(Server.java:351) [org.eclipse.jetty.aggregate.jetty-all-server_8.1.0.v20120127.jar:8.1.0.v20120127]
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:451) [org.eclipse.jetty.aggregate.jetty-all-server_8.1.0.v20120127.jar:8.1.0.v20120127]
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:916) [org.eclipse.jetty.aggregate.jetty-all-server_8.1.0.v20120127.jar:8.1.0.v20120127]
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634) [org.eclipse.jetty.aggregate.jetty-all-server_8.1.0.v20120127.jar:8.1.0.v20120127]
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230) [org.eclipse.jetty.aggregate.jetty-all-server_8.1.0.v20120127.jar:8.1.0.v20120127]
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:76) [org.eclipse.jetty.aggregate.jetty-all-server_8.1.0.v20120127.jar:8.1.0.v20120127]
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609) [org.eclipse.jetty.aggregate.jetty-all-server_8.1.0.v20120127.jar:8.1.0.v20120127]
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45) [org.eclipse.jetty.aggregate.jetty-all-server_8.1.0.v20120127.jar:8.1.0.v20120127]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599) [org.eclipse.jetty.aggregate.jetty-all-server_8.1.0.v20120127.jar:8.1.0.v20120127]
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534) [org.eclipse.jetty.aggregate.jetty-all-server_8.1.0.v20120127.jar:8.1.0.v20120127]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_20]
15:01:52.311 WARN io.milton.servlet.ServletResponse - sendError: HTTP/1.1 500
15:01:52.311 INFO io.milton.servlet.ServletResponse - Closed outputstream after sendError
15:01:52.311 INFO io.milton.http.HttpManager - MKCOL :: http://127.0.0.1:8081/abc%20-%207f6f50e8-904e-4b33-9c18-fde8e86c4f1f// finished 20ms, Status:null, Length:null
Since our last milton update we encounter regularly this error, particularly on caldav :
io.milton.http.http11.auth.CookieAuthenticationHandler.getUserUrl(257): Invalid userUrl hash, possible attempted hacking attempt.
Sometimes the sync works, but sometimes it fails with this message.
Any thoughts ?
Thanks !
When the event is a new EventResourceImpl() the event.getStart().before(start) or event.getEnd.after(end) will throw a null pointer exception.
For example when issuing a PROPFIND for property supported-report-set
<?xml version="1.0" encoding="UTF-8"?>
<D:propfind xmlns:D="DAV:"><D:prop><D:supported-report-set /></D:prop></D:propfind>
and receiving back:
<d:multistatus xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/" xmlns:card="urn:ietf:params:xml:ns:carddav" xmlns:d="DAV:"><d:response><d:href>/spica-contacts/carddav/principals/StsConnectorMockUser/</d:href><d:propstat><d:prop><d:supported-report-set><d:supported-report><d:report><d:principal-search-property-set/></d:report></d:supported-report><d:supported-report><d:report><card:addressbook-query/></d:report></d:supported-report><d:supported-report><d:report><d:principal-property-search/></d:report></d:supported-report><d:supported-report><d:report><card:addressbook-multiget/></d:report></d:supported-report><d:supported-report><d:report><d:expand-property/></d:report></d:supported-report></d:supported-report-set></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/spica-contacts/carddav/principals/StsConnectorMockUser/addressBooks/</d:href><d:propstat><d:prop><d:supported-report-set><d:supported-report><d:report><d:principal-search-property-set/></d:report></d:supported-report><d:supported-report><d:report><card:addressbook-query/></d:report></d:supported-report><d:supported-report><d:report><d:principal-property-search/></d:report></d:supported-report><d:supported-report><d:report><card:addressbook-multiget/></d:report></d:supported-report><d:supported-report><d:report><d:expand-property/></d:report></d:supported-report></d:supported-report-set></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response></d:multistatus>
Milton client only deals with parent element : <d:supported-report-set>. No child of the parent is whatsoever discover. Corresponding response object will have a List with one PropResponse containing exact one property with value "".
See PropFindResponse > getFoundProps() and PropFindResponse() expects collections only for d:prop and not for direct children of d:prop.
Most of the webdav clients out there use ISO-8859-1 charset for basic authentication. (For eg. windows webdav-MiniRedir, GNOME webdav connector etc.). Reading between RFC2617 and RFC2616, basic auth has to follow ISO standard for encoding.
Milton, on the other hand, decodes assuming UTF-8. (milton-api -> Auth). Can this be fixed ?
I'm trying to include milton community version in my existing app j2ee build with jersey. The Ressource Controllers seem's to bee correctly loaded with the annotations @ResourceController. But when I use cadaver with the url:
cadaver http://localhost:8080/torii/webdav/
I get the error:
Could not open collection:
404 Not Found
When I activate the debugger, I saw the error happened on the ResourceHandlerHelper.java in the process function (line 68) where the call
Resource r=manager.getResourceFactory().getResource(host, url);
(line 89) return me null and so you'll return a http 404
.
What version of Java does Milton require? The code cannot be built using Java7:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/travis/build/miltonio/milton2/milton-server-ce/src/main/java/io/milton/grizzly/MiltonSNICertificateManager.java:[21,20] error: cannot find symbol
[ERROR] package javax.net.ssl
/home/travis/build/miltonio/milton2/milton-server-ce/src/main/java/io/milton/grizzly/MiltonSNICertificateManager.java:[22,20] error: cannot find symbol
[ERROR] package javax.net.ssl
/home/travis/build/miltonio/milton2/milton-server-ce/src/main/java/io/milton/grizzly/MiltonSNICertificateManager.java:[25,20] error: cannot find symbol
[ERROR] /home/travis/build/miltonio/milton2/milton-server-ce/src/main/java/io/milton/grizzly/MiltonSNICertificateManager.java:[183,17] error: cannot find symbol
[ERROR] class MiltonSNICertificateManager.SNICertificateManager
/home/travis/build/miltonio/milton2/milton-server-ce/src/main/java/io/milton/grizzly/MiltonSNICertificateManager.java:[183,54] error: cannot find symbol
[ERROR] variable handshakeSession of type ExtendedSSLSession
/home/travis/build/miltonio/milton2/milton-server-ce/src/main/java/io/milton/grizzly/MiltonSNICertificateManager.java:[184,38] error: cannot find symbol
[ERROR] class MiltonSNICertificateManager.SNICertificateManager
/home/travis/build/miltonio/milton2/milton-server-ce/src/main/java/io/milton/grizzly/MiltonSNICertificateManager.java:[185,35] error: cannot find symbol
e.g. SNIHostname has been added to Java8....
According to the specification and comments in CopyHandler.processExistingResource() method missing 'Overwrite' flag should be interpreted as allowed. However CopyHandler.canOverwrite() method works differently.
The canOverwrite() method even has a workaround for Mac Finder not sending the flag, which is completely unnecessary if this method is fixed to work per the specification. Another WebDav client that doesn't send Overwrite flag is BitKinex.
Please also fix identical method in MoveHandler.
Hi,
It would be nice to see support for additional implementation specific argument resolvers for @ResourceController methods. Would it be possible to add something like Spring's org.springframework.web.method.support.HandlerMethodArgumentResolver to AnnotationResourceFactory?
รyvind
We've seen stack-traces when a vulnerability scanner sent malformed requests that Milton failed to parse; e.g.,
18 Jul 2017 13:28:24 (webdav-insecure) [door:webdav-insecure@dCacheDomain:AAVUldBCQug] exception parsing request. probably interrupted upload
io.milton.http.RequestParseException: FileUploadException
at io.milton.servlet.ServletRequest.parseRequestParameters(ServletRequest.java:230) ~[milton-server-ce-2.7.2.0.jar:na]
at io.milton.http.ResourceHandlerHelper.process(ResourceHandlerHelper.java:75) ~[milton-server-ce-2.7.2.0.jar:na]
at org.dcache.webdav.DcacheResourceHandlerHelper.process(DcacheResourceHandlerHelper.java:45) [dcache-webdav-3.2.0-SNAPSHOT.jar:3.2.0-SNAPSHOT]
at io.milton.http.http11.GetHandler.process(GetHandler.java:60) [milton-server-ce-2.7.2.0.jar:na]
[...]
Caused by: org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is %{(#nike='multipart/form-data').(#[email protected]@DEFAULT_MEMBER_ACCESS).(#_memberAccess?(#_memberAccess=#dm):((#container=#context['com.opensymphony.xwork2.ActionContext.container']).(#ognlUtil=#container.getInstance(@com.opensymphony.xwork2.ognl.OgnlUtil@class)).(#ognlUtil.getExcludedPackageNames().clear()).(#ognlUtil.getExcludedClasses().clear()).(#context.setMemberAccess(#dm)))).(#cmd='echo "Struts2045"').(#iswin=(@java.lang.System@getProperty('os.name').toLowerCase().contains('win'))).(#cmds=(#iswin?{'cmd.exe','/c',#cmd}:{'/bin/bash','-c',#cmd})).(#p=new java.lang.ProcessBuilder(#cmds)).(#p.redirectErrorStream(true)).(#process=#p.start()).(#ros=(@org.apache.struts2.ServletActionContext@getResponse().getOutputStream())).(@org.apache.commons.io.IOUtils@copy(#process.getInputStream(),#ros)).(#ros.flush())}
at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:948) ~[commons-fileupload-1.3.2.jar:1.3.2]
The problem appears to be in io.milton.http.ResourceHandlerHelper#process
, which calls Request#parseRequestParameters
in a try-catch block, catching RequestParseException
exceptions. Any such exception is logged at warn level with the stack-trace.
Although milton behaves correctly, the stack-trace is undesirable.
This issue is based on #19, which targets the character encoding used during http authentication.
I expect the following change to be useless, because enc
is the codepage independent base64 string. No need to require any special character set.
The actual question is the character encoding of the base64 decoded byte sequence stored in bytes
. When storing this byte sequence as String (UTF-16), the platform's default charset matters:
I suggest implementing some simple encoding detection at this point and constructing the string platform independent similar to:
if(isUTF8(bytes)) {
s = new String(bytes, Charset.forName("UTF-8"));
}
else {
final String latin = new String(bytes, Charset.forName("ISO-8859-1"));
final byte[] lbytes = latin.getBytes(Charset.forName("UTF-8"));
s = new String(lbytes);
}
Actually, the list of expected charsets should be configurable.
HI,
Using some Caldav clients like Lightning or Mac OSX iCal, i get 404 errors, due to incorrect urls sent by Milton. This cause issues when using our server with those clients.
See :
http://goo.gl/jMWgMx
Milton seems to incorrectly append "cals/inbox" to my urls.
Faulty code seems to be here :
https://github.com/miltonio/milton2/blob/f5ed014ee9b22e7e5f1a605521d1f790bfe0492f/milton-server-ent/src/main/java/io/milton/http/caldav/DefaultCalendarSearchService.java
I've tried debugging it without success, using the SimpletonStarter and the embedded web server. My Mac Finder interface just displays it as a read-only resource.
Hi,
I was cleaning my dependencies a bit, and I just saw that milton-api and milton-server-ce use jdom 1.1.3, which is really old and deprecated. A move to 2.0.5 would be great !
Thanks
milton-server-ce
currently uses ConcurrentLinkedHashMap v1.3.2 for caching. The latest release, v1.4.2, is significantly faster and remains Java 6 compatible.
Caffeine is the successor project and designed for Java 8. It doubles the performance and offers the all of the features that we built for Guava's cache.
When transitioning to Java 8, please consider migrating to Caffeine.
Hi,
I'm doing some work to improve our CardDAV/CalDAV server at Alinto.
I have a problem with the way addressbook-home-set is returned.
I do this request :
<?xml version="1.0" encoding="UTF-8"?>
<D:propfind xmlns:D="DAV:">
<D:prop>
<D:displayname/>
<C:addressbook-home-set xmlns:C="urn:ietf:params:xml:ns:carddav"/>
</D:prop>
</D:propfind>
It returns me this :
<?xml version="1.0" encoding="utf-8" ?>
<d:multistatus xmlns:cs="http://calendarserver.org/ns/" xmlns:d="DAV:" xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:card="urn:ietf:params:xml:ns:carddav">
<d:response>
<d:href>/webdav/carddav/book/PAB/</d:href>
<d:propstat>
<d:prop>
<d:displayname>PAB</d:displayname>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
</d:multistatus>
When it should return something like :
<d:multistatus xmlns:d="DAV:" xmlns:card="urn:ietf:params:xml:ns:carddav">
<d:response>
<d:href>/</d:href>
<d:propstat>
<d:prop>
<c:addressbook-home-set>
<d:href>/webdav/carddav/book/PAB/</d:href>
</c:addressbook-home-set>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
</d:multistatus>
Does Milton implement this correctly or is the problem on our side ? (I checked Milton and our code but didn't find where it goes wrong)
Thanks !
When run example/tuts-anno1 ๏ผ using httpclient to make PUT request, here is my code:
public class HttpClientTest {
public static void uploadTest() throws Exception{
Product product=new Product("hello");
String sUrl="http://localhost:8080/";
String user="user";
String password="password";
URI url = URI.create( sUrl );
HttpPut p = new HttpPut( url );
List<NameValuePair> values=new ArrayList();
values.add(new BasicNameValuePair("product", JSON.toJSONString(product)));
values.add(new BasicNameValuePair("newName","newName"));
values.add(new BasicNameValuePair("bytes","new content"));
UrlEncodedFormEntity encodedFormEntity=new UrlEncodedFormEntity(values);
p.setEntity(encodedFormEntity);
HttpHost httpHost=new HttpHost("localhost",8080,"http");
HttpContext context=createBasicAuthContext(httpHost,user,password);
CloseableHttpClient httpClient=HttpClients.createDefault();
HttpResponse response=httpClient.execute(httpHost,p,context);
// HttpResponse response=httpClient.execute(p);
System.out.println(response.getStatusLine());
System.out.println(EntityUtils.toString(response.getEntity()));
}
public static void main(String[] args) throws Exception{
uploadTest();
}
private static HttpClientContext createBasicAuthContext(HttpHost host,String username, String password) {
CredentialsProvider credsProvider = new BasicCredentialsProvider();
Credentials defaultCreds = new UsernamePasswordCredentials(username, password);
credsProvider.setCredentials(AuthScope.ANY, defaultCreds);
AuthCache authCache = new BasicAuthCache();
BasicScheme basicAuth = new BasicScheme();
authCache.put(host, basicAuth);
HttpClientContext context = HttpClientContext.create();
context.setCredentialsProvider(credsProvider);
context.setAuthCache(authCache);
return context;
}
}
and error happens:
ERROR io.milton.http.StandardFilter - exception sending content
java.lang.NullPointerException
at io.milton.http.http11.PutHandler.process(PutHandler.java:131)
at io.milton.http.StandardFilter.process(StandardFilter.java:50)
at io.milton.http.FilterChain.process(FilterChain.java:46)
at io.milton.http.HttpManager.process(HttpManager.java:161)
at io.milton.servlet.MiltonFilter.doMiltonProcessing(MiltonFilter.java:139)
at io.milton.servlet.MiltonFilter.doFilter(MiltonFilter.java:107)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
After debug, i find error exist in:
if (matchHelper.checkIfNoneMatch(existingResource, request)) {
log.info("if-none-match comparison failed, aborting PUT request");
responseHandler.respondPreconditionFailed(request, response, existingResource);
return;
}
//here coms NullPointerException,because path.getParent is NULL,
Resource parent = manager.getResourceFactory().getResource(host, path.getParent().toString());
if (parent instanceof CollectionResource) {
CollectionResource parentCol = (CollectionResource) parent;
storageErr = handlerHelper.checkStorageOnReplace(request, parentCol, existingResource, host);
}
```in class `PutHandler` line 130
The Milton CE module has a dependency on milton-mail-server, which in turn has a dependency on the aspirin library, which is available in the former Milton repository:
Complicating matters, the repository is hard-coded into the pom.xml
.
Many companies will have developers to go against an internal repository such as Aritfactory or Nexus as opposed to going directly to the internet. When you hard-code repository URLs AND you don't publish the artifacts to a central and replicated repo, Maven clients behind a proxy will attempt to resolve the artifact at the hard-coded URI rather than going against the companies internal repository.
There's a things I would recommend publishing the Aspirin library to Maven Central and remove the hard-coded repository URL. This is why Maven central requires you to remove repository URLs from your pom's so you don't end up in situations like this. Since the old http://milton.io/maven has been removed, we're dead in the water.
It looks like perhaps a class named RespUtils was missing from a commit - failing since 227d5e8 on October 14th.
We encountered this during an investigation to why we received 409 instead of 423. (Microsoft Office will only display the lock dialog when presented with status 423.)
While the issue we had was due to a faulty authentication integration (username=null lock) and the Milton code (isLockedOut => respondLocked => 423) now responds correctly, the code in LockResult doesn't seem correct and I wanted to give you a heads up just in case (not an active problem for us in any way).
ALREADY_LOCKED(Response.Status.SC_CONFLICT),
PRECONDITION_FAILED(Response.Status.SC_LOCKED);
ALREADY_LOCKED should probably be mapped to Response.Status.SC_LOCKED (423).
PRECONDITION_FAILED should probably be mapped to Response.Status.SC_CONFLICT (409) or , as the name suggests, Response.Status.SC_PRECONDITION_FAILED (412).
See example in FsMemoryLockManager where it responds with LockResult.failed(LockResult.FailureReason.ALREADY_LOCKED) if the resource has already been locked, which would result in 409. And LockResult.failed( LockResult.FailureReason.PRECONDITION_FAILED ), which would result in 423 if there was no preexisting lock during a refresh. Not sure if this is reachable in any way, as LockHandler.processNewLock probably would catch it in isLockedOut and not attempt to call lock..
An update to the calendar will be done as a PROPPATCH.
Hope to know when will you finish implement PROPPATCH support in annotations.
Hello,
the Milton client does not parse WebDab prop-Elements correctly. The href is not parsed correctly.
Example:
<d:multistatus xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/" xmlns:card="urn:ietf:params:xml:ns:carddav" xmlns:d="DAV:">
<d:response>
<d:href>/spica-contacts/carddav/</d:href>
<d:propstat>
<d:prop>
<d:resourcetype>
<d:collection/>
</d:resourcetype>
<d:current-user-principal>
<d:href>/spica-contacts/carddav/principals/dummyUser/</d:href>
</d:current-user-principal>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
</d:multistatus>
The problem lies in class PropFindResponse in line 82.
String value = elProp.getText();
The element "current-user-principal" has a child property "href" instead of a String value.
Kind regards,
Robert Winkler
HI,
We are using z-push on top of our caldav implementation using milton. Z-Push issues the following request (in a REPORT) when updating/deleting an item.
<C:filter>
<C:comp-filter name="VCALENDAR">
<C:comp-filter name="$component_type">
<C:prop-filter name="UID">
<C:text-match icollation="i;octet">some_uid</C:text-match>
</C:prop-filter>
</C:comp-filter>
</C:comp-filter>
</C:filter>
The problem is that milton respond with the entire list of event when the RFC states explicitly (https://tools.ietf.org/html/rfc4791#page-51) that this request should return only one, resulting in z-push failing to update/delete the event.
Looking at milton code, it seems that the only filter implemented is time-range (in CalendarQueryReport).
I'm trying to implement this specific filter I need but it would require a bigger code refactoring to properly manage filters.
Thanks !
I use milton in my Android app via SimpletonServer
. If I use Windows Explorer as client and copy large files to the server I see the progress bar progressing very fast to 99% and then waiting until the copy process is finished. It seems, that the server don't get the real file size (see screenshot).
Here is my code:
HttpManagerBuilder b = new HttpManagerBuilder();
b.setEnableFormAuth(false);
b.setEnableDigestAuth(false);
b.setEnableOptionsAuth(false);
FileSystemResourceFactory resourceFactory = new FileSystemResourceFactory(new File(preferences.getString(BASE_FOLDER)),
manager, getString(R.string.app_name));
resourceFactory.setAllowDirectoryBrowsing(true);
b.setResourceFactory(resourceFactory);
HttpManager httpManager = b.buildHttpManager();
if (server != null) {
server.stop();
}
server = new SimpletonServer(httpManager, b.getOuterWebdavResponseHandler(), 100, 10);
server.setHttpPort(Integer.parseInt(preferences.getString(PORT_WEBDAV)));
server.start();
Here are the logs:
W/System.err: 43868 [Stage-dispatchStage-2] INFO io.milton.http.HttpManager - HEAD :: 192.168.1.15:8080///Pocketshare/camtasia.dmg start
W/System.err: 43879 [Stage-dispatchStage-2] INFO io.milton.http.HttpManager - HEAD :: 192.168.1.15:8080///Pocketshare/camtasia.dmg finished 10ms, Status:HTTP/1.1 200 OK, Length:null
W/System.err: 65167 [Stage-dispatchStage-1] INFO io.milton.http.HttpManager - PUT :: 192.168.1.15:8080///Pocketshare/camtasia.dmg start
W/System.err: 65174 [Stage-dispatchStage-1] WARN io.milton.http.fs.FsResource - getCurrentLock called, but no lock manager: file: /storage/emulated/0/Download/camtasia.dmg
W/System.err: 107400 [Stage-dispatchStage-1] INFO io.milton.http.HttpManager - PUT :: 192.168.1.15:8080///Pocketshare/camtasia.dmg finished 42232ms, Status:HTTP/1.1 204, Length:null
W/System.err: 107485 [Stage-dispatchStage-3] INFO io.milton.http.HttpManager - PROPPATCH :: 192.168.1.15:8080///Pocketshare/camtasia.dmg start
W/System.err: 107506 [Stage-dispatchStage-3] WARN io.milton.http.fs.FsResource - getCurrentLock called, but no lock manager: file: /storage/emulated/0/Download/camtasia.dmg
W/System.err: 107520 [Stage-dispatchStage-3] WARN io.milton.http.webdav.PropertySourcePatchSetter - property not found: {urn:schemas-microsoft-com:}Win32CreationTime on resource: class io.milton.http.fs.FsFileResource
W/System.err: 107521 [Stage-dispatchStage-3] WARN io.milton.http.webdav.PropertySourcePatchSetter - property not found: {urn:schemas-microsoft-com:}Win32LastAccessTime on resource: class io.milton.http.fs.FsFileResource
W/System.err: 107521 [Stage-dispatchStage-3] WARN io.milton.http.webdav.PropertySourcePatchSetter - property not found: {urn:schemas-microsoft-com:}Win32LastModifiedTime on resource: class io.milton.http.fs.FsFileResource
W/System.err: 107521 [Stage-dispatchStage-3] WARN io.milton.http.webdav.PropertySourcePatchSetter - property not found: {urn:schemas-microsoft-com:}Win32FileAttributes on resource: class io.milton.http.fs.FsFileResource
W/System.err: 107532 [Stage-dispatchStage-3] INFO io.milton.http.HttpManager - PROPPATCH :: 192.168.1.15:8080///Pocketshare/camtasia.dmg finished 47ms, Status:HTTP/1.1 207 Multi-status, Length:null
I'm using intellij idea and I want to download the javadocs for milton-server-ce
(and milton-api
I suppose) so that intellij can recognize them.
I'd optionally like to download javadocs for milton-mail-server
and milton-mail-api
.
Now I'm actually using gradle But I don't mind to download javadocs manually.
At downloads page I only see sources jars, I can browse the javadocs online but what I want is to download it.
Are javadocs jars available somewhere ?
PutHandler
contains the following code:
Resource r = parent.child(path.getName());
if (r == null) {
log.info("Could not find child: " + path.getName() + " in parent: " + parent.getName() + " - " + parent.getClass());
if (parent instanceof MakeCollectionableResource) {
MakeCollectionableResource mkcol = (MakeCollectionableResource) parent;
if (!handlerHelper.checkAuthorisation(manager, mkcol, request)) {
throw new NotAuthorizedException(mkcol);
}
log.info("autocreating new folder: " + path.getName());
CollectionResource newCol = mkcol.createCollection(path.getName());
manager.getEventManager().fireEvent(new NewFolderEvent(newCol));
return newCol;
} else {
log.info("parent folder isnt a MakeCollectionableResource: " + parent.getName() + " - " + parent.getClass());
return null;
}
} else if (r instanceof CollectionResource) {
The problem is that, if there are many concurrent requests targeting the same non-existing path then it is possible for a collection that does not exist for parent.child(path.getName())
to be created by the time mkcol.createCollection(path.getName())
is called.
RFC 4918 is a little vague on how MKCOL should react if the entity already exists: it says the request must fail, but does not indicate with which status code. I believe 400 Bad Request (i.e., BadRequestException
) is the expected response, despite not being listed in RFC 4918 ยง 9.3.1. The MakeCollectionableResource
interface supports BadRequestException
but the JavaDoc doesn't describe the expectation (i.e., when this exception is to be thrown).
Assuming BadRequestException
is the expected reaction, one way of fixing this would be to catch this exception and retry the parent.child(path.getName())
request.
In the commit of the 14th of december for code quality improvement (release in version 2.6.4) the following modification has been made on file AccessControlListAnnotationHandler.java, l.132 :
-privs = new HashSet();
+privs = EnumSet.allOf(Priviledge.class);
Basically, this means everybody using ACL will have all priviledges...
Sorry if i'm mistaken, i'm a beginner with milton2 and struggling with ACL until i saw this, reverted to version 2.6.3.5 and everything's is now perfect.
The PrincipalSearchPropertySetReport prints this message every time that it is run. The default implementation returns search properties of display name, email address, first name, last name, user type and calendar addresses. This is actually a reasonable default implementation.
I would be happy to submit a patch that either:
In SpringMiltonFilter on line 201, resp.getOutputStream().flush(); is called.
This is problematic because it can lead to IllegalStateExceptions when resp.getWriter() was called previously. Furthermore it is generally advised to let the servlet container take care of flushing.
I'm encountering the IllegalStateException on WildFly 8 when a resource throws a RuntimeException during ResourceFactory.getResource()
java.lang.IllegalStateException: UT010005: Cannot call getOutputStream(), getWriter() already called
at io.undertow.servlet.spec.HttpServletResponseImpl.getOutputStream(HttpServletResponseImpl.java:283) [undertow-servlet-1.0.5.Final.jar:1.0.5.Final]
at javax.servlet.ServletResponseWrapper.getOutputStream(ServletResponseWrapper.java:142) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.servlet.ServletResponseWrapper.getOutputStream(ServletResponseWrapper.java:142) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
at org.springframework.security.web.context.SaveContextOnUpdateOrErrorResponseWrapper.getOutputStream(SaveContextOnUpdateOrErrorResponseWrapper.java:116) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at io.milton.servlet.SpringMiltonFilter.doMiltonProcessing(SpringMiltonFilter.java:201) [milton-server-ce-2.6.0.1.jar:]
at io.milton.servlet.SpringMiltonFilter.doFilter(SpringMiltonFilter.java:174) [milton-server-ce-2.6.0.1.jar:]
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.0.5.Final.jar:1.0.5.Final]
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.5.Final.jar:1.0.5.Final]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
If explicit flushing is necessary for some reason, the call in line 202 should be sufficient anyway.
Before (a month ago maybe, cannot remember when this stopped working) I could use this URL in Android (using CalDAV-Sync) and Thunderbird:
https://www.visena.com/dav/users/andreak
But now that doesn't work anymore, and it works if I specify the full path to the calendar:
https://www.visena.com/dav/users/andreak/cals/default
Is the short version supposed to work and it's jus me not having configured Milton properly?
This is the trace-log, note the 404 in the last <d:owner/>
-section of Propfind response:
<d:propstat>
<d:prop>
<d:owner/>
</d:prop>
<d:status>HTTP/1.1 404 Not Found</d:status>
</d:propstat>
2018-01-02 23:28:45,006 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CookieAuthenticationHandler - authenticate: userUrl=/dav/users/andreak/
2018-01-02 23:28:45,006 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] AnnotationResourceFactory - getResource: host: www.visena.com - url:/dav/users/andreak/
2018-01-02 23:28:45,006 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CommonPropertyAnnotationHandler - get.1: source type=class no.officenet.origo.webdav.milton.UsersHome
2018-01-02 23:28:45,006 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CommonPropertyAnnotationHandler - get.3: couldnt find annotated controllere method, look for method on the source object
2018-01-02 23:28:45,006 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CommonPropertyAnnotationHandler - get.5: found value from source property=name
2018-01-02 23:28:45,006 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CommonPropertyAnnotationHandler - get.1: source type=class no.officenet.origo.webdav.milton.UsersHome
2018-01-02 23:28:45,006 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CommonPropertyAnnotationHandler - get.3: couldnt find annotated controllere method, look for method on the source object
2018-01-02 23:28:45,006 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CommonPropertyAnnotationHandler - get.5: found value from source property=name
2018-01-02 23:28:45,006 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] AnnotationResourceFactory - findFromRoot: found a child: users with source type: class no.officenet.origo.webdav.milton.UsersHome
2018-01-02 23:28:45,006 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] AnnotationResourceFactory - findFromRoot: found a child: andreak with source type: class no.officenet.origo.report.calendar.dav.DavUser
2018-01-02 23:28:45,006 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] AnnotationResourceFactory - Found AnnoResource: class io.milton.http.annotated.AnnoPrincipalResource for path=/users/andreak with source: DavUser(3,UserId(114),andreak,Some(Andreas Joseph),Some(Krogh))
2018-01-02 23:28:45,006 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CookieAuthenticationHandler - found current user: io.milton.http.annotated.AnnoPrincipalResource@6056a690
2018-01-02 23:28:45,006 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CookieAuthenticationHandler - Do not set cookies, because token did not come from request variable
2018-01-02 23:28:45,006 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] AuthenticationService - authentication passed by: class io.milton.http.http11.auth.CookieAuthenticationHandler
2018-01-02 23:28:45,006 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] HandlerHelper - checkAuthentication: authStatus.failed =false
2018-01-02 23:28:45,006 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] HandlerHelper - checkAuthorisation: AuthStatus: logged in: null
2018-01-02 23:28:45,006 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] HandlerHelper - checkAuthorisation: got auth object
2018-01-02 23:28:45,006 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] AnnoResource - authorise: find ACL for principle=io.milton.http.annotated.AnnoPrincipalResource@6056a690
2018-01-02 23:28:45,006 WARN [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] AccessControlListAnnotationHandler - No ACL methods were found
2018-01-02 23:28:45,006 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] AnnotationResourceFactory - buildInvokeArgsExt: source=no.officenet.origo.webdav.milton.UsersHome@2443af35 on method: public java.util.List no.officenet.origo.webdav.milton.CalDavController.getUserPrivs(no.officenet.origo.webdav.milton.UsersHome,no.officenet.origo.report.calendar.dav.DavUser)
2018-01-02 23:28:45,006 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] HandlerHelper - checkAuthorisation: request permitted
2018-01-02 23:28:45,006 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] ResourceHandlerHelper - check redirect
2018-01-02 23:28:45,006 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] EventManagerImpl - fireEvent: class io.milton.event.AccessedEvent
2018-01-02 23:28:45,006 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] PropFindHandler - processExistingResource
2018-01-02 23:28:45,025 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropertyAuthoriser - checkPermissions: ok
2018-01-02 23:28:45,025 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] PropFindHandler - Listing requested propfind properties ---
2018-01-02 23:28:45,025 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] PropFindHandler - {DAV:}resourcetype
2018-01-02 23:28:45,025 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] PropFindHandler - {urn:ietf:params:xml:ns:caldav}supported-calendar-component-set
2018-01-02 23:28:45,025 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] PropFindHandler - {DAV:}supported-report-set
2018-01-02 23:28:45,025 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] PropFindHandler - {http://calendarserver.org/ns/}getctag
2018-01-02 23:28:45,025 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] PropFindHandler - {DAV:}current-user-principal
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] PropFindHandler - {DAV:}owner
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] PropFindHandler - ---
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - buildProperties: , class io.milton.http.annotated.AnnoPrincipalResource, url:, https://www.visena.com/dav/users/andreak/,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - processResource: find property:, {DAV:}resourcetype,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {DAV:}resourcetype, in property source, class io.milton.property.MultiNamespaceCustomPropertySource,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {DAV:}resourcetype, in property source, class io.milton.property.BeanPropertySource,
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] BeanPropertySource - getPropertyMetaData
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] BeanPropertySource - no annotation:
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {DAV:}resourcetype, in property source, class io.milton.http.webdav.WebDavProtocol,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] AddressBookResourceTypeHelper - getResourceTypes:io.milton.http.annotated.AnnoPrincipalResource
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CalendarResourceTypeHelper - getResourceTypes:io.milton.http.annotated.AnnoPrincipalResource
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - processResource: got value, [{DAV:}collection], from source, class io.milton.http.webdav.WebDavProtocol,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - processResource: find property:, {urn:ietf:params:xml:ns:caldav}supported-calendar-component-set,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {urn:ietf:params:xml:ns:caldav}supported-calendar-component-set, in property source, class io.milton.property.MultiNamespaceCustomPropertySource,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {urn:ietf:params:xml:ns:caldav}supported-calendar-component-set, in property source, class io.milton.property.BeanPropertySource,
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] BeanPropertySource - getPropertyMetaData
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] BeanPropertySource - no annotation:
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {urn:ietf:params:xml:ns:caldav}supported-calendar-component-set, in property source, class io.milton.http.webdav.WebDavProtocol,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {urn:ietf:params:xml:ns:caldav}supported-calendar-component-set, in property source, class io.milton.http.webdav2.WebDavLevel2Protocol,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {urn:ietf:params:xml:ns:caldav}supported-calendar-component-set, in property source, class io.milton.http.caldav.CalDavProtocol,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CalDavProtocol - getPropertyMetaData: supported-calendar-component-set
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CalDavProtocol - getProperty: supported-calendar-component-set
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CalDavProtocol - getProperty result : null for property: supported-calendar-component-set
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - processResource: got value, null, from source, class io.milton.http.caldav.CalDavProtocol,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - processResource: find property:, {DAV:}supported-report-set,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {DAV:}supported-report-set, in property source, class io.milton.property.MultiNamespaceCustomPropertySource,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {DAV:}supported-report-set, in property source, class io.milton.property.BeanPropertySource,
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] BeanPropertySource - getPropertyMetaData
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] BeanPropertySource - no annotation:
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {DAV:}supported-report-set, in property source, class io.milton.http.webdav.WebDavProtocol,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - processResource: got value, [{DAV:}acl-principal-prop-set, {DAV:}principal-search-property-set, {urn:ietf:params:xml:ns:carddav}addressbook-query, {DAV:}principal-property-search, {urn:ietf:params:xml:ns:carddav}addressbook-multiget, {DAV:}principal-match, {urn:ietf:params:xml:ns:caldav}calendar-multiget, {urn:ietf:params:xml:ns:caldav}calendar-query, {DAV:}expand-property], from source, class io.milton.http.webdav.WebDavProtocol,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - processResource: find property:, {http://calendarserver.org/ns/}getctag,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {http://calendarserver.org/ns/}getctag, in property source, class io.milton.property.MultiNamespaceCustomPropertySource,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {http://calendarserver.org/ns/}getctag, in property source, class io.milton.property.BeanPropertySource,
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] BeanPropertySource - getPropertyMetaData
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] BeanPropertySource - no annotation:
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {http://calendarserver.org/ns/}getctag, in property source, class io.milton.http.webdav.WebDavProtocol,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {http://calendarserver.org/ns/}getctag, in property source, class io.milton.http.webdav2.WebDavLevel2Protocol,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {http://calendarserver.org/ns/}getctag, in property source, class io.milton.http.caldav.CalDavProtocol,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CalDavProtocol - getPropertyMetaData: getctag
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CalDavProtocol - getProperty: getctag
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CalDavProtocol - getProperty result : null for property: getctag
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - processResource: got value, null, from source, class io.milton.http.caldav.CalDavProtocol,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - processResource: find property:, {DAV:}current-user-principal,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {DAV:}current-user-principal, in property source, class io.milton.property.MultiNamespaceCustomPropertySource,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {DAV:}current-user-principal, in property source, class io.milton.property.BeanPropertySource,
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] BeanPropertySource - getPropertyMetaData
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] BeanPropertySource - no annotation:
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {DAV:}current-user-principal, in property source, class io.milton.http.webdav.WebDavProtocol,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {DAV:}current-user-principal, in property source, class io.milton.http.webdav2.WebDavLevel2Protocol,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {DAV:}current-user-principal, in property source, class io.milton.http.caldav.CalDavProtocol,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CalDavProtocol - getPropertyMetaData: current-user-principal
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {DAV:}current-user-principal, in property source, class io.milton.http.acl.ACLProtocol,
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] ACLProtocol - getPropertyMetaData: current-user-principal
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] ACLProtocol - getProperty: current-user-principal
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CommonPropertyAnnotationHandler - get.1: source type=class no.officenet.origo.webdav.milton.UsersHome
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CommonPropertyAnnotationHandler - get.3: couldnt find annotated controllere method, look for method on the source object
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CommonPropertyAnnotationHandler - get.5: found value from source property=name
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - processResource: got value, [/dav/users/andreak/], from source, class io.milton.http.acl.ACLProtocol,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - processResource: find property:, {DAV:}owner,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {DAV:}owner, in property source, class io.milton.property.MultiNamespaceCustomPropertySource,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {DAV:}owner, in property source, class io.milton.property.BeanPropertySource,
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] BeanPropertySource - getPropertyMetaData
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] BeanPropertySource - no annotation:
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {DAV:}owner, in property source, class io.milton.http.webdav.WebDavProtocol,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {DAV:}owner, in property source, class io.milton.http.webdav2.WebDavLevel2Protocol,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {DAV:}owner, in property source, class io.milton.http.caldav.CalDavProtocol,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CalDavProtocol - getPropertyMetaData: owner
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {DAV:}owner, in property source, class io.milton.http.acl.ACLProtocol,
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] ACLProtocol - getPropertyMetaData: owner
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - look for field, {DAV:}owner, in property source, class io.milton.http.carddav.CardDavProtocol,
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CardDavProtocol - getPropertyMetaData: owner - returned: null
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - property not found in any property source: {DAV:}owner
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - some properties could not be resolved. Listing property sources:
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - - io.milton.property.MultiNamespaceCustomPropertySource
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - - io.milton.property.BeanPropertySource
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - - io.milton.http.webdav.WebDavProtocol
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - - io.milton.http.webdav2.WebDavLevel2Protocol
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - - io.milton.http.caldav.CalDavProtocol
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - - io.milton.http.acl.ACLProtocol
2018-01-02 23:28:45,026 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultPropFindPropertyBuilder - - io.milton.http.carddav.CardDavProtocol
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] PropFindHandler - responses: 1
2018-01-02 23:28:45,026 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultWebDavResponseHandler - respondPropFind
2018-01-02 23:28:45,027 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] AddressBookResourceTypeHelper - getSupportedLevels
2018-01-02 23:28:45,027 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] CalendarResourceTypeHelper - getSupportedLevels
2018-01-02 23:28:45,027 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] AccessControlledResourceTypeHelper - getSupportedLevels
2018-01-02 23:28:45,027 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultWebDavResponseHandler - Propfind response ----
2018-01-02 23:28:45,027 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultWebDavResponseHandler - <?xml version="1.0" encoding="utf-8" ?>
<d:multistatus xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/" xmlns:card="urn:ietf:params:xml:ns:carddav" xmlns:d="DAV:"><d:response><d:href>/dav/users/andreak/</d:href><d:propstat><d:prop><d:resourcetype><d:collection/></d:resourcetype><d:supported-report-set><d:supported-report><d:report><d:acl-principal-prop-set/></d:report></d:supported-report><d:supported-report><d:report><d:principal-search-property-set/></d:report></d:supported-report><d:supported-report><d:report><card:addressbook-query/></d:report></d:supported-report><d:supported-report><d:report><d:principal-property-search/></d:report></d:supported-report><d:supported-report><d:report><card:addressbook-multiget/></d:report></d:supported-report><d:supported-report><d:report><d:principal-match/></d:report></d:supported-report><d:supported-report><d:report><cal:calendar-multiget/></d:report></d:supported-report><d:supported-report><d:report><cal:calendar-query/></d:report></d:supported-report><d:supported-report><d:report><d:expand-property/></d:report></d:supported-report></d:supported-report-set><cs:getctag/><d:current-user-principal><d:href>/dav/users/andreak/</d:href></d:current-user-principal></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat><d:propstat><d:prop><d:owner/></d:prop><d:status>HTTP/1.1 404 Not Found</d:status></d:propstat></d:response></d:multistatus>
2018-01-02 23:28:45,027 TRACE [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] DefaultWebDavResponseHandler - ----
2018-01-02 23:28:45,027 DEBUG [ajp-nio-8089-exec-66] - [] [F601556253529IJG4DU] MiltonContextFilter - finally, cleaning up
2018-01-02 23:28:45,027 INFO [ajp-nio-8089-exec-66] - [] [] HttpManager - PROPFIND :: www.visena.com///dav/users/andreak/ finished 27ms, Status:HTTP/1.1 207 Multi-status, Length:null
2018-01-02 23:28:45,027 TRACE [ajp-nio-8089-exec-66] - [] [] EventManagerImpl - fireEvent: class io.milton.event.ResponseEvent
Where does Milton search for this <d:owner/>
-property, where do I implement it?
Thanks
We use Milton in a separate webapp in our project. Since we have several webapps deployed in one application server, every webapp has to use its own context path. To eliminate the context path from Milton requests i implemented your UrlAdapter interface. This works fine for Get or Delete request but not for MkCol or Move for example.
I patched milton-server-ce myself to get this to work but i would prefer to see this resolved in an official release. Here is what i did:
Changed MkColHandler to get ResourceHandlerHelper injected and changed MkColHandler.process() to:
String finalurl = HttpManager.decodeUrl(resourceHandlerHelper.getUrlAdapter().getUrl(request));
Extended UrlAdapter by:
String processUrl(String url);
and delegated to this method in UrlAdapterImpl.getUrl() by spliting the original method.
Changed MoveHandler.processExistingResource() to:
String destUrl = resourceHandlerHelper.getUrlAdapter().processUrl(dest.url);
Resource rDest = manager.getResourceFactory().getResource(dest.host, destUrl);
Hello,
how can I disable the Scheduling Extensions to CalDAV feature using the HttpManagerBuilderEnt
builder?
When using miltons's ModelAndView to render a JSP homepage it works totally fine in Tomcat. But when the application is run by Wildfly this exception occurs:
java.lang.IllegalArgumentException: UT010024: Response io.milton.servlet.OutputStreamWrappingHttpServletResponse@526faa7e was not original or a wrapper
at io.undertow.servlet.spec.RequestDispatcherImpl.includeImpl(RequestDispatcherImpl.java:324)
at io.undertow.servlet.spec.RequestDispatcherImpl.setupIncludeImpl(RequestDispatcherImpl.java:311)
at io.undertow.servlet.spec.RequestDispatcherImpl.include(RequestDispatcherImpl.java:277)
at io.milton.http.template.JspViewResolver$JspTemplateProcessor.execute(JspViewResolver.java:96)
at io.milton.http.annotated.GetAnnotationHandler.processTemplate(GetAnnotationHandler.java:120)
at io.milton.http.annotated.GetAnnotationHandler.execute(GetAnnotationHandler.java:91)
... 49 more
The solution for this is that OutputStreamWrappingHttpServletResponse must extend HttpServletResponseWrapper. I patched milton myself and now the homepage works fine in Wildfly. Here is the patched code:
public class OutputStreamWrappingHttpServletResponse extends HttpServletResponseWrapper {
private final HttpServletResponse response;
private final OutputStream out;
private final PrintWriter writer;
public OutputStreamWrappingHttpServletResponse(HttpServletResponse response, OutputStream out) {
super(response);
this.response = response;
this.out = out;
writer = new PrintWriter(out);
}
@Override
public String encodeUrl(String url) {
return MiltonServlet.response().encodeURL(url);
}
@Override
public String encodeRedirectUrl(String url) {
return MiltonServlet.response().encodeRedirectURL(url);
}
@Override
public void sendRedirect(String location) throws IOException {
MiltonServlet.response().sendRedirect(location);
}
@Override
public ServletOutputStream getOutputStream() throws IOException {
return new WrappedOutputStream();
}
@Override
public PrintWriter getWriter() throws IOException {
return writer;
}
@Override
public void flushBuffer() throws IOException {
writer.flush();
out.flush();
response.flushBuffer();
}
@Override
public void setLocale(Locale loc) {
MiltonServlet.response().setLocale(loc);
}
@Override
public Locale getLocale() {
return MiltonServlet.response().getLocale();
}
private class WrappedOutputStream extends ServletOutputStream {
@Override
public void write(int b) throws IOException {
out.write(b);
}
@Override
public void write(byte[] b) throws IOException {
out.write(b);
}
@Override
public void write(byte[] b, int off, int len) throws IOException {
out.write(b, off, len);
}
}
}
Hi,
I'm exploring how webdav works in Milton when accesses from browser, webDav mac client.
Checked out this example project. Had hard time compiling the project.
Now jetty is started however i see the following issues.
I'd like to try uploading files/viewing files etc ..
Could you help me with some example project that works.
Cheers,
Phaneendra
Hi,
with the current version of Milton i'm unable to use objects which contain a /
in their @Name
annotated methods.
The URL in the PROPFIND
listing is encoded correctly (using %2F
instead of /
), but when issuing a GET
request Milton responds with 404.
This problem is caused by the following: In ResourceHandlerHelper
line 87 the UrlAdapter
is used to decode the URL. After that, the resource factory is called to resolve the resource. The resource factories use Path.path()
to construct a Path object, which is done by splitting by /
. Unfortunatelly the encoded slash has already been decoded. That means the url-encoding for the slash has no effect.
To solve the problem you need to change it to the follwing: First split the URL in parts, then url-decode the parts.
Snippet from the AnnotationResourceFactory
:
public Resource findFromRoot(AnnoCollectionResource rootFolder, Path p) throws NotAuthorizedException, BadRequestException {
CollectionResource col = rootFolder;
Resource r = null;
for (String s : p.getParts()) {
// Url-decode the part. TODO: Use the UrlAdapter for that.
String decodedPart = Utils.decodePath(s);
if (col == null) {
if (log.isTraceEnabled()) {
At first, i implemented @modifiedDate and @uniqueid
when i changed schedule, check modifiedDate.
they show last modifieddate is 11:11:05.
And after changed i Also updatedate and return them to handler.
modifiedDate is changed to 11:14:14.
But, after update when check modifiedDate it wasn't changed.
So, i've got same Etag after Update.
Hope to know solve this problem.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.