Features
Datastore
gcloud-java-datastore
now uses Datastore v1 (#1169)
Translate
gcloud-java-translate
, a new client library to interact with Google Translate, is released and is in alpha. See the docs for more information.
See TranslateExample for a complete example or API Documentation for gcloud-java-translate
javadoc.
The following snippet shows how to detect the language of some text and how to translate some text.
Complete source code can be found on
DetectLanguageAndTranslate.java.
import com.google.cloud.translate.Detection;
import com.google.cloud.translate.Translate;
import com.google.cloud.translate.Translate.TranslateOption;
import com.google.cloud.translate.TranslateOptions;
import com.google.cloud.translate.Translation;
Translate translate = TranslateOptions.defaultInstance().service();
Detection detection = translate.detect("Hola");
String detectedLanguage = detection.language();
Translation translation = translate.translate(
"World",
TranslateOption.sourceLanguage("en"),
TranslateOption.targetLanguage(detectedLanguage));
System.out.printf("Hola %s%n", translation.translatedText());
Fixes
Core
SocketException
and "insufficient data written" IOException
are now retried (#1187)
Storage NIO
- Enumerating filesystems no longer fails if
gcloud-java-nio
is in the classpath and no credentials are available (#1189)
- Rename
CloudStorageFileSystemProvider.setGCloudOptions
to CloudStorageFileSystemProvider.setStorageOptions
(#1189)