[
https://issues.apache.org/jira/browse/IO-834?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Elliotte Rusty Harold updated IO-834:
-------------------------------------
Description:
Many methods in this base class have no useful default implementation. E.g.
public Writer getWriter(final Charset charset, final OpenOption... options)
throws IOException {
return Files.newBufferedWriter(getPath(), charset, options);
}
This only works for files, but not for URIs, char sequences, byte sequences,
etc. The file based methods should be pushed down into FileOrigin/PathOrigin
and these methods should be abstract.
To avoid breaking API they can for now throw UnsuportedOperationException
instead.
was:
Many methods in thsi base class have no useful default implementation. E.g.
public Writer getWriter(final Charset charset, final OpenOption... options)
throws IOException {
return Files.newBufferedWriter(getPath(), charset, options);
}
This only works for files, but not for URIs, char sequences, byte sequences,
etc. The file based methods should be pushed down into FileOrigin/PathOrigin
and these methods should be abstract.
To avoid breaking API they can for now throw UnsuportedOperationException
instead.
> AbstractOrigin getReader/getWriter etc, should be abstract
> ----------------------------------------------------------
>
> Key: IO-834
> URL: https://issues.apache.org/jira/browse/IO-834
> Project: Commons IO
> Issue Type: Bug
> Reporter: Elliotte Rusty Harold
> Priority: Major
>
> Many methods in this base class have no useful default implementation. E.g.
> public Writer getWriter(final Charset charset, final OpenOption...
> options) throws IOException {
> return Files.newBufferedWriter(getPath(), charset, options);
> }
> This only works for files, but not for URIs, char sequences, byte sequences,
> etc. The file based methods should be pushed down into FileOrigin/PathOrigin
> and these methods should be abstract.
> To avoid breaking API they can for now throw UnsuportedOperationException
> instead.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)