There is a bug with file: scheme references with no host dropping 2 characters,
http://restlet.tigris.org/issues/show_bug.cgi?id=352 but I cant tell if that's manifested here. Can you check to see if either or both of these behaves as expected? 1) // Create a directory able to expose a hierarchy of files Directory directory = new Directory(getContext(), LocalReference.createFileReference(new File("./").getPath())); 2) // Create a directory able to expose a hierarchy of files Directory directory = new Directory(getContext(), LocalReference.createFileReference(new File("./")).getTargetRef()); - Rob ----- Original Message ----- From: "Joel Nelson" <[EMAIL PROTECTED]> To: [email protected] Sent: Sunday, September 16, 2007 12:25:31 PM (GMT-0500) America/New_York Subject: Bug: DirectoryResource is broken if used with relative paths 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.

