Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 29078 invoked from network); 20 May 2009 09:53:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 May 2009 09:53:54 -0000 Received: (qmail 44409 invoked by uid 500); 20 May 2009 09:54:05 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 44339 invoked by uid 500); 20 May 2009 09:54:05 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 44329 invoked by uid 99); 20 May 2009 09:54:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 May 2009 09:54:05 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [194.125.145.37] (HELO mercury.propylon.com) (194.125.145.37) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 May 2009 09:53:53 +0000 Received: from [213.94.211.166] (helo=[192.168.213.119]) by mercury.propylon.com with esmtp (Exim 4.50) id 1M6iTK-0003RZ-Df for java-user@lucene.apache.org; Wed, 20 May 2009 10:52:26 +0100 Message-ID: <4A13D316.6000702@propylon.com> Date: Wed, 20 May 2009 10:53:26 +0100 From: John Byrne User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: java-user@lucene.apache.org Subject: Re: How to create a new index References: <8db6d74a0905200243j74e94fb1r7f74021381610177@mail.gmail.com> In-Reply-To: <8db6d74a0905200243j74e94fb1r7f74021381610177@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SA-Do-Not-Run: Yes X-SA-Exim-Connect-IP: 213.94.211.166 X-SA-Exim-Mail-From: john.byrne@propylon.com X-SA-Exim-Scanned: No (on mercury.propylon.com); SAEximRunCond expanded to false X-Virus-Checked: Checked by ClamAV on apache.org You can do this with pure Java. Create a file object with the path you want, check if it exists, and it not, create it: File newIndexDir = new File("/foo/bar") if(!newFileDir.exists()) { newDirFile.mkdirs(); } The 'mkdirs()' method creates any necessary parent directories. If you want to automate the generation of the path itself, then there are several ways to do it, but the best way really depends on *why* you're generating a new index. For instance, you could just create a timestamped name, but that name might not be very meaningful. Hope that helps! -John KK wrote: > How to create a new index? everytime I need to do so , I've to create a new > directory and put the path to that, right? how to automate the creation of > new directory? > > I'm a new user of lucene. Please help me out. > > Thanks, > KK. > > > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.339 / Virus Database: 270.12.35/2123 - Release Date: 05/19/09 17:59:00 > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org