public static RawInputStream getMAPIPropInputStream(Message tnefMsg, int id) { try { MAPIProp prop = tnefMsg.getMAPIProps().getProp(id); if (prop != null) { MAPIValue[] vals = prop.getValues(); if (vals != null) { for (int i = 0; i < vals.length; i++) { if (vals[i] != null) { return vals[i].getRawData(); } } } } } catch (IOException e) { } return null; }
public static Boolean getMAPIPropBoolean(Message tnefMsg, int id) { try { MAPIProp prop = tnefMsg.getMAPIProps().getProp(id); if (prop != null) { MAPIValue[] vals = prop.getValues(); if (vals != null) { for (int i = 0; i < vals.length; i++) { if (vals[i] != null && vals[i].getValue() instanceof Boolean) { return (Boolean) vals[i].getValue(); } } } } } catch (IOException e) { } return false; }
public static String getMAPIPropString(Message tnefMsg, int id) { try { MAPIProp prop = tnefMsg.getMAPIProps().getProp(id); String v = null; if (prop != null) { MAPIValue[] vals = prop.getValues(); if (vals != null) { v = ""; for (int i = 0; i < vals.length; i++) { if (vals[i] != null) v += clear(toString(vals[i].getValue()), true); } } } return v; } catch (IOException e) { } return null; }
public static int getMAPIPropInt(Message tnefMsg, int id) { try { MAPIProp prop = tnefMsg.getMAPIProps().getProp(id); if (prop != null) { MAPIValue[] vals = prop.getValues(); if (vals != null) { for (int i = 0; i < vals.length; ) { String ret = toString(vals[i].getValue()); if (ret != null) { return Integer.parseInt(ret); } } } } } catch (IOException e) { } return 0; }