Package com.substanceofcode.utils

Examples of com.substanceofcode.utils.CompatibilityBase64


        String dateString = nodes[UPDDATE];
        if(dateString.length()>0) {
          m_upddate = new Date(Long.parseLong(dateString));
        }
        // Encode for better UTF-8 and to allow '|' in the name.
        CompatibilityBase64 b64 = new CompatibilityBase64();
        byte[] decodedName = b64.decode(m_name);
        try {
          m_name = new String( decodedName , "UTF-8" );
        } catch (UnsupportedEncodingException e) {
          m_name = new String( decodedName );
        }
View Full Code Here


                String serializedItem = rssItem.serialize();
                serializedItems += serializedItem + ".";
            }
        }
    String encodedName;
        CompatibilityBase64 b64 = new CompatibilityBase64();
    try {
      encodedName = b64.encode( m_name.getBytes("UTF-8") );
    } catch (UnsupportedEncodingException e) {
      encodedName = b64.encode( m_name.getBytes() );
    }
        String storeString = encodedName + "|" +
                              m_url + "|" + m_username + "|" +
                m_password + "|" +
                ((m_upddate == null) ? "" :
View Full Code Here

        }

    String title = m_title.replace('|', '\n');
        String preData = title + "|" + m_link + "|" + dateString + "|" +
          m_enclosure + "|" + (m_unreadItem ? "1" : "0") + "|" + m_desc;
        CompatibilityBase64 b64 = new CompatibilityBase64();
        String encodedSerializedData = null;
    try {
      encodedSerializedData = b64.encode( preData.getBytes("UTF-8") );
    } catch (UnsupportedEncodingException e) {
      encodedSerializedData = b64.encode( preData.getBytes() );
    }
    return encodedSerializedData;
  }
View Full Code Here

    boolean unreadItem = false;
    CompatibilityRssItem2 item = null;

    try {
      // CompatibilityBase64 decode
      CompatibilityBase64 b64 = new CompatibilityBase64();
      byte[] decodedData = b64.decode(data);
      try {
        data = new String( decodedData, "UTF-8" );
      } catch (UnsupportedEncodingException e) {
        data = new String( decodedData );
      }
View Full Code Here

      int PASSWORD = 3;
      m_password = nodes[ startIndex + PASSWORD ];
      if (iTunesCapable) {
        m_password = m_password.replace(CONE, '|');
        // Dencode so that password is not in regular lettters.
        CompatibilityBase64 b64 = new CompatibilityBase64();
        byte[] decodedPassword = b64.decode(m_password);
        try {
          m_password = new String( decodedPassword , "UTF-8" );
        } catch (UnsupportedEncodingException e) {
          m_password = new String( decodedPassword );
        }
        if (hasPipe) {
          m_password = m_password.replace(CONE, '|');
        }
      }
     
      m_items = new Vector();
      if (firstSettings) {
        // Given the bugs with the first settings, we do not
        // retrieve the items so that we can restore them
        // without the bugs.
        return;
      }

      int ITEMS = (iTunesCapable ? ITUNES_ITEMS : 5);
      int UPDDATE = 4;
      String dateString = nodes[startIndex + UPDDATE];
      if(dateString.length()>0) {
        if (iTunesCapable) {
          m_upddate = new Date(Long.parseLong(dateString, 16));
        } else {
          m_upddate = new Date(Long.parseLong(dateString));
        }
      }
      if (iTunesCapable && hasPipe) {
        if (hasPipe) {
          m_name = m_name.replace(CONE, '|');
        }
      } else {
        if (!iTunesCapable) {
          // Dencode for better UTF-8 and to allow '|' in the name.
          // For iTunesCapable, replace | with (char)1
          CompatibilityBase64 b64 = new CompatibilityBase64();
          byte[] decodedName = b64.decode(m_name);
          try {
            m_name = new String( decodedName , "UTF-8" );
          } catch (UnsupportedEncodingException e) {
            m_name = new String( decodedName );
          }
View Full Code Here

    String name = m_name.replace('|', CONE);
    String username = m_username.replace('|' , CONE);
    String password = m_password.replace('|' , CONE);
    String encodedPassword;
    // Encode password to make reading password difficult
        CompatibilityBase64 b64 = new CompatibilityBase64();
    try {
      encodedPassword = b64.encode( m_password.getBytes("UTF-8") );
    } catch (UnsupportedEncodingException e) {
      encodedPassword = b64.encode( m_password.getBytes() );
    }
      String dateString;
        if(m_date==null){
            dateString = "";
        } else {
View Full Code Here

    return preData;
  }

    public String serialize3() {
        String preData = unencodedSerialize3();
        CompatibilityBase64 b64 = new CompatibilityBase64();
        String encodedSerializedData = null;
    try {
      encodedSerializedData = b64.encode( preData.getBytes("UTF-8") );
    } catch (UnsupportedEncodingException e) {
      encodedSerializedData = b64.encode( preData.getBytes() );
    }
    return encodedSerializedData;
  }
View Full Code Here

     
  /** Deserialize the object */
  public static CompatibilityRssItem3 deserialize3(String data) {
    try {
      // CompatibilityBase64 decode
      CompatibilityBase64 b64 = new CompatibilityBase64();
      byte[] decodedData = b64.decode(data);
      try {
        data = new String( decodedData, "UTF-8" );
      } catch (UnsupportedEncodingException e) {
        data = new String( decodedData );
      }
View Full Code Here

    this serialize does not need to know if Itunes is capable/enabled given
    that no fields were added to make it capable/enabled
    */
    public String serialize3() {
        String preData = unencodedSerialize3();
        CompatibilityBase64 b64 = new CompatibilityBase64();
        String encodedSerializedData = null;
    try {
      encodedSerializedData = b64.encode( preData.getBytes("UTF-8") );
    } catch (UnsupportedEncodingException e) {
      encodedSerializedData = b64.encode( preData.getBytes() );
    }
    return encodedSerializedData;
  }
View Full Code Here

  /** Deserialize the object **/
  public static CompatibilityRssItem3 deserialize3(String encodedData) {
    try {
      // CompatibilityBase64 decode
      CompatibilityBase64 b64 = new CompatibilityBase64();
      byte[] decodedData = b64.decode(encodedData);
      String data;
      try {
        data = new String( decodedData, "UTF-8" );
      } catch (UnsupportedEncodingException e) {
        data = new String( decodedData );
View Full Code Here

TOP

Related Classes of com.substanceofcode.utils.CompatibilityBase64

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.