[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: Problem with LDIFReader always requiring version number in LDIF file
- To: openldap <openldap-software@OpenLDAP.org>
- Subject: Re: Problem with LDIFReader always requiring version number in LDIF file
- From: Safdar Kureishy <safdar.kureishy@gmail.com>
- Date: Tue, 10 May 2005 20:32:20 -0700
- Content-disposition: inline
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ZceMLDFoUbGsXshYHxbujz7XqGtbqN128xKDSpjegjZRqAW6ZpJXCM4L5aJ6+/tgMaQKwiSArPY7wCUEnneqIQcTFVPc1g6YrmoL4LrGU7df48XVBL7ebHbVKANHIjXmmfSG2heDG7ano2cykgylk7MMhT/5EQrVr7SjSOztFiI=
- In-reply-to: <ca5d671a0505102025302380fc@mail.gmail.com>
- References: <ca5d671a0505102025302380fc@mail.gmail.com>
Another question I have is related to the LDIFWriter. Just like the
LDIFReader, the LDIFWriter always writes a "version: 1" line out to
the output file. How do I prevent it from writing this out to the file
everytime?
Thanks,
Safdar
On 5/10/05, Safdar Kureishy <safdar.kureishy@gmail.com> wrote:
> Hi,
>
> I couldn't find anything about this on the newsgroup, so am posting
> this message.
>
> I am running into a problem where the LDIFReader (from JLDAP) requires
> a "version" field to exist in the LDIF file that it is made to read.
> When it doesn't find the version field, the LDIFReader throws the
> following exception:
>
> LDAPLocalException: com.novell.ldap.ldif_dsml.LDIFReader: Version line
> must be the first meaningful line(on line 1 of the file) (82) Local
> Error
>
> I will always be getting LDIF files from the customer that don't have
> a version number as the first line. Instead of adding this line on the
> top of each file (which could be an expensive operation for large
> LDIFs) before parsing them, is there any way that I can make the
> LDIFReader not complain about the version and just default to version
> 1? If I add "version: 1" to the file, it works fine, so I know that
> defaulting to version 1 should be fine.
>
> I've looked around but couldn't find any way of working around this
> error in a simple way. Any help would be greatly appreciated.
>
> Thanks,
> Safdar
>