Examples of upload()


Examples of com.google.api.ads.adwords.axis.v201406.cm.MediaServiceInterface.upload()

    image.setType(MediaMediaType.IMAGE);

    Media[] media = new Media[] {image};

    // Upload image.
    Media[] result = mediaService.upload(media);

    // Display images.
    image = (Image) result[0];
    Map<MediaSize, Dimensions> dimensions = Maps.toMap(image.getDimensions());
    System.out.println("Image with id '" + image.getMediaId() + "', dimensions '"
View Full Code Here

Examples of com.google.api.adwords.v201306.cm.MediaServiceInterface.upload()

      image.setType(MediaMediaType.IMAGE);

      Media[] media = new Media[] {image};

      // Upload image.
      Media[] result = mediaService.upload(media);

      // Display images.
      if (result != null) {
        image = (Image) result[0];
        Map<MediaSize, Dimensions> dimensions = MapUtils.toMap(image.getDimensions());
View Full Code Here

Examples of com.google.api.adwords.v201309.cm.MediaServiceInterface.upload()

      image.setType(MediaMediaType.IMAGE);

      Media[] media = new Media[] {image};

      // Upload image.
      Media[] result = mediaService.upload(media);

      // Display images.
      if (result != null) {
        image = (Image) result[0];
        Map<MediaSize, Dimensions> dimensions = MapUtils.toMap(image.getDimensions());
View Full Code Here

Examples of com.gwtmobile.phonegap.client.FileMgr.FileTransfer.upload()

      public void onSuccess(String imageData) {
        String serverUrl = "http://gwtmobile-services.appspot.com/filetransfer";
          FileTransfer ft = FileMgr.newFileTransfer();
          final String lb = "<br/>";
          Notification.activityStart("Uploading", "Hang in there...");
          ft.upload(imageData, serverUrl, new FileTransferCallback() {
          @Override
          public void onSuccess(FileTransferResult result) {
            Notification.activityStop();
            text.setHTML("response code: " + result.getResponseCode() + lb +
                "bytes sent: " + result.getBytesSent() + lb +
View Full Code Here

Examples of com.jcabi.github.ReleaseAssets.upload()

     * @throws Exception If a problem occurs.
     */
    @Test
    public void removesAsset() throws Exception {
        final ReleaseAssets assets = release().assets();
        final ReleaseAsset asset = assets.upload(
            "testRemove".getBytes(), "text/plain", "remove.txt"
        );
        MatcherAssert.assertThat(
            assets.iterate(),
            Matchers.<ReleaseAsset>iterableWithSize(1)
View Full Code Here

Examples of com.jcabi.github.ReleaseAssets.upload()

        final ReleaseAssets assets = release().assets();
        // @checkstyle MagicNumberCheck (1 line)
        final int limit = 3;
        final ReleaseAsset[] bodies = new ReleaseAsset[limit];
        for (int idx = 0; idx < limit; ++idx) {
            bodies[idx] = assets.upload(
                "testRemove".getBytes(), "text/plain", "remove.txt"
            );
        }
        MatcherAssert.assertThat(
            assets.iterate(),
View Full Code Here

Examples of com.jcabi.github.ReleaseAssets.upload()

     */
    @Test
    public void fetchesRawRepresentation() throws Exception {
        final String fetch = "fetch";
        final ReleaseAssets assets = release().assets();
        final ReleaseAsset asset = assets.upload(
            fetch.getBytes(), "text/plain", "raw.txt"
        );
        final InputStream raw = new ByteArrayInputStream(
            DatatypeConverter.parseBase64Binary(
                fetch
View Full Code Here

Examples of com.jcabi.github.ReleaseAssets.upload()

     * @throws Exception If a problem occurs.
     */
    @Test
    public void uploadsNewAsset() throws Exception {
        final ReleaseAssets assets = release().assets();
        final ReleaseAsset asset = assets.upload(
            "testUpload".getBytes(), "text/plain", "upload.txt"
        );
        MatcherAssert.assertThat(
            asset.number(),
            Matchers.is(1)
View Full Code Here

Examples of com.jcabi.github.ReleaseAssets.upload()

     * @throws Exception If a problem occurs.
     */
    @Test
    public void fetchesSingleAsset() throws Exception {
        final ReleaseAssets assets = release().assets();
        final ReleaseAsset asset = assets.upload(
            "testGet".getBytes(), "text/plain", "get.txt"
        );
        MatcherAssert.assertThat(
            assets.get(asset.number()),
            Matchers.is(asset)
View Full Code Here

Examples of com.jcabi.github.ReleaseAssets.upload()

     * @throws Exception If a problem occurs.
     */
    @Test
    public void iteratesAssets() throws Exception {
        final ReleaseAssets assets = release().assets();
        assets.upload(
            "testIterate".getBytes(), "text/plain", "iterate.txt"
        );
        MatcherAssert.assertThat(
            assets.iterate(),
            Matchers.not(Matchers.emptyIterable())
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.