Details
Description
When a REST method returns a DataSource, e.g.:
@GET
public DataSource getFile() { ...
...the CXF JAX-RS framework obtains an inputstream from the datasource but does close the stream after use. This is noticeable on windows environments for the case of a provided FileDataSource, since the underlying file cannot be deleted while this file handle remains open.
I've tracked down the problem to the writeTo() method of org.apache.cxf.jaxrs.provider.DataSourceProvider and will attach a proposed patch.