Examples of MAPIType


Examples of org.apache.poi.hsmf.datatypes.Types.MAPIType

               typeId == Types.BINARY.getId() || typeId == Types.DIRECTORY.getId()) {
            isVL = true;
         }
        
         // Turn the type ID into a strongly typed thing
         MAPIType type = Types.getById(typeId);
         if (type == null) {
            type = Types.createCustom(typeId);
         }
        
         // If it's a named property, rather than a standard
View Full Code Here

Examples of org.apache.poi.hsmf.datatypes.Types.MAPIType

            int typeID = LittleEndian.readUShort(value);
            int id     = LittleEndian.readUShort(value);
            long flags = LittleEndian.readUInt(value);
           
            // Turn the Type and ID into helper objects
            MAPIType type = Types.getById(typeID);
            MAPIProperty prop = MAPIProperty.get(id);
           
            // Wrap properties we don't know about as custom ones
            if (prop == MAPIProperty.UNKNOWN) {
                prop = MAPIProperty.createCustom(id, type, "Unknown " + id);
            }
            if (type == null) {
                logger.log(POILogger.WARN, "Invalid type found, expected ", prop.usualType,
                        " but got ", typeID, " for property ", prop);
                going = false;
                break;
            }
           
            // Sanity check the property's type against the value's type
            if (prop.usualType != type) {
                // Is it an allowed substitution?
                if (type == Types.ASCII_STRING && prop.usualType == Types.UNICODE_STRING ||
                    type == Types.UNICODE_STRING && prop.usualType == Types.ASCII_STRING) {
                    // It's fine to go with the specified instead of the normal
                } else if (prop.usualType == Types.UNKNOWN) {
                    // We don't know what this property normally is, but it has come
                    // through with a valid type, so use that
                    logger.log(POILogger.INFO, "Property definition for ", prop,
                            " is missing a type definition, found a value with type ", type);
                } else {
                   // Oh dear, something has gone wrong...
                   logger.log(POILogger.WARN, "Type mismatch, expected ", prop.usualType,
                              " but got ", type, " for property ", prop);
                   going = false;
                   break;
                }
            }
           
            // Work out how long the "data" is
            // This might be the actual data, or just a pointer
            //  to another chunk which holds the data itself
            boolean isPointer = false;
            int length = type.getLength();
            if (! type.isFixedLength()) {
               isPointer = true;
               length = 8;
            }
           
            // Grab the data block
View Full Code Here

Examples of org.apache.poi.hsmf.datatypes.Types.MAPIType

            int typeID = LittleEndian.readUShort(value);
            int id     = LittleEndian.readUShort(value);
            long flags = LittleEndian.readUInt(value);
           
            // Turn the Type and ID into helper objects
            MAPIType type = Types.getById(typeID);
            MAPIProperty prop = MAPIProperty.get(id);
           
            // Wrap properties we don't know about as custom ones
            if (prop == MAPIProperty.UNKNOWN) {
                prop = MAPIProperty.createCustom(id, type, "Unknown " + id);
            }
            if (type == null) {
                logger.log(POILogger.WARN, "Invalid type found, expected ", prop.usualType,
                        " but got ", typeID, " for property ", prop);
                going = false;
                break;
            }
           
            // Sanity check the property's type against the value's type
            if (prop.usualType != type) {
                // Is it an allowed substitution?
                if (type == Types.ASCII_STRING && prop.usualType == Types.UNICODE_STRING ||
                    type == Types.UNICODE_STRING && prop.usualType == Types.ASCII_STRING) {
                    // It's fine to go with the specified instead of the normal
                } else if (prop.usualType == Types.UNKNOWN) {
                    // We don't know what this property normally is, but it has come
                    // through with a valid type, so use that
                    logger.log(POILogger.INFO, "Property definition for ", prop,
                            " is missing a type definition, found a value with type ", type);
                } else {
                   // Oh dear, something has gone wrong...
                   logger.log(POILogger.WARN, "Type mismatch, expected ", prop.usualType,
                              " but got ", type, " for property ", prop);
                   going = false;
                   break;
                }
            }
           
            // TODO Detect if it is multi-valued, since if it is
            //  then even fixed-length strings store their multiple
            //  values in another chunk (much as variable length ones)
           
            // Work out how long the "data" is
            // This might be the actual data, or just a pointer
            //  to another chunk which holds the data itself
            boolean isPointer = false;
            int length = type.getLength();
            if (! type.isFixedLength()) {
               isPointer = true;
               length = 8;
            }
           
            // Grab the data block
View Full Code Here

Examples of org.apache.poi.hsmf.datatypes.Types.MAPIType

         // Now try to turn it into id + type
         try {
            int chunkId = Integer.parseInt(ids.substring(0, 4), 16);
            int typeId  = Integer.parseInt(ids.substring(4, 8), 16);
           
            MAPIType type = Types.getById(typeId);
            if (type == null) {
               type = Types.createCustom(typeId);
            }
           
            // Special cases based on the ID
View Full Code Here

Examples of org.apache.poi.hsmf.datatypes.Types.MAPIType

            int typeID = LittleEndian.readUShort(value);
            int id     = LittleEndian.readUShort(value);
            long flags = LittleEndian.readUInt(value);
           
            // Turn the Type and ID into helper objects
            MAPIType type = Types.getById(typeID);
            MAPIProperty prop = MAPIProperty.get(id);
            if (prop.usualType != type) {
               // Oh dear, something has gone wrong...
               logger.log(POILogger.WARN, "Type mismatch, expected ", type, " but got ", prop.usualType);
               going = false;
               break;
            }
           
            // Work out how long the "data" is
            // This might be the actual data, or just a pointer
            //  to another chunk which holds the data itself
            boolean isPointer = false;
            int length = type.getLength();
            if (! type.isFixedLength()) {
               isPointer = true;
               length = 8;
            }
           
            // Grab the data block
View Full Code Here

Examples of org.apache.poi.hsmf.datatypes.Types.MAPIType

            int typeID = LittleEndian.readUShort(value);
            int id     = LittleEndian.readUShort(value);
            long flags = LittleEndian.readUInt(value);
           
            // Turn the Type and ID into helper objects
            MAPIType type = Types.getById(typeID);
            MAPIProperty prop = MAPIProperty.get(id);
            if (prop.usualType != type) {
               // Oh dear, something has gone wrong...
               logger.log(POILogger.WARN, "Type mismatch, expected ", type, " but got ", prop.usualType);
               going = false;
               break;
            }
           
            // Work out how long the "data" is
            // This might be the actual data, or just a pointer
            //  to another chunk which holds the data itself
            boolean isPointer = false;
            int length = type.getLength();
            if (! type.isFixedLength()) {
               isPointer = true;
               length = 8;
            }
           
            // Grab the data block
View Full Code Here

Examples of org.apache.poi.hsmf.datatypes.Types.MAPIType

         // Now try to turn it into id + type
         try {
            int chunkId = Integer.parseInt(ids.substring(0, 4), 16);
            int typeId  = Integer.parseInt(ids.substring(4, 8), 16);
           
            MAPIType type = Types.getById(typeId);
            if (type == null) {
               type = Types.createCustom(typeId);
            }
           
            // Special cases based on the ID
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.