aboutsummaryrefslogtreecommitdiff
path: root/src/support/lombok/website/Domain.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2020-05-29 00:17:20 +0200
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2020-06-23 15:55:18 +0200
commit0bbedd092a1f0f506d106943b4b400c7986c5f36 (patch)
treef07bdd4d4c2d69bd7e204d8e15e99209106aee3b /src/support/lombok/website/Domain.java
parent22ac024abb3680b298bef78052f5a13239513b29 (diff)
downloadlombok-0bbedd092a1f0f506d106943b4b400c7986c5f36.tar.gz
lombok-0bbedd092a1f0f506d106943b4b400c7986c5f36.tar.bz2
lombok-0bbedd092a1f0f506d106943b4b400c7986c5f36.zip
[build] rewriting the build system
Diffstat (limited to 'src/support/lombok/website/Domain.java')
-rw-r--r--src/support/lombok/website/Domain.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/support/lombok/website/Domain.java b/src/support/lombok/website/Domain.java
new file mode 100644
index 00000000..103c7377
--- /dev/null
+++ b/src/support/lombok/website/Domain.java
@@ -0,0 +1,26 @@
+package lombok.website;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+public class Domain {
+ private static final String DEFAULT = "https://projectlombok.org/";
+ private final String prefix;
+
+ public Domain(String arg) {
+ if (arg == null || arg.isEmpty()) this.prefix = DEFAULT;
+ else {
+ if (!arg.contains("://")) arg = "https://" + arg;
+ if (!arg.endsWith("/")) arg += "/";
+ this.prefix = arg;
+ }
+ }
+
+ public String getPrefix() {
+ return prefix;
+ }
+
+ public URL url(String path) throws MalformedURLException {
+ return new URL(prefix + path);
+ }
+}