Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 56270 invoked from network); 10 Nov 2010 23:42:52 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 10 Nov 2010 23:42:51 -0000 Received: (qmail 51816 invoked by uid 500); 10 Nov 2010 23:43:22 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 51739 invoked by uid 500); 10 Nov 2010 23:43:21 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 51731 invoked by uid 99); 10 Nov 2010 23:43:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Nov 2010 23:43:21 +0000 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=FREEMAIL_FROM,FREEMAIL_REPLY,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of niall.pemberton@gmail.com designates 209.85.161.171 as permitted sender) Received: from [209.85.161.171] (HELO mail-gx0-f171.google.com) (209.85.161.171) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Nov 2010 23:43:16 +0000 Received: by gxk28 with SMTP id 28so879864gxk.30 for ; Wed, 10 Nov 2010 15:42:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=0iamp40ydWaVMIKphIGZM0uGpzAMZllU6gzVx2iVaIM=; b=wrP94JO0FG+CJZhpXyI9vAmw1HsPuXDWU25Ec/DtayBU9rrDUw/4wH2kpmrRhOI2w5 KBWiYFBk9CsxV3ajEjo/QPzaPuICtN+KbZYdBsvxgQt+GsNbFW2TrTZWl9AGX9H8mF0i lb7neGYJXvm6w2ZNPQbbI4PKYGilahvabmnUM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=dH8pcTAJHmcFV0kVx7L5oQVZAdlFG6c8JDlTBpv5nNnA9fxKQc5ExZI1XsR6SwuwG9 NM2keFHxjTlVXI6gWKAAUZ65XbLDC3YTpuAnWo5qn/y/r+tnQipgyv01VB27fCudxF4S VlQ8+Go2hTCe5jpaDPzpaprPFPqxR37tbqcPo= MIME-Version: 1.0 Received: by 10.42.239.195 with SMTP id kx3mr125393icb.396.1289432574898; Wed, 10 Nov 2010 15:42:54 -0800 (PST) Received: by 10.42.117.131 with HTTP; Wed, 10 Nov 2010 15:42:54 -0800 (PST) In-Reply-To: References: Date: Wed, 10 Nov 2010 23:42:54 +0000 Message-ID: Subject: Re: [IO] tailer sample code From: Niall Pemberton To: Commons Users List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 2010/11/10 S=E9bastien Roux : > I'm not a Java specialist but quite curious about the new tailer classes = in > commons IO 2.0. > > Now what does this mean : TailerListener listener =3D ... Its just an abbreviation to show the line is not complete. You have to create your own TailerListener implementation which does whatever you want with the lines added to the file. So for example you could do something like the following: /** * TailerListener implementation. */ public class ShowLinesListener extends TailerListenerAdapter { @Override public void handle(String line) { System.out.println(line); } } Then create the Tailer with your implementation: TailerListener listener =3D new ShowLinesListener(); Tailer tailer =3D Tailer.create(file, listener, delay); http://commons.apache.org/io/api-release/org/apache/commons/io/input/Tailer= .html Niall > I mean what I am supposed to put after the equal? Would you have a quick > example regarding basic file tailing implementation? > > I also checked this without getting the picture =3D> > http://permalink.gmane.org/gmane.comp.jakarta.commons.scm/9636 > > Many thanks for any guidance you may provide. > > S=E9bastien Roux > mail: =A0roux.sebastien@gmail.com > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org