Package weibo4j.model

Examples of weibo4j.model.WeiboException


  public ImageItem(String name, byte[] content) throws WeiboException {
    String imgtype = null;
    try {
      imgtype = getContentType(content);
    } catch (IOException e) {
      throw new WeiboException(e);
    }

    if (imgtype != null
        && (imgtype.equalsIgnoreCase("image/gif") || imgtype.equalsIgnoreCase("image/png") || imgtype
            .equalsIgnoreCase("image/jpeg"))) {
      this.content = content;
      this.name = name;
      this.contentType = imgtype;
    } else {
      throw new WeiboException("Unsupported image type, Only Suport JPG ,GIF,PNG!");
    }
  }
View Full Code Here

TOP

Related Classes of weibo4j.model.WeiboException

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.