throw new LdapLdifException( msg ); throw new LdapLdifException( msg ); throw new LdapLdifException( msg, fnfe ); throw new LdapLdifException( lide.getMessage(), lide ); throw new LdapLdifException( ioe.getMessage(), ioe ); throw new LdapLdifException( le.getMessage(), le );
throw new LdapLdifException( msg ); throw new LdapLdifException( msg ); throw new LdapLdifException( msg, fnfe ); throw new LdapLdifException( lide.getMessage(), lide ); throw new LdapLdifException( ioe.getMessage(), ioe ); throw new LdapLdifException( le.getMessage(), le );
throw new LdapLdifException( msg ); throw new LdapLdifException( msg ); throw new LdapLdifException( msg, fnfe ); throw new LdapLdifException( lide.getMessage(), lide ); throw new LdapLdifException( ioe.getMessage(), ioe ); throw new LdapLdifException( le.getMessage(), le );
throw new LdapLdifException( msg ); throw new LdapLdifException( I18n.err( I18n.ERR_13464_FILENAME_NOT_FOUND, fileName ) ); throw new LdapLdifException( I18n.err( I18n.ERR_13464_FILENAME_NOT_FOUND, fileName ), fnfe ); throw new LdapLdifException( le.getMessage(), le ); throw new LdapLdifException( ioe.getMessage(), ioe );
throw new LdapLdifException( msg ); throw new LdapLdifException( I18n.err( I18n.ERR_13464_FILENAME_NOT_FOUND, fileName ) ); throw new LdapLdifException( I18n.err( I18n.ERR_13464_FILENAME_NOT_FOUND, fileName ), fnfe ); throw new LdapLdifException( le.getMessage(), le ); throw new LdapLdifException( ioe.getMessage(), ioe );
throw new LdapLdifException( msg ); throw new LdapLdifException( I18n.err( I18n.ERR_13464_FILENAME_NOT_FOUND, fileName ) ); throw new LdapLdifException( I18n.err( I18n.ERR_13464_FILENAME_NOT_FOUND, fileName ), fnfe ); throw new LdapLdifException( le.getMessage(), le ); throw new LdapLdifException( ioe.getMessage(), ioe );
/** * Convert a LDIF String to a JNDI attributes. * * @param ldif The LDIF string containing an attribute value * @return An Attributes instance * @exception LdapLdifException If the LDIF String cannot be converted to an Attributes */ public static Attributes getJndiAttributesFromLdif( String ldif ) throws LdapLdifException { try ( LdifAttributesReader reader = new LdifAttributesReader() ) { return AttributeUtils.toAttributes( reader.parseEntry( ldif ) ); } catch ( IOException ioe ) { throw new LdapLdifException( ioe.getMessage(), ioe ); } }
/** * Convert a LDIF String to a JNDI attributes. * * @param ldif The LDIF string containing an attribute value * @return An Attributes instance * @exception LdapLdifException If the LDIF String cannot be converted to an Attributes */ public static Attributes getJndiAttributesFromLdif( String ldif ) throws LdapLdifException { try ( LdifAttributesReader reader = new LdifAttributesReader() ) { return AttributeUtils.toAttributes( reader.parseEntry( ldif ) ); } catch ( IOException ioe ) { throw new LdapLdifException( ioe.getMessage(), ioe ); } }
/** * The main entry point of the LdifParser. It reads a buffer and returns a * List of entries. * * @param reader The buffer being processed * @return A list of entries * @throws LdapException If something went wrong */ public List<LdifEntry> parseLdif( BufferedReader reader ) throws LdapException { // Create a list that will contain the read entries List<LdifEntry> entries = new ArrayList<>(); this.reader = reader; // First get the version - if any - version = parseVersion(); prefetched = parseEntry(); // When done, get the entries one by one. for ( LdifEntry entry : this ) { if ( entry != null ) { entries.add( entry ); } else { throw new LdapLdifException( I18n.err( I18n.ERR_13429_ERROR_PARSING_LDIF, error.getLocalizedMessage() ) ); } } return entries; }
/** * Convert a LDIF String to a JNDI attributes. * * @param ldif The LDIF string containing an attribute value * @return An Attributes instance * @exception LdapLdifException If the LDIF String cannot be converted to an Attributes */ public static Attributes getJndiAttributesFromLdif( String ldif ) throws LdapLdifException { try ( LdifAttributesReader reader = new LdifAttributesReader() ) { return AttributeUtils.toAttributes( reader.parseEntry( ldif ) ); } catch ( IOException ioe ) { throw new LdapLdifException( ioe.getMessage(), ioe ); } }
/** * The main entry point of the LdifParser. It reads a buffer and returns a * List of entries. * * @param reader The buffer being processed * @return A list of entries * @throws LdapException If something went wrong */ public List<LdifEntry> parseLdif( BufferedReader reader ) throws LdapException { // Create a list that will contain the read entries List<LdifEntry> entries = new ArrayList<>(); this.reader = reader; // First get the version - if any - version = parseVersion(); prefetched = parseEntry(); // When done, get the entries one by one. for ( LdifEntry entry : this ) { if ( entry != null ) { entries.add( entry ); } else { throw new LdapLdifException( I18n.err( I18n.ERR_13429_ERROR_PARSING_LDIF, error.getLocalizedMessage() ) ); } } return entries; }
/** * The main entry point of the LdifParser. It reads a buffer and returns a * List of entries. * * @param reader The buffer being processed * @return A list of entries * @throws LdapException If something went wrong */ public List<LdifEntry> parseLdif( BufferedReader reader ) throws LdapException { // Create a list that will contain the read entries List<LdifEntry> entries = new ArrayList<>(); this.reader = reader; // First get the version - if any - version = parseVersion(); prefetched = parseEntry(); // When done, get the entries one by one. for ( LdifEntry entry : this ) { if ( entry != null ) { entries.add( entry ); } else { throw new LdapLdifException( I18n.err( I18n.ERR_13429_ERROR_PARSING_LDIF, error.getLocalizedMessage() ) ); } } return entries; }
throw new LdapLdifException( I18n.err( I18n.ERR_13442_ERROR_PARSING_LDIF_BUFFER ), ne ); throw new LdapLdifException( le.getMessage(), le ); throw new LdapLdifException( I18n.err( I18n.ERR_13450_CANNOT_CLOSE_FILE ), ioe );
throw new LdapLdifException( I18n.err( I18n.ERR_13442_ERROR_PARSING_LDIF_BUFFER ), ne ); throw new LdapLdifException( le.getMessage(), le ); throw new LdapLdifException( I18n.err( I18n.ERR_13450_CANNOT_CLOSE_FILE ), ioe );
throw new LdapLdifException( I18n.err( I18n.ERR_13442_ERROR_PARSING_LDIF_BUFFER ), ne ); throw new LdapLdifException( le.getMessage(), le ); throw new LdapLdifException( I18n.err( I18n.ERR_13450_CANNOT_CLOSE_FILE ), ioe );
/** * Parse an AttributeType/AttributeValue * * @param attributes The entry where to store the value * @param line The line to parse * @param lowerLine The same line, lowercased * @throws LdapLdifException If anything goes wrong */ private void parseAttribute( Attributes attributes, String line, String lowerLine ) throws LdapLdifException { int colonIndex = line.indexOf( ':' ); String attributeType = lowerLine.substring( 0, colonIndex ); // We should *not* have a Dn twice if ( "dn".equals( attributeType ) ) { LOG.error( I18n.err( I18n.ERR_13400_ENTRY_WITH_TWO_DNS ) ); throw new LdapLdifException( I18n.err( I18n.ERR_13439_LDIF_ENTRY_WITH_TWO_DNS ) ); } Object attributeValue = parseValue( attributeType, line, colonIndex ); // Update the entry javax.naming.directory.Attribute attribute = attributes.get( attributeType ); if ( attribute == null ) { attributes.put( attributeType, attributeValue ); } else { attribute.add( attributeValue ); } }
/** * Parse an AttributeType/AttributeValue * * @param attributes The entry where to store the value * @param line The line to parse * @param lowerLine The same line, lowercased * @throws LdapLdifException If anything goes wrong */ private void parseAttribute( Attributes attributes, String line, String lowerLine ) throws LdapLdifException { int colonIndex = line.indexOf( ':' ); String attributeType = lowerLine.substring( 0, colonIndex ); // We should *not* have a Dn twice if ( "dn".equals( attributeType ) ) { LOG.error( I18n.err( I18n.ERR_13400_ENTRY_WITH_TWO_DNS ) ); throw new LdapLdifException( I18n.err( I18n.ERR_13439_LDIF_ENTRY_WITH_TWO_DNS ) ); } Object attributeValue = parseValue( attributeType, line, colonIndex ); // Update the entry javax.naming.directory.Attribute attribute = attributes.get( attributeType ); if ( attribute == null ) { attributes.put( attributeType, attributeValue ); } else { attribute.add( attributeValue ); } }
/** * Parse an AttributeType/AttributeValue * * @param attributes The entry where to store the value * @param line The line to parse * @param lowerLine The same line, lowercased * @throws LdapLdifException If anything goes wrong */ private void parseAttribute( Attributes attributes, String line, String lowerLine ) throws LdapLdifException { int colonIndex = line.indexOf( ':' ); String attributeType = lowerLine.substring( 0, colonIndex ); // We should *not* have a Dn twice if ( "dn".equals( attributeType ) ) { LOG.error( I18n.err( I18n.ERR_13400_ENTRY_WITH_TWO_DNS ) ); throw new LdapLdifException( I18n.err( I18n.ERR_13439_LDIF_ENTRY_WITH_TWO_DNS ) ); } Object attributeValue = parseValue( attributeType, line, colonIndex ); // Update the entry javax.naming.directory.Attribute attribute = attributes.get( attributeType ); if ( attribute == null ) { attributes.put( attributeType, attributeValue ); } else { attribute.add( attributeValue ); } }
throw new LdapLdifException( I18n.err( I18n.ERR_13442_ERROR_PARSING_LDIF_BUFFER ), ne ); throw new LdapLdifException( I18n.err( I18n.ERR_13450_CANNOT_CLOSE_FILE ), ioe );
throw new LdapLdifException( I18n.err( I18n.ERR_13442_ERROR_PARSING_LDIF_BUFFER ), ne ); throw new LdapLdifException( I18n.err( I18n.ERR_13450_CANNOT_CLOSE_FILE ), ioe );