Package com.tumblr.jumblr.types.Photo

Examples of com.tumblr.jumblr.types.Photo.PhotoType


    /**
     * Set the photo for this post
     * @param photo the photo to add
     */
    public void setPhoto(Photo photo) {
        PhotoType type = photo.getType();
        if (postType != null && !postType.equals(type)) {
            throw new IllegalArgumentException("Photos must all be the same type (source or data)");
        } else if (postType == PhotoType.SOURCE && pendingPhotos.size() > 0) {
            throw new IllegalArgumentException("Only one source URL can be provided");
        }
View Full Code Here


        details.put("type", "photo");
        details.put("link", link);
        details.put("caption", caption);

        if (pendingPhotos != null && pendingPhotos.size() > 0) {
            PhotoType type = pendingPhotos.get(0).getType();
            if (type == PhotoType.SOURCE) {
                details.put(type.getPrefix(), pendingPhotos.get(0).getDetail());
            } else if (type == PhotoType.FILE) {
                for (int i = 0; i < pendingPhotos.size(); i++) {
                    details.put(type.getPrefix() + "[" + i + "]", pendingPhotos.get(i).getDetail());
                }
            }
        }

        return details;
View Full Code Here

TOP

Related Classes of com.tumblr.jumblr.types.Photo.PhotoType

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.