Package com.google.api.services.urlshortener

Examples of com.google.api.services.urlshortener.Urlshortener


        .setRefreshToken(userModel.getRefreshToken());

        // Urlshortener オブジェクトの生成
        Urlshortener.Builder builder = new Urlshortener.Builder(TRANSPORT, JSON_FACTORY, credential);
        builder.setApplicationName(Constants.GOOGLE_APPLICATION_NAME);
        Urlshortener urlshortener = builder.build();

        // URLの設定
        Url url = new Url();
        url.setLongUrl("http://plucial.com/u/" + userModel.getKey().getName() + "/a/" +activityModel.getKey().getName());

        // 短縮URLの発行
        url = urlshortener.url().insert(url).execute();

        return url.getId();
    }
View Full Code Here

TOP

Related Classes of com.google.api.services.urlshortener.Urlshortener

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.