DirectoryStreamFilters.newContentTypeFilter

Mark Thornton mthornton at optrak.co.uk
Wed Oct 22 14:08:33 PDT 2008


Rémi Forax wrote:
> Hi alan, hi all,
> DirectoryStreamFilters.newContentTypeFilter signature can be changed
> a little to use the method inference algorithm.
>
> public static DirectoryStream.Filter<FileRef> 
> newContentTypeFilter(String type)
> can be written:
> public static <T extends FileRef> DirectoryStream.Filter<T> 
> newContentTypeFilter(String type)
>
> In that case, the following code is legal:
> DirectoryStream.Filter<FileRef> 
> filter1=DirectoryStreamFilters.newContentTypeFilter("text/html");
> DirectoryStream.Filter<Path> 
> filter2=DirectoryStreamFilters.newContentTypeFilter("text/html");
>
> Rémi
I can't see the benefit of this change. The obvious place to use filters 
already accepts DirectoryStream.Filter<? super Path> and thus a 
DirectoryStream.Filter<FileRef> is acceptable.

Regards,
Mark Thornton




More information about the nio-dev mailing list