String extraPath = url.getPath();
extraPath = addIndex(root, extraPath);
PathHandler resourceHandler = new PathHandler(root, extraPath);
PathNode directory = resourceHandler.getDirectory();
final String namePrefix = resourceHandler.getFilePortion() + ".";
String[] matching = directory.list(new PathNameFilter() {
public boolean accept(PathNode dir, String name) {
return name.startsWith(namePrefix)
&& (name.charAt(name.length() - 1) != '~');
}
});