From user-return-21450-apmail-commons-user-archive=commons.apache.org@commons.apache.org Thu Jul 03 07:39:31 2008 Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 95803 invoked from network); 3 Jul 2008 07:39:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Jul 2008 07:39:30 -0000 Received: (qmail 32765 invoked by uid 500); 3 Jul 2008 07:39:28 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 32691 invoked by uid 500); 3 Jul 2008 07:39:28 -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 32680 invoked by uid 99); 3 Jul 2008 07:39:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jul 2008 00:39:28 -0700 X-ASF-Spam-Status: No, hits=3.2 required=10.0 tests=SPF_NEUTRAL,URIBL_BLACK X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [129.183.4.8] (HELO ecfrec.frec.bull.fr) (129.183.4.8) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jul 2008 07:38:31 +0000 Received: from localhost (localhost [127.0.0.1]) by ecfrec.frec.bull.fr (Postfix) with ESMTP id CB4411A036A for ; Thu, 3 Jul 2008 09:38:52 +0200 (CEST) Received: from ecfrec.frec.bull.fr ([127.0.0.1]) by localhost (ecfrec.frec.bull.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 06154-09 for ; Thu, 3 Jul 2008 09:38:47 +0200 (CEST) Received: from cyclope.frec.bull.fr (cyclope.frec.bull.fr [129.183.4.9]) by ecfrec.frec.bull.fr (Postfix) with ESMTP id 915A61A036C for ; Thu, 3 Jul 2008 09:38:47 +0200 (CEST) Received: from [127.0.0.1] (frecb000078.frec.bull.fr [129.183.149.163]) by cyclope.frec.bull.fr (Postfix) with ESMTP id 8E86A272F9 for ; Thu, 3 Jul 2008 09:38:31 +0200 (CEST) Message-ID: <486C8192.5080506@bull.net> Date: Thu, 03 Jul 2008 09:36:50 +0200 From: Thomas Favre-Bulle Reply-To: Thomas.Favre-Bulle@bull.net Organization: Bull SAS User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Commons Users List Subject: Re: [fileupload] unable to find setProgress method References: <486C742B.2040006@bull.net> <486C7BDE.40302@chello.at> In-Reply-To: <486C7BDE.40302@chello.at> Content-Type: multipart/mixed; boundary="------------030308050608030509070909" X-Virus-Scanned: by amavisd-new at frec.bull.fr X-Virus-Checked: Checked by ClamAV on apache.org --------------030308050608030509070909 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit simon.kitching@chello.at a écrit : > Thomas Favre-Bulle schrieb: >> Hi everyone ! >> >> I'm using fileupload lib in order to implement an upload progress bar. >> Unfortunately, it seems there's a problem with >> org.apache.commons.fileupload.servlet.ServletFileUpload, each time I >> try to compile I get the following error : >> >> symbol : method >> setProgressListener(infoserver.control.FileUploadListener) >> location: class org.apache.commons.fileupload.servlet.ServletFileUpload >> upload.setProgressListener(listener); >> 1 error >> >> >> Here is the code : >> >> FileItemFactory factory = new DiskFileItemFactory(); >> ServletFileUpload upload = new ServletFileUpload(factory); >> >> // set file upload progress listener >> FileUploadListener listener = new FileUploadListener(); >> HttpSession session = request.getSession(); >> >> session.setAttribute("LISTENER", listener); >> // upload servlet allows to set upload listener >> upload.setProgressListener(listener); >> >> >> I'm using version 1.2.1 and JDK 1.6. >> >> Any idea ? > Does your infoserver.control.FileUploadListener class implement the > org.apache.commons.fileupload.ProgressListener interface? > > Regards, > Simon > Yes it does : public class FileUploadListener implements ProgressListener { private volatile long bytesRead = 0L, contentLength = 0L, item = 0L; public FileUploadListener() { super(); } public void update(long aBytesRead, long aContentLength, int anItem) { bytesRead = aBytesRead; contentLength = aContentLength; item = anItem; } public long getBytesRead() { return bytesRead; } public long getContentLength() { return contentLength; } public long getItem() { return item; } I forgot to add commons.io dependecy but adding it did not solve the problem. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > For additional commands, e-mail: user-help@commons.apache.org > > > > -- Thomas Favre-Bulle Documentation Development & Software Ergonomics Bull, Architect of an Open World TM Tél. ext. : 04-76-297-508 Tél. int. : 229-7508 http://www.bull.com -- Ce message contient des informations confidentielles, couvertes par le secret professionnel ou réservées exclusivement à leur destinataire. Toute lecture, utilisation, diffusion ou divulgation sans autorisation expresse est rigoureusement interdite. Si vous n'en êtes pas le destinataire, merci de prendre contact avec l'expéditeur et de détruire ce message. This e-mail contains material that is confidential for the sole use of the intended recipient. Any review, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. --------------030308050608030509070909 Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org --------------030308050608030509070909--