Examples of ImageUpload


Examples of com.woorea.openstack.glance.model.ImageUpload

      newImage.setContainerFormat("bare");
      newImage.setName("os-java-glance-test");
      newImage = glance.images().create(newImage).execute();

      // Uploading image
      ImageUpload uploadImage = new ImageUpload(newImage);
      uploadImage.setInputStream(new ByteArrayInputStream(IMAGE_CONTENT.getBytes()));
      glance.images().upload(newImage.getId(), uploadImage).execute();

      // Downloading the image and displaying the image content
      try {
        byte[] imgContent = new byte[IMAGE_CONTENT.length()];
View Full Code Here

Examples of twitter4j.media.ImageUpload

        ConfigurationBuilder cb = getConfigurationBuilder(userModel);

        Configuration conf = cb.setMediaProvider(MediaProvider.TWITTER.name()).build();

        // ImageUploadオブジェクトの生成
        ImageUpload imageUpload = new ImageUploadFactory(conf).getInstance();

        imageUpload.upload("plucial-image", inputStream, msg);
    }
View Full Code Here

Examples of twitter4j.media.ImageUpload

        if (args.length < 1) {
            System.out.println("Usage: java twitter4j.examples.media.TwippleImageUpload [image file path] [message]");
            System.exit(-1);
        }
        try {
            ImageUpload upload = new ImageUploadFactory().getInstance(MediaProvider.TWIPPLE);
            String url;
            if (args.length >= 2) {
                url = upload.upload(new File(args[0]), args[1]);
            } else {
                url = upload.upload(new File(args[0]));
            }
            System.out.println("Successfully uploaded image to Twipple at " + url);
            System.exit(0);
        } catch (TwitterException te) {
            te.printStackTrace();
View Full Code Here

Examples of twitter4j.media.ImageUpload

        if (args.length < 1) {
            System.out.println("Usage: java twitter4j.examples.media.YFrogImageUpload [image file path] [message]");
            System.exit(-1);
        }
        try {
            ImageUpload upload = new ImageUploadFactory().getInstance(MediaProvider.YFROG);
            String url;
            if (args.length >= 2) {
                url = upload.upload(new File(args[0]), args[1]);
            } else {
                url = upload.upload(new File(args[0]));
            }
            System.out.println("Successfully uploaded image to YFrog at " + url);
            System.exit(0);
        } catch (TwitterException te) {
            te.printStackTrace();
View Full Code Here

Examples of twitter4j.media.ImageUpload

        if (args.length < 1) {
            System.out.println("Usage: java twitter4j.examples.media.ImgLyImageUpload [image file path] [message]");
            System.exit(-1);
        }
        try {
            ImageUpload upload = new ImageUploadFactory().getInstance(MediaProvider.IMG_LY);
            String url;
            if (args.length >= 2) {
                url = upload.upload(new File(args[0]), args[1]);
            } else {
                url = upload.upload(new File(args[0]));
            }
            System.out.println("Successfully uploaded image to img.ly at " + url);
            System.exit(0);
        } catch (TwitterException te) {
            te.printStackTrace();
View Full Code Here

Examples of twitter4j.media.ImageUpload

            System.out.println("Usage: java twitter4j.examples.media.TwitpicImageUpload [API key] [image file path] [message]");
            System.exit(-1);
        }
        try {
            Configuration conf = new ConfigurationBuilder().setMediaProviderAPIKey(args[0]).build();
            ImageUpload upload = new ImageUploadFactory(conf).getInstance(MediaProvider.TWITPIC);
            String url;
            if (args.length >= 3) {
                url = upload.upload(new File(args[1]), args[2]);
            } else {
                url = upload.upload(new File(args[1]));
            }
            System.out.println("Successfully uploaded image to Twitpic at " + url);
            System.exit(0);
        } catch (TwitterException te) {
            te.printStackTrace();
View Full Code Here

Examples of twitter4j.util.ImageUpload

        new Thread(new Runnable(){
            public void run() {
                try {
                    Configuration conf = new PropertyConfiguration(new Properties());
                    OAuthAuthorization oauth = new OAuthAuthorization(conf,consumerKey,consumerSecret,token);
                    ImageUpload upload = ImageUpload.getTwitpicUploader(TWITPIC_API,oauth);
                    final String resultUrl = upload.upload(file,message);
                    Status s = twitter.updateStatus(message + " " + resultUrl);
                    final String tweetUrl = "http://twitter.com/"+s.getUser().getScreenName()+"/status/"+s.getId();
                    Core.getShared().defer(new Runnable(){
                        public void run() {
                            context.addNotification("Done uploading to Twitter");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.