X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Farachne%2Fcore%2FCore.java;h=e7eac9e55d43236fa22920436f18e543a9e7b78a;hb=df2e23567b6d478ef4c5584e7ad74aabf4617e8c;hp=ad438b1481a6e038e355194c322623c06d7a7bae;hpb=ea810d645605a8f7cdcacdf828f839a85ebe9c21;p=arachne.git diff --git a/src/net/pterodactylus/arachne/core/Core.java b/src/net/pterodactylus/arachne/core/Core.java index ad438b1..e7eac9e 100644 --- a/src/net/pterodactylus/arachne/core/Core.java +++ b/src/net/pterodactylus/arachne/core/Core.java @@ -47,6 +47,20 @@ public class Core extends AbstractService { private final List pages = new ArrayList(); // + // ACCESSORS + // + + /** + * Sets the host name of the node. + * + * @param nodeHost + * The node’s host name + */ + public void setNodeHost(String nodeHost) { + this.nodeHost = nodeHost; + } + + // // ACTIONS // @@ -171,7 +185,7 @@ public class Core extends AbstractService { * @return The joined path */ private String createPath(String[] pathComponents, int index) { - Validation.begin().isNotNull("pathComponents", pathComponents).check().isLess("index", index, pathComponents.length).check(); + Validation.begin().isNotNull("pathComponents", pathComponents).check().isLessOrEqual("index", index, pathComponents.length).check(); StringBuilder path = new StringBuilder(); for (int pathComponentIndex = index; pathComponentIndex < pathComponents.length; pathComponentIndex++) { if (path.length() > 0) { @@ -192,7 +206,7 @@ public class Core extends AbstractService { */ private URL createURL(Page page) { try { - return new URL("http://" + nodeHost + ":" + nodePort + "/"); + return new URL("http://" + nodeHost + ":" + nodePort + "/SSK@" + page.getSite().getSite().getKey() + "/" + page.getSite().getSite().getBasename() + "-" + page.getSite().getEdition() + "/" + page.getPath()); } catch (MalformedURLException mue1) { /* nearly impossible. */ }