Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9E738200B6D for ; Tue, 23 Aug 2016 10:13:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9D005160AA5; Tue, 23 Aug 2016 08:13:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 63A40160AAD for ; Tue, 23 Aug 2016 10:13:22 +0200 (CEST) Received: (qmail 47817 invoked by uid 500); 23 Aug 2016 08:13:21 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 47417 invoked by uid 99); 23 Aug 2016 08:13:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Aug 2016 08:13:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id BE44F2C0154 for ; Tue, 23 Aug 2016 08:13:20 +0000 (UTC) Date: Tue, 23 Aug 2016 08:13:20 +0000 (UTC) From: "Behrang Saeedzadeh (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (IO-513) Add convenience methods for reading class path resources MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 23 Aug 2016 08:13:23 -0000 [ 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)