Moved from Gradle to bld
This commit is contained in:
parent
b7aee90edd
commit
d326f5c6dd
83 changed files with 905 additions and 907 deletions
28
examples/gradle/src/main/java/com/example/IsgdSample.java
Normal file
28
examples/gradle/src/main/java/com/example/IsgdSample.java
Normal file
|
@ -0,0 +1,28 @@
|
|||
package com.example;
|
||||
|
||||
import net.thauvin.erik.isgd.Config;
|
||||
import net.thauvin.erik.isgd.Format;
|
||||
import net.thauvin.erik.isgd.Isgd;
|
||||
import net.thauvin.erik.isgd.IsgdException;
|
||||
|
||||
public final class IsgdSample {
|
||||
public static void main(final String[] args) {
|
||||
if (args.length > 0) {
|
||||
for (final String arg : args) {
|
||||
try {
|
||||
if (arg.contains("is.gd")) {
|
||||
System.out.println(arg + " <-- " + Isgd.lookup(arg));
|
||||
System.out.print(Isgd.lookup(new Config.Builder().shortUrl(arg).format(Format.WEB).build()));
|
||||
} else {
|
||||
System.out.println(arg + " --> " + Isgd.shorten(arg));
|
||||
}
|
||||
} catch (IsgdException e) {
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
System.err.println("Try specifying one or more URLs as arguments.");
|
||||
}
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue