Permalink
Browse files

Ensured that Account and Repository can be instantiated without havin…

…g to

explicitly provide a Session, in which case an anonymous Session will be
automatically constructed.
  • Loading branch information...
1 parent 52d9e3e commit fa00919224e93899e187acfc81e9476726bc0dd8 @bendiken bendiken committed Jul 27, 2011
Showing with 29 additions and 0 deletions.
  1. +10 −0 src/com/dydra/Account.java
  2. +10 −0 src/com/dydra/Repository.java
  3. +9 −0 src/com/dydra/Resource.java
View
@@ -20,6 +20,16 @@
* Constructs...
*
* @param name a valid account name
+ */
+ public Account(@NotNull final String name) {
+ super(name);
+ this.name = name;
+ }
+
+ /**
+ * Constructs...
+ *
+ * @param name a valid account name
* @param session
*/
public Account(@NotNull final String name, @NotNull final Session session) {
@@ -21,6 +21,16 @@
* Constructs...
*
* @param name a valid repository name
+ */
+ public Repository(@NotNull final String name) {
+ super(name);
+ this.name = name;
+ }
+
+ /**
+ * Constructs...
+ *
+ * @param name a valid repository name
* @param session
*/
public Repository(@NotNull final String name, @NotNull final Session session) {
@@ -31,6 +31,15 @@
*
* @param name a root-relative resource path, without the initial slash
*/
+ public Resource(@NotNull final String path) {
+ this(path, new Session()); // an anonymous session
+ }
+
+ /**
+ * Constructs...
+ *
+ * @param name a root-relative resource path, without the initial slash
+ */
public Resource(@NotNull final String path, @NotNull final Session session) {
if (path == null)
throw new NullPointerException("path cannot be null");

0 comments on commit fa00919

Please sign in to comment.