fr.plaisance.bitly.Bit Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of simple-java-bitly Show documentation
Show all versions of simple-java-bitly Show documentation
Very simple URL shortener for Java based on Bitly
The newest version!
package fr.plaisance.bitly;
import fr.plaisance.bitly.Bitly.BitlyBuilder;
/**
*
* Entry point of the lib..
*
*
* Simple example:
*
*
*
*
* String shortUrl = Bit.ly(access_token).shorten("https://github.com/romain-warnan/simple-java-bitly");
*
*
*
* Example with proxy:
*
*
*
* String shortUrl = Bit.ly(access_token)
* .proxyUri("http://proxy.host.com:port")
* .proxyUsername("username")
* .proxyPassword("password")
* .bitly()
* .shorten(longUrl);
*
*
*
* @since 1.1
* @author Romain Warnan [email protected]
*/
public class Bit {
/**
* Static method providing a {@link Bitly} instance.
*
* @since 1.1, instead of {@link Bitly#of(String)}.
* @param access_token The secret token that you can have here, if you have a Bitly account.
* @return A builder that provide a Bitly instance when you call the {@link BitlyBuilder#bitly()} method.
*/
public static Bitly ly(String access_token) {
return new Bitly(access_token);
}
}