I'm still very extremely new to Restlet, but I hope the information I have here
will be enough to find this bug:
In trying the sample code in the Restlet tutorial, I think I've found a problem
with using local paths, e.g.
// Create a directory able to expose a hierarchy of files
Directory directory = new Directory(getContext(),
LocalReference.createFileReference(new File("./")));
The problem seems to occur in DirectoryResource.getVariants(), where rootLength
is calculated against the file:// URL which has the relative path in it, e.g. if
your app is running at "file://foo" (pardon me if this URL seems wrong, my
debugger shows the url in my instance to start with "file:////" but that seems
like a suspicious number of "/" to me) , this would be "file://foo/./". However
around line 451 we see that the sortedSet contains URLs of the form
"file://foo/bar" rather than "file://foo/./bar", therefore later when we use the
rootLength to strip the beginning part of the file path off, we strip off
"file://foo/ba", because that is the length of "file://foo/./"
Of course this gives us a bad response, where all the file names are 2
characters shorter than they should be.
Let me know if I can provide more information.