|
From: <tre...@us...> - 2007-07-01 02:45:29
|
Revision: 206
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=206&view=rev
Author: trevorolio
Date: 2007-06-30 19:45:30 -0700 (Sat, 30 Jun 2007)
Log Message:
-----------
Removed FART debug printout.
Put unique constraint back into hibernate persist xml (problem with that can be fixed by setting proper hibernate dialect).
Removed .get(0) from http connection request properties (in WebAPIClient) until we figure out why it doesn't work on linux JVM.
Added check to MediaServlet so it responds correctly when the file store isn't set.
Modified Paths:
--------------
spaces/trunk/src/com/ogoglio/client/ClientTests.java
spaces/trunk/src/com/ogoglio/client/WebAPIClient.java
spaces/trunk/src/com/ogoglio/media/site/MediaServlet.java
spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml
spaces/trunk/src/hibernate.cfg.xml
Modified: spaces/trunk/src/com/ogoglio/client/ClientTests.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/ClientTests.java 2007-07-01 00:16:17 UTC (rev 205)
+++ spaces/trunk/src/com/ogoglio/client/ClientTests.java 2007-07-01 02:45:30 UTC (rev 206)
@@ -83,7 +83,7 @@
try {
String adminAuthCookie = WebAPIClient.authenticate(serviceURI1, ServiceInitializationPersistTasks.LIBRARY_USERNAME, ServiceInitializationPersistTasks.DEFAULT_LIBRARY_PASSWORD);
assertNotNull("got null auth cookie", adminAuthCookie);
- System.out.println("PASSED FIRST FART");
+
try {
WebAPIClient.createAccount(serviceURI1, adminAuthCookie, USERNAME1, AccountRecord.ACCOUNT_LEVEL_ADVANCED, "Susan", "Examplar", "http://example.com/susan/", "su...@ex...", PASSWORD1);
WebAPIClient.createAccount(serviceURI1, adminAuthCookie, USERNAME2, AccountRecord.ACCOUNT_LEVEL_ADVANCED, "Tina", "Examplar", "http://example.com/tina/", "ti...@ex...", PASSWORD1);
@@ -445,7 +445,7 @@
private class TestListener implements Space.Listener {
- java.util.Vector personAdds = new java.util.Vector();
+ Vector personAdds = new Vector();
Vector personRemoves = new Vector();
Modified: spaces/trunk/src/com/ogoglio/client/WebAPIClient.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/WebAPIClient.java 2007-07-01 00:16:17 UTC (rev 205)
+++ spaces/trunk/src/com/ogoglio/client/WebAPIClient.java 2007-07-01 02:45:30 UTC (rev 206)
@@ -571,7 +571,7 @@
if (connection.getResponseCode() != 200) {
return -1;
}
- String lengthHeader = (String)connection.getRequestProperties().get("Content-Length").get(0);
+ String lengthHeader = (String)connection.getRequestProperties().get("Content-Length");
if(lengthHeader == null) {
return -1;
}
Modified: spaces/trunk/src/com/ogoglio/media/site/MediaServlet.java
===================================================================
--- spaces/trunk/src/com/ogoglio/media/site/MediaServlet.java 2007-07-01 00:16:17 UTC (rev 205)
+++ spaces/trunk/src/com/ogoglio/media/site/MediaServlet.java 2007-07-01 02:45:30 UTC (rev 206)
@@ -40,9 +40,7 @@
private class MediaResource extends SiteResource {
public MediaResource() {
super("media");
- if (fileStore != null) {
addSubResource(new DataResource());
- }
}
public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
@@ -56,6 +54,11 @@
}
public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ if(fileStore == null) {
+ response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+ return;
+ }
+
String name = pathElements[pathElements.length - 1];
InputStream input = fileStore.getData(name);
if (input == null) {
@@ -68,6 +71,11 @@
}
public void doPut(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ if(fileStore == null) {
+ response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+ return;
+ }
+
String name = pathElements[pathElements.length - 1];
fileStore.write(name, request.getInputStream(), -1);
response.setStatus(HttpServletResponse.SC_OK);
@@ -76,6 +84,11 @@
}
public void doDelete(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ if(fileStore == null) {
+ response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+ return;
+ }
+
String name = pathElements[pathElements.length - 1];
if (!fileStore.exists(name)) {
@@ -95,6 +108,11 @@
}
public void doHead(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ if(fileStore == null) {
+ response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+ return;
+ }
+
String name = pathElements[pathElements.length - 1];
if (!fileStore.exists(name)) {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
@@ -107,5 +125,4 @@
return;
}
}
-
}
Modified: spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml
===================================================================
--- spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml 2007-07-01 00:16:17 UTC (rev 205)
+++ spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml 2007-07-01 02:45:30 UTC (rev 206)
@@ -77,7 +77,7 @@
<id name="username">
</id>
- <property name="email" not-null="true"/>
+ <property name="email" not-null="true" unique="true" />
<property name="accountlevel" not-null="true" />
<property name="password"/>
<property name="firstName"/>
Modified: spaces/trunk/src/hibernate.cfg.xml
===================================================================
--- spaces/trunk/src/hibernate.cfg.xml 2007-07-01 00:16:17 UTC (rev 205)
+++ spaces/trunk/src/hibernate.cfg.xml 2007-07-01 02:45:30 UTC (rev 206)
@@ -33,7 +33,7 @@
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<!-- THIS IS THE LINE YOU UNCOMMENT TO CREATE YOUR SCHEMA -->
- <!-- <property name="hbm2ddl.auto">create</property> -->
+ <!-- <property name="hbm2ddl.auto">create</property> -->
<mapping resource="com/ogoglio/persist/Persist.hbm.xml"/>
</session-factory>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|