Re: [Dev] Possible Code Improvement in IOStreamUtils

2015-11-01 Thread Thusitha Thilina Dayaratne
I think we are having the same source inside the org.wso2.carbon.server. util.FileUtils Thanks Thusitha On Mon, Nov 2, 2015 at 7:56 AM, Harsha Thirimanna wrote: > Why we are not using common util classes to do these ? > > >

Re: [Dev] Possible Code Improvement in IOStreamUtils

2015-11-01 Thread Harsha Thirimanna
Why we are not using common util classes to do these ? https://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/IOUtils.html On Oct 29, 2015 10:13 AM, "Gayan Gunawardana" wrote: > Hi Kishanthan, > > We can simply fix this by putting try catch on close methods.

Re: [Dev] Possible Code Improvement in IOStreamUtils

2015-10-28 Thread Gayan Gunawardana
Hi Kishanthan, We can simply fix this by putting try catch on close methods. AFAIK stream closing shouldn't be done inside this method and it should be done by client who invoke the public api. If we remove closing statements now that might break existing clients. Please consider this for future

[Dev] Possible Code Improvement in IOStreamUtils

2015-10-26 Thread Gayan Gunawardana
Hi Kernel Team, Referring to location [1] there will be possible code Improvement. public static void copyInputStream(InputStream in, OutputStream out) throws IOException { byte[] buf = new byte[BYTE_ARRAY_SIZE]; int len; while ((len = in.read(buf)) > 0) { out.write(buf, 0,

Re: [Dev] Possible Code Improvement in IOStreamUtils

2015-10-26 Thread Kishanthan Thangarajah
You can always fix and send a PR :) On Mon, Oct 26, 2015 at 12:19 PM, Gayan Gunawardana wrote: > Hi Kernel Team, > > Referring to location [1] there will be possible code Improvement. > > public static void copyInputStream(InputStream in, OutputStream out) > throws IOException {