projects
/
jSite2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dcab750
)
add virtual flag in entry
author
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Mon, 26 May 2008 20:27:20 +0000
(22:27 +0200)
committer
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Mon, 26 May 2008 20:27:20 +0000
(22:27 +0200)
src/net/pterodactylus/jsite/project/AbstractEntry.java
patch
|
blob
|
history
src/net/pterodactylus/jsite/project/Entry.java
patch
|
blob
|
history
src/net/pterodactylus/jsite/project/PhysicalEntry.java
patch
|
blob
|
history
src/net/pterodactylus/jsite/project/RedirectEntry.java
patch
|
blob
|
history
diff --git
a/src/net/pterodactylus/jsite/project/AbstractEntry.java
b/src/net/pterodactylus/jsite/project/AbstractEntry.java
index
5c3c3bd
..
4f6e6ed
100644
(file)
--- a/
src/net/pterodactylus/jsite/project/AbstractEntry.java
+++ b/
src/net/pterodactylus/jsite/project/AbstractEntry.java
@@
-37,6
+37,9
@@
public abstract class AbstractEntry extends AbstractBean implements Entry {
/** The name of the “content type” property. */
public static final String PROPERTY_CONTENT_TYPE = "contentType";
/** The name of the “content type” property. */
public static final String PROPERTY_CONTENT_TYPE = "contentType";
+ /** Whether this entry is virtual. */
+ private final boolean virtual;
+
/** The name of the file. */
private String name;
/** The name of the file. */
private String name;
@@
-47,6
+50,24
@@
public abstract class AbstractEntry extends AbstractBean implements Entry {
private String contentType;
/**
private String contentType;
/**
+ * Creates a new entry.
+ *
+ * @param virtual
+ * <code>true</code> if this entry is virtual,
+ * <code>false</code> otherwise
+ */
+ protected AbstractEntry(boolean virtual) {
+ this.virtual = virtual;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isVirtual() {
+ return virtual;
+ }
+
+ /**
* {@inheritDoc}
*/
public String getName() {
* {@inheritDoc}
*/
public String getName() {
diff --git
a/src/net/pterodactylus/jsite/project/Entry.java
b/src/net/pterodactylus/jsite/project/Entry.java
index
09d9f39
..
9b3c521
100644
(file)
--- a/
src/net/pterodactylus/jsite/project/Entry.java
+++ b/
src/net/pterodactylus/jsite/project/Entry.java
@@
-30,6
+30,15
@@
import java.io.File;
public interface Entry {
/**
public interface Entry {
/**
+ * Returns whether this entry denotes a virtual file. A virtual file entry
+ * is a file entry that does not have a corresponding file on the disk.
+ *
+ * @return <code>true</code> if this entry is a virtual file entry,
+ * <code>false</code> otherwise
+ */
+ public boolean isVirtual();
+
+ /**
* Returns the name of the file. The name can contain multiple path
* components, separated by the platform’s {@link File#separatorChar}. It
* will never start with a separator, though.
* Returns the name of the file. The name can contain multiple path
* components, separated by the platform’s {@link File#separatorChar}. It
* will never start with a separator, though.
diff --git
a/src/net/pterodactylus/jsite/project/PhysicalEntry.java
b/src/net/pterodactylus/jsite/project/PhysicalEntry.java
index
e56a8a1
..
6985580
100644
(file)
--- a/
src/net/pterodactylus/jsite/project/PhysicalEntry.java
+++ b/
src/net/pterodactylus/jsite/project/PhysicalEntry.java
@@
-33,6
+33,13
@@
public class PhysicalEntry extends AbstractEntry {
private String path;
/**
private String path;
/**
+ * Creates a new entry that represents a physical file on disk.
+ */
+ public PhysicalEntry() {
+ super(false);
+ }
+
+ /**
* Returns the path of the file.
*
* @return The path of the file
* Returns the path of the file.
*
* @return The path of the file
diff --git
a/src/net/pterodactylus/jsite/project/RedirectEntry.java
b/src/net/pterodactylus/jsite/project/RedirectEntry.java
index
36f7bd6
..
82b2968
100644
(file)
--- a/
src/net/pterodactylus/jsite/project/RedirectEntry.java
+++ b/
src/net/pterodactylus/jsite/project/RedirectEntry.java
@@
-34,6
+34,13
@@
public class RedirectEntry extends AbstractEntry {
private String target;
/**
private String target;
/**
+ * Creates a new entry that redirects to another URL.
+ */
+ public RedirectEntry() {
+ super(true);
+ }
+
+ /**
* Returns the target of the redirect.
*
* @return The target of the redirect
* Returns the target of the redirect.
*
* @return The target of the redirect