[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-dev
Subject:    [jira] [Updated] (IO-834) AbstractOrigin getReader/getWriter etc, should be abstract
From:       "Elliotte Rusty Harold (Jira)" <jira () apache ! org>
Date:       2023-12-31 21:13:00
Message-ID: JIRA.13563250.1704028095000.99326.1704057180008 () Atlassian ! JIRA
[Download RAW message or body]


     [ 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)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic