X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fde%2Ftodesbaum%2Fjsite%2Fapplication%2FProject.java;h=c1d07f1d14f0e8d677e974ba955725e8a8f416b0;hb=675757ca5ef3355c1b79f67f66d34af579d5cef3;hp=807385a8410333db121d98f8a869360fe35f2527;hpb=e4f461213da0e30faf9e9eb2e97626abff320618;p=jSite.git diff --git a/src/de/todesbaum/jsite/application/Project.java b/src/de/todesbaum/jsite/application/Project.java index 807385a..c1d07f1 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); } @@ -235,7 +241,7 @@ public abstract class Project implements Comparable { * @return Returns the fileOptions. */ public Map getFileOptions() { - return Collections.unmodifiableMap(new HashMap(fileOptions)); + return Collections.unmodifiableMap(fileOptions); } /** @@ -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) + "/"; + } + }