Use new method names from Page and Edition.
[arachne.git] / src / net / pterodactylus / arachne / core / Core.java
index ad438b1..fb85953 100644 (file)
@@ -47,6 +47,20 @@ public class Core extends AbstractService {
        private final List<Page> pages = new ArrayList<Page>();
 
        //
+       // 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.getEdition().getSite().getKey() + "/" + page.getEdition().getSite().getBasename() + "-" + page.getEdition().getNumber() + "/" + page.getPath());
                } catch (MalformedURLException mue1) {
                        /* nearly impossible. */
                }