From dev-return-118951-apmail-commons-dev-archive=commons.apache.org@commons.apache.org Tue Apr 06 21:21:19 2010 Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 30145 invoked from network); 6 Apr 2010 21:21:19 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 Apr 2010 21:21:19 -0000 Received: (qmail 10373 invoked by uid 500); 6 Apr 2010 21:21:15 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 10270 invoked by uid 500); 6 Apr 2010 21:21:15 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 10209 invoked by uid 99); 6 Apr 2010 21:21:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Apr 2010 21:21:15 +0000 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=AWL,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of r.krupinski@gmail.com designates 209.85.220.210 as permitted sender) Received: from [209.85.220.210] (HELO mail-fx0-f210.google.com) (209.85.220.210) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Apr 2010 21:21:07 +0000 Received: by fxm2 with SMTP id 2so391352fxm.10 for ; Tue, 06 Apr 2010 14:20:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=zP8dvKPgk3Cnqa8uiNQAcFNgp5H2Y2tqT2AJpoP99oM=; b=H2geC/kM6WOcAZbJGoexq5zWY77PLgSdbtEHbfh66elvb6uMt7v5241SEnKYuIIwJh poWYPrzlIFUHTwkhlpEQ4v2JfXjOq9RQgQ/EhC8IBl6eZgZWaT+gtmq5Gpb7HAy5q+6i YKfeCABhf9SU0cMukxFd41GHzugi1c4VVghbE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=yCfmS5giyNxAdmLlWPtCFfr/N0w0vwUtoYcjsJsabAn4J8rFyRWm2kzNxZYtzcFgCc llQaLeEpfpR729jeFnqbiH0MYIWOu8RfMJRylY94i9I+/9J0KMhnvCkh74GR9iQzalbJ nm69XX/sWE26SNEQ6EoxRHQJxugheBXxYqNrc= Received: by 10.102.13.10 with SMTP id 10mr4268271mum.87.1270588846424; Tue, 06 Apr 2010 14:20:46 -0700 (PDT) Received: from hydrogen.hashnot.com (chello089077050173.chello.pl [89.77.50.173]) by mx.google.com with ESMTPS id s10sm2665301muh.5.2010.04.06.14.20.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 06 Apr 2010 14:20:45 -0700 (PDT) Message-ID: <4BBBA5AC.303@gmail.com> Date: Tue, 06 Apr 2010 23:20:44 +0200 From: =?UTF-8?B?UmFmYcWCIEtydXBpxYRza2k=?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9pre) Gecko/20100217 Shredder/3.0.3pre MIME-Version: 1.0 To: Commons Developers List Subject: Re: [IO] Progress Monitor References: <02AA127CD8DCDE48BC7D2DFB6C87083A0C7068@nwt-s-mbx1.rocketsoftware.com> <02AA127CD8DCDE48BC7D2DFB6C87083A0C9542@nwt-s-mbx1.rocketsoftware.com> In-Reply-To: <02AA127CD8DCDE48BC7D2DFB6C87083A0C9542@nwt-s-mbx1.rocketsoftware.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 06.04.2010 19:03, Gary Gregory wrote: >> -----Original Message----- >> From: Rafał Krupiński [mailto:r.krupinski@gmail.com] >> Sent: Tuesday, April 06, 2010 03:59 >> To: Commons Developers List >> Subject: Re: [IO] Progress Monitor [...] >> interface ProgressMonitor{ >> void begin(int whole); >> void progress(int current); >> void end(); >> } >> >> would suffice. >> What methods would you add this progress monitor support to? >> IOUtils.copy/Large - for sure, anywhere else? > > Everywhere a stream is used for input or output. Everywhere a File is used. I would like to replace my custom code with IOUtils and FilUtils calls to read from URL input streams and File objects pointing to network drives. Reading from local files that are large enough on a slow laptop drive needs feedback. > > I see adding a version of a method foo(...) with foo(..., ProgressMonitor) where foo(...) calls the other method with a NullMonitor. > > The API also needs to be able to see a message as part of the progress, so your version of begin() is too restrictive. You need to be able to say "Copying file Foo" and "Reading x of n KB", etc. The Eclipse folks have this pretty well figured out by now :) You want me to copy some bytes from one place to another and the source and the destination is provided by you. This is one operation, do I really have to tell you what am I doing? I'd say you know better. You can have your ConsoleProgressMonitor with task name and pretty messages, but copy() method really doesn't have to know that. BTW, since you've mentioned copying streams, I would add 'void begin();' to be used when the size of the input is unknown. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org