Cloudfront limited time (signed) URL using Java AWS SDK - java

How do I create cloudfront signed URL using AWS SDK?
This really seems like it should be easy to do, but I just fail to see it. I generally understand how it works and could probably throw together plain Java code to do it myself. It seems weird that AWS SDK does not provide a method for this.
Earlier question but with C#: cloudfront private time limited url.
This link explains in theory how such cloudfront urls are generated, but without code examples
This link explains how it is done with Java, but it apparently uses JetS3t library instead of AWS SDK. at least I have been unable to locate the used CloudFrontService class in AWS SDK Javadoc
This link demonstrates how it is done for S3 using AWS SDK
This blog post I found referenced in another related question contains source code for a java class CloudFrontSecurityProvider to do the signing and it is not very complicated.

FYI - This blog explains how it is done in Java... very simple.
java.awsblog.com/post/Tx1VE22EWFR4H86/Accessing-Private-Content-in-Amazon-CloudFront

Related

How to integrate Drive API to my Java app (in which file?)

I am a newbie android developer and need to create an app that uploads a .zip file to Google Drive, Downloaded the API but where do I add the code, and how? Please provide a code example.
What do you mean by "downloaded the api"?
Drive has some pretty good documentation on instantiating the drive client as well as an activity to demonstrate different use cases. These may be all the examples you need.
Drive Examples
You can find good examples in the documentation for the Drive API
https://developers.google.com/drive/android/examples/
Or look here: https://developers.google.com/drive/android/intro to find some more explanation about how it all works

Where is the Java Google Gmail Api located?

I know this may seem like a really stupid question, but I'm actually having a lot of trouble finding the Google Gmail API. I've searched all over Google's developer website, but all I get are downloads to the general google-api-client.
Those are the classes that I need, but when I try to import them with the standard google client api, it says the classes are missing.
That is what Google keeps telling me to download, the google-api-services-gmail-v1-rev32-java-1.20.00 but in the libs folder there aren't any unique jars for the gmail api. In fact, all of the libs in this zip file are the same libs in the general api, which I've already used and can't find the classes I need.
I remember when I used the drive api for Google it was a pain to find the actual drive libraries, but I eventually found them. All I'm asking is where can I find the actually, gmail specific, libraries. A link would be helpful! Thanks! :D
Your best bet is to resort to Maven to manage this for you. Even if you don't want to use Maven to manage dependencies directly, you can still use the repository to find your JAR files:
http://mvnrepository.com/artifact/com.google.apis/google-api-services-gmail/v1-rev32-1.20.0
And this is the direct download link, present on the website above:
http://central.maven.org/maven2/com/google/apis/google-api-services-gmail/v1-rev32-1.20.0/google-api-services-gmail-v1-rev32-1.20.0.jar
Here is the link to the client API:
http://mvnrepository.com/artifact/com.google.api-client/google-api-client/1.20.0

com.google.api.services.Oauth2 not found

I'm trying to implement Google Plus login in a web application.
Currently following this guide.
As I'm using Java on the server side, I am trying to follow the Java code snippets. My callback uri points to a servlet. Currently on step 8, I encountered my first real problem: I cannot validate the retrieved token, because Oauth2 class is not present in the Google API client library.After some googling, I found this, and it looked promising, but after carefully comparing the two, the included jars are exactly the same as the Google API client - neither contains the Oauth2 class.After more searching, I found some documentation that mentions the class I am looking for, but I am not able to find the jar containing it.
My question is: where can I find the Oauth2 class if not in the two packages mentioned above?
Found it in the Maven repository.
http://mvnrepository.com/artifact/com.google.apis/google-api-services-oauth2

Google transliteration API in Java Swing project

I'm working on a transliteration project in Java Swing. It can access the internet, but I'm unable to set it up. How do we do that? Do we need to download the Google API libraries or just a function call will do?
Here are some useful Transliteration links:
The Google Transliterate API Devloper's Guide
Google API library for Java for download
(I think it has all API libraries of Google:Translate, transliterate, search, etc.)
I spent a lot of time, but Icouldn't find how to set up the Transliteration API, not even at SO.
Seems the transliteration API is deprecated and is not included in the Java client, only in the JavaScript client.
The actual calls the JS library makes are pretty simple and could easily be replicated from anywhere:
http://www.google.com/inputtools/request?ime=transliteration_en_ru&num=5&cp=0&cs=0&ie=utf-8&oe=utf-8&text=prosto
Don't know if doing that is against Google's terms, though. Probably it is.
You could also try running the Ajax client in Rhino. You'll need env-js which provides a pure javascript DOM environment.
It's just hideous enough to work!

How to search in google by using java code?

How to search in google by using java code?
I would have told you to use one of their API. Unfortunatly, there does not seems to exist one for search. As a consequence, you'll have to use HtmlUnit to emulate a browser and go see their results (obviously, you can go the harder way and do some HTTP queries by yourself. But who would do that ?).
Unfortunately the SOAP API has been deprecated. But you can use the AJAX API for non-JavaScript purposes as well, see for example:
http://www.ajaxlines.com/ajax/stuff/article/using_google_is_ajax_search_api_with_java.php
Update Jul 3 2018: This link is now broken; some code from there can be found here: https://stackoverflow.com/a/1546475/55787, and I found a copy of the article here: https://blog.csdn.net/hgd250/article/details/5214702
Furthermore the orginial link to the AJAX API is now broken, too. It seems that this one is closest to the original meaning: https://developers.google.com/custom-search/json-api/v1/overview?csw=1
See also this StackOverflow question:
google java api for google search

Categories

Resources