aboutsummaryrefslogtreecommitdiff
path: root/src/uk/org/ury/library/LibraryUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/uk/org/ury/library/LibraryUtils.java')
-rw-r--r--src/uk/org/ury/library/LibraryUtils.java98
1 files changed, 0 insertions, 98 deletions
diff --git a/src/uk/org/ury/library/LibraryUtils.java b/src/uk/org/ury/library/LibraryUtils.java
index 474c58a..9b4471a 100644
--- a/src/uk/org/ury/library/LibraryUtils.java
+++ b/src/uk/org/ury/library/LibraryUtils.java
@@ -141,102 +141,4 @@ public class LibraryUtils
return new LibraryItem (properties);
}
-
-
- /**
- * Construct items from a server response body.
- *
- * @param response The list of strings that constitute the response.
- *
- * @return a list of LibraryItems corresponding to the item
- * stanzas in the response.
- */
-
-/* public static List<LibraryItem>
- extractItemsFromResponse (List<String> response)
- {
- List<LibraryItem> result = new ArrayList<LibraryItem> ();
-
- boolean inItem = false;
- List<String> itemBuffer = new ArrayList<String> ();
-
- for (String line : response)
- {
- if (inItem == false)
- {
- if (line.startsWith (Directive.ITEM_START.toString ()))
- {
- inItem = true;
- itemBuffer.clear ();
- }
- }
-
- if (inItem == true)
- {
- itemBuffer.add (line);
-
- if (line.startsWith (Directive.ITEM_END.toString ()))
- {
- inItem = false;
- result.add (createItemFromResponse (itemBuffer));
- }
- }
- }
-
- return result;
- }*/
-
-
- /**
- * Construct a new item from a server response fragment.
- *
- * @param response The list of strings that constitutes the response.
- * The list must begin with Directive.ITEM_START and
- * end with Directive.ITEM_END's string
- * representations and otherwise contain solely
- * Directive.ITEM_PROPERTY lines.
- *
- * @return a LibraryItem embodying the properties described
- * in the response fragment.
- *
- * @throws IllegalArgumentException if the response is
- * malformed or null, or if the instantiation of
- * DatabaseItem does not use String as its data type.
- */
-
- /*public static LibraryItem
- createItemFromResponse (List<String> response)
- {
- // TODO: More appropriate exceptions.
-
- if (response == null)
- throw new IllegalArgumentException ("Response is null.");
- else if (response.get (0).equals (Directive.ITEM_START.toString ())
- && response.get (response.size () - 1)
- .equals (Directive.ITEM_END.toString ()))
- {
- // Response of size 2 must be blank.
- if (response.size () <= 2)
- throw new IllegalArgumentException ("Blank response.");
-
- Map<LibraryItemProperty, String> properties = new HashMap<LibraryItemProperty, String> ();
-
- for (int i = 0; i < response.size () - 1; i++)
- {
- // TODO: fan out impl. details to separate class
- if (response.get (i)
- .startsWith (Directive.ITEM_PROPERTY.toString ()))
- {
- String[] responseTuple = response.get (i).split (":=");
-
- properties.put (LibraryItemProperty.getFromSQL (responseTuple[1]),
- responseTuple[2]);
- }
- }
-
- return new LibraryItem (properties);
- }
- else
- throw new IllegalArgumentException ("Malformed response.");
- }*/
}