Package net.sourceforge.cardme.vcard.types

Examples of net.sourceforge.cardme.vcard.types.SoundType


    logo.setImageMediaType(ImageMediaType.PNG);
    byte[] tuxPicture2 = Util.getFileAsBytes(new File("test/images/smallTux.png"));
    logo.setLogo(tuxPicture2);
    vcard.addLogo(logo);
   
    SoundType sound = new SoundType();
    sound.setCompression(false);
    sound.setEncodingType(EncodingType.BINARY);
    sound.setAudioMediaType(AudioMediaType.OGG);
    sound.setSoundURI(new File("test/images/smallTux.png").toURI());
    vcard.addSound(sound);
   
    KeyType key = new KeyType();
    key.setKeyTextType(KeyTextType.GPG);
    key.setEncodingType(EncodingType.BINARY);
View Full Code Here


   * @param vcard
   * @throws VCardParseException
   */
  private void parseSoundType(String group, String value, List<ParameterType> paramTypeList, VCardImpl vcard) throws VCardParseException {
    try {
      SoundType soundType = new SoundType();
      parseParamTypes(soundType, paramTypeList, value, VCardTypeName.SOUND);
     
      if(soundType.isBinary()) {
        byte[] soundBytes = Base64Wrapper.decode(value);
        soundType.setCompression(false);
        soundType.setSound(soundBytes);
      }
      else {
        URI soundUri = new URI(value);
        soundType.setSoundURI(soundUri);
      }
     
      if(group != null) {
        soundType.setGroup(group);
      }
     
      vcard.addSound(soundType);
    }
    catch(Exception ex) {
View Full Code Here

TOP

Related Classes of net.sourceforge.cardme.vcard.types.SoundType

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.