Paul Sandoz wrote:
> Are you using the Jersey URI content negotiation feature, where
> suffixes are mapped to media types, for example "xml" -> "text/xml" ?
>
> If so Jersey will remove the ".xml" in such cases from the path.
If that is indeed the case, you can use a method like this for getting
the name:
// Useful because file extensions are removed by Jersey due to
// our use of media type mappings (eg .xml to application/xml)
public static String getFileName(UriInfo uriInfo) {
List<PathSegment> segments = uriInfo.getPathSegments();
return segments.get(segments.size() - 1).getPath();
}
Later
Charlie