You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Behrang Saeedzadeh (JIRA)" <ji...@apache.org> on 2016/08/23 08:13:20 UTC
[jira] [Comment Edited] (IO-513) Add convenience methods for
reading class path resources
[ https://issues.apache.org/jira/browse/IO-513?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15432354#comment-15432354 ]
Behrang Saeedzadeh edited comment on IO-513 at 8/23/16 8:12 AM:
----------------------------------------------------------------
Hi Benedikt,
The JavaDoc for {{IOUtils}} says:
> General IO stream manipulation utilities.
And these new methods fall in the same category.
> The next thing is a convenience method of read files from anywhere.
{{IOUtils}} actually does that already:
{code}
public static byte[] toByteArray(final URI uri) throws IOException {
}
public static byte[] toByteArray(final URL url) throws IOException {
}
public static byte[] toByteArray(final URLConnection urlConn) throws IOException {
}
{code}
So again, I still think {{IOUtils}} is the right place for these methods.
> Further more this PR introduces the concept of CharSets to IOUtils - something IOUtils never had to deal with before.
That is wrong. Lots of methods in IOUtils already take a {{Charset}} as an argument. Here's an example:
{code}
public static String toString(final URI uri, final Charset encoding) throws IOException {
}
{code}
So, again, logically I don't see anything preventing these methods to be added to {{IOUtils}}.
was (Author: thorium):
Hi Benedikt,
The JavaDoc for {{IOUtils}} says:
> General IO stream manipulation utilities.
And these new methods fall in the same category.
> The next thing is a convenience method of read files from anywhere.
{{IOUtils}} actually does that already:
{code}
public static byte[] toByteArray(final URI uri) throws IOException {
}
public static byte[] toByteArray(final URL url) throws IOException {
}
public static byte[] toByteArray(final URLConnection urlConn) throws IOException {
}
{code}
So again, I still think {{IOUtils}} is the right place for these methods.
> Further more this PR introduces the concept of CharSets to IOUtils - something IOUtils never had to deal with before.
That is wrong. Lots of methods in IOUtils already take a `Charset` as an argument. Here's an example:
{code}
public static String toString(final URI uri, final Charset encoding) throws IOException {
}
{code}
So, again, logically I don't see anything preventing these methods to be added to {{IOUtils}}.
> Add convenience methods for reading class path resources
> --------------------------------------------------------
>
> Key: IO-513
> URL: https://issues.apache.org/jira/browse/IO-513
> Project: Commons IO
> Issue Type: New Feature
> Components: Utilities
> Reporter: Behrang Saeedzadeh
> Priority: Minor
> Labels: beginner, features, github-import, newbie
>
> Add convenience methods to {{IOUtils}} for reading class path resources and returning them as {{String}}, {{byte[]}}, and {{URL}} respectively.
> Github PR: https://github.com/apache/commons-io/pull/17
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)