Package org.apache.tika.metadata

Examples of org.apache.tika.metadata.PropertyTypeException


    @Override
    public void set(Property property, String[] values) {
        checkKey( property.getName() );

        if (!property.isMultiValuePermitted()) {
            throw new PropertyTypeException( "Property is not of an array type" );
        }

        String[] keyParts = splitKey( property.getName() );

        String ns = registry.getNamespaceURI( keyParts[0] );
View Full Code Here


        while (names.hasMoreElements()) {
            String name = names.nextElement();
            Property property = Property.get( name );
            if (property == null) {
                throw new PropertyTypeException( "Unknown property: " + name );
            }

            String value = properties.getProperty( name );

            if (property.isMultiValuePermitted()) {
View Full Code Here

     *            the key to check
     * @return true if the key is valid otherwise false
     */
    private void checkKey(String key) throws PropertyTypeException {
        if (key == null || key.length() == 0) {
            throw new PropertyTypeException( "Key must not be null" );
        }

        String[] keyParts = splitKey( key );
        if (keyParts == null) {
            throw new PropertyTypeException( "Key must be a QName in the form prefix:localName" );
        }

        if (registry.getNamespaceURI( keyParts[0] ) == null) {
            throw new PropertyTypeException( "Key does not use a registered Namespace prefix" );
        }
    }
View Full Code Here

    @Override
    public void set(Property property, String[] values) {
        checkKey( property.getName() );

        if (!property.isMultiValuePermitted()) {
            throw new PropertyTypeException( "Property is not of an array type" );
        }

        String[] keyParts = splitKey( property.getName() );

        String ns = registry.getNamespaceURI( keyParts[0] );
View Full Code Here

        while (names.hasMoreElements()) {
            String name = names.nextElement();
            Property property = Property.get( name );
            if (property == null) {
                throw new PropertyTypeException( "Unknown property: " + name );
            }

            String value = properties.getProperty( name );

            if (property.isMultiValuePermitted()) {
View Full Code Here

     *            the key to check
     * @return true if the key is valid otherwise false
     */
    private void checkKey(String key) throws PropertyTypeException {
        if (key == null || key.length() == 0) {
            throw new PropertyTypeException( "Key must not be null" );
        }

        String[] keyParts = splitKey( key );
        if (keyParts == null) {
            throw new PropertyTypeException( "Key must be a QName in the form prefix:localName" );
        }

        if (registry.getNamespaceURI( keyParts[0] ) == null) {
            throw new PropertyTypeException( "Key does not use a registered Namespace prefix" );
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tika.metadata.PropertyTypeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.