X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fde%2Ftodesbaum%2Fjsite%2Fapplication%2FProject.java;h=76042594199a180e08c2a6371624da0353de12b5;hb=e44d6888ffaa3151a99b9bb7cb3c887d11feb596;hp=807385a8410333db121d98f8a869360fe35f2527;hpb=1fc471e248a463bc03ebb17f16aa3eb0f3066fd9;p=jSite.git diff --git a/src/de/todesbaum/jsite/application/Project.java b/src/de/todesbaum/jsite/application/Project.java index 807385a..7604259 100644 --- a/src/de/todesbaum/jsite/application/Project.java +++ b/src/de/todesbaum/jsite/application/Project.java @@ -30,7 +30,7 @@ import de.todesbaum.util.mime.DefaultMIMETypes; * @author David Roden * @version $Id$ */ -public abstract class Project implements Comparable { +public class Project implements Comparable { protected String name; protected String description; @@ -42,6 +42,8 @@ public abstract class Project implements Comparable { protected String localPath; protected String path; protected long lastInsertionTime; + /** The edition to insert to. */ + protected int edition; protected Map fileOptions = new HashMap(); @@ -59,6 +61,7 @@ public abstract class Project implements Comparable { insertURI = project.insertURI; requestURI = project.requestURI; path = project.path; + edition = project.edition; localPath = project.localPath; indexFile = project.indexFile; lastInsertionTime = project.lastInsertionTime; @@ -197,6 +200,9 @@ public abstract class Project implements Comparable { if (uri.startsWith("SSK@")) { uri = uri.substring("SSK@".length()); } + if (uri.startsWith("USK@")) { + uri = uri.substring("USK@".length()); + } if (uri.endsWith("/")) { uri = uri.substring(0, uri.length() - 1); } @@ -247,10 +253,6 @@ public abstract class Project implements Comparable { this.fileOptions.putAll(fileOptions); } - public String getFinalRequestURI(int offset) { - return "freenet:USK@" + requestURI + "/" + path + "/"; - } - /** * {@inheritDoc} */ @@ -258,4 +260,32 @@ public abstract class Project implements Comparable { return name.compareToIgnoreCase(((Project) o).name); } + /** + * Returns the edition of the project. + * + * @return The edition of the project + */ + public int getEdition() { + return edition; + } + + /** + * Sets the edition of the project. + * + * @param edition + * The edition to set + */ + public void setEdition(int edition) { + this.edition = edition; + } + + /** + * Constructs the final request URI including the edition number. + * + * @return The final request URI + */ + public String getFinalRequestURI(int offset) { + return "freenet:USK@" + requestURI + "/" + path + "/" + (edition + offset) + "/"; + } + }