Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Repackaged everything to correspond to new RestExpress project name. …

…Updated release to 0.5 version.
  • Loading branch information...
commit a1074897ce27d19b650e120db11d2aa78bfe7402 1 parent f3de860
@tfredrich tfredrich authored
Showing with 154 additions and 152 deletions.
  1. +1 −1  .project
  2. +1 −1  NOTICE
  3. +8 −1 README
  4. +1 −1  build.properties
  5. +2 −2 build.xml
  6. +2 −2 examples/kickstart/README
  7. +16 −16 examples/kickstart/src/java/com/strategicgains/kickstart/RestServer.java
  8. +1 −1  examples/kickstart/src/java/com/strategicgains/kickstart/Routes.java
  9. +2 −2 examples/kickstart/src/java/com/strategicgains/kickstart/service/KickStartService.java
  10. +7 −7 src/java/com/strategicgains/{restx → restexpress}/Request.java
  11. +1 −1  src/java/com/strategicgains/{restx → restexpress}/Response.java
  12. +3 −3 src/java/com/strategicgains/{restx/RestX.java → restexpress/RestExpress.java}
  13. +1 −1  src/java/com/strategicgains/{restx → restexpress}/domain/Link.java
  14. +1 −1  src/java/com/strategicgains/{restx → restexpress}/exception/BadRequestException.java
  15. +1 −1  src/java/com/strategicgains/{restx → restexpress}/exception/ConfigurationException.java
  16. +1 −3 src/java/com/strategicgains/{restx → restexpress}/exception/ConflictException.java
  17. +1 −1  src/java/com/strategicgains/{restx → restexpress}/exception/CouldNotDeleteException.java
  18. +1 −1  src/java/com/strategicgains/{restx → restexpress}/exception/CouldNotReadException.java
  19. +1 −1  src/java/com/strategicgains/{restx → restexpress}/exception/CouldNotUpdateException.java
  20. +1 −3 src/java/com/strategicgains/{restx → restexpress}/exception/ForbiddenException.java
  21. +1 −3 src/java/com/strategicgains/{restx → restexpress}/exception/NotFoundException.java
  22. +1 −1  src/java/com/strategicgains/{restx → restexpress}/exception/ServiceException.java
  23. +1 −3 src/java/com/strategicgains/{restx → restexpress}/exception/UnauthorizedException.java
  24. +1 −1  src/java/com/strategicgains/{restx → restexpress}/exception/ValidationException.java
  25. +11 −11 src/java/com/strategicgains/{restx → restexpress}/pipeline/DefaultRequestHandler.java
  26. +1 −1  src/java/com/strategicgains/{restx → restexpress}/pipeline/PipelineBuilder.java
  27. +3 −3 src/java/com/strategicgains/{restx → restexpress}/pipeline/Postprocessor.java
  28. +4 −3 src/java/com/strategicgains/{restx → restexpress}/pipeline/PostprocessorAware.java
  29. +3 −2 src/java/com/strategicgains/{restx → restexpress}/pipeline/Preprocessor.java
  30. +2 −2 src/java/com/strategicgains/{restx → restexpress}/pipeline/PreprocessorAware.java
  31. +5 −5 src/java/com/strategicgains/{restx → restexpress}/response/DefaultHttpResponseWriter.java
  32. +3 −3 src/java/com/strategicgains/{restx → restexpress}/response/ErrorHttpResponseWriter.java
  33. +3 −3 src/java/com/strategicgains/{restx → restexpress}/response/HttpResponseWriter.java
  34. +4 −4 src/java/com/strategicgains/{restx → restexpress}/route/Action.java
  35. +6 −6 src/java/com/strategicgains/{restx → restexpress}/route/Route.java
  36. +6 −6 src/java/com/strategicgains/{restx → restexpress}/route/RouteBuilder.java
  37. +1 −1  src/java/com/strategicgains/{restx → restexpress}/route/RouteMapping.java
  38. +5 −5 src/java/com/strategicgains/{restx → restexpress}/route/RouteResolver.java
  39. +9 −9 src/java/com/strategicgains/{restx → restexpress}/serialization/DefaultSerializationResolver.java
  40. +1 −1  src/java/com/strategicgains/{restx → restexpress}/serialization/DeserializationException.java
  41. +1 −1  src/java/com/strategicgains/{restx → restexpress}/serialization/Deserializer.java
  42. +1 −1  src/java/com/strategicgains/{restx → restexpress}/serialization/SerializationException.java
  43. +1 −1  src/java/com/strategicgains/{restx → restexpress}/serialization/SerializationProcessor.java
  44. +1 −1  src/java/com/strategicgains/{restx → restexpress}/serialization/Serializer.java
  45. +2 −2 src/java/com/strategicgains/{restx → restexpress}/serialization/json/DefaultJsonProcessor.java
  46. +1 −1  src/java/com/strategicgains/{restx → restexpress}/serialization/json/GsonDateSerializer.java
  47. +1 −1  src/java/com/strategicgains/{restx → restexpress}/serialization/json/GsonSerializer.java
  48. +1 −1  src/java/com/strategicgains/{restx → restexpress}/serialization/json/GsonTimestampSerializer.java
  49. +2 −2 src/java/com/strategicgains/{restx → restexpress}/serialization/text/DefaultTxtProcessor.java
  50. +2 −2 src/java/com/strategicgains/{restx → restexpress}/serialization/xml/DefaultXmlProcessor.java
  51. +2 −2 src/java/com/strategicgains/{restx → restexpress}/url/UrlMatch.java
  52. +1 −1  src/java/com/strategicgains/{restx → restexpress}/url/UrlPattern.java
  53. +1 −1  src/java/com/strategicgains/{restx → restexpress}/util/Bootstraps.java
  54. +1 −1  src/java/com/strategicgains/{restx → restexpress}/util/Identifiable.java
  55. +3 −3 src/java/com/strategicgains/{restx → restexpress}/util/LinkUtils.java
  56. +1 −1  src/java/com/strategicgains/{restx → restexpress}/util/MapStringFormat.java
  57. +3 −2 src/java/com/strategicgains/{restx → restexpress}/util/Resolver.java
  58. +1 −1  src/java/com/strategicgains/{restx → restexpress}/util/Validatable.java
  59. +3 −3 test/java/com/strategicgains/{restx → restexpress}/route/RouteMappingTest.java
  60. +1 −1  test/java/com/strategicgains/{restx → restexpress}/url/UrlPatternTest.java
View
2  .project
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>RestX</name>
+ <name>RestExpress</name>
<comment></comment>
<projects>
</projects>
View
2  NOTICE
@@ -1,4 +1,4 @@
-The RestX Project
+The RestExpress Project
Copyright 2009, Strategic Gains, Inc.
This product includes software developed at
View
9 README
@@ -1,4 +1,4 @@
-RestX is a thin wrapper on the JBOSS Netty HTTP stack to provide a simple and easy way to create
+RestExpress is a thin wrapper on the JBOSS Netty HTTP stack to provide a simple and easy way to create
RESTful services in Java.
Born to be simple, only three things are required to wire up a service:
@@ -29,6 +29,13 @@ On successful creation, call response.setResponseCreated() to set the returning
Change History:
===================================================================================================
+Release 0.5
+* Renamed repository from RestX to RestExpress.
+* Repackaged everything from com.strategicgains.restx... to com.strategicgains.restexpress...
+* Changed DefaultHttpResponseWriter to output resonse headers correctly.
+* Updated javadoc on RouteBuilder to provide some documentation on route DSL.
+
+===================================================================================================
Release 0.4
* Fixed error in "Connection: keep-alive" processing during normal and error response writing.
* Can now create route mappings for OPTIONS and HEAD http methods.
View
2  build.properties
@@ -1,3 +1,3 @@
-version=0.4
+version=0.5
javac.source=1.6
javac.debug=true
View
4 build.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<project basedir="." default="build-all" name="RestX">
+<project basedir="." default="build-all" name="RestExpress">
<property environment="env"/>
<property file="build.properties"/>
@@ -88,7 +88,7 @@
<!-- ======================================================================
target: unit-test
====================================================================== -->
- <target name="unit-test" depends="_init, compile" description="--> Execute RestX unit tests">
+ <target name="unit-test" depends="_init, compile" description="--> Execute RestExpress unit tests">
<delete dir="${dir.test.results}"/>
<mkdir dir="${dir.test.results}"/>
<junit printsummary="true">
View
4 examples/kickstart/README
@@ -1,7 +1,7 @@
-This kickstart project illustrates how to create a simple RestX project. Complete with Ant build,
+This kickstart project illustrates how to create a simple RestExpress project. Complete with Ant build,
it contains a skeleton main() class, RestServer, and an empty, but functional service.
-Copy the lib/ directory of RestX, along with the dist/ directory of RestX into the lib directory
+Copy the lib/ directory of RestExpress, along with the dist/ directory of RestExpress into the lib directory
for the kickstart application. Ant should compile the project. Then:
1) Change the Routes.java file to match your URL requirements using the using the RouteBuilder DSL.
View
32 examples/kickstart/src/java/com/strategicgains/kickstart/RestServer.java
@@ -1,8 +1,8 @@
package com.strategicgains.kickstart;
-import static com.strategicgains.restx.RestX.JSON_FORMAT;
-import static com.strategicgains.restx.RestX.TXT_FORMAT;
-import static com.strategicgains.restx.RestX.XML_FORMAT;
+import static com.strategicgains.restexpress.RestExpress.JSON_FORMAT;
+import static com.strategicgains.restexpress.RestExpress.TXT_FORMAT;
+import static com.strategicgains.restexpress.RestExpress.XML_FORMAT;
import java.net.InetSocketAddress;
import java.util.Collections;
@@ -11,21 +11,21 @@
import org.jboss.netty.bootstrap.ServerBootstrap;
-import com.strategicgains.restx.domain.Link;
-import com.strategicgains.restx.pipeline.DefaultRequestHandler;
-import com.strategicgains.restx.pipeline.PipelineBuilder;
-import com.strategicgains.restx.route.RouteResolver;
-import com.strategicgains.restx.serialization.DefaultSerializationResolver;
-import com.strategicgains.restx.serialization.SerializationProcessor;
-import com.strategicgains.restx.serialization.json.DefaultJsonProcessor;
-import com.strategicgains.restx.serialization.text.DefaultTxtProcessor;
-import com.strategicgains.restx.serialization.xml.DefaultXmlProcessor;
-import com.strategicgains.restx.util.Bootstraps;
-import com.strategicgains.restx.util.Resolver;
+import com.strategicgains.restexpress.domain.Link;
+import com.strategicgains.restexpress.pipeline.DefaultRequestHandler;
+import com.strategicgains.restexpress.pipeline.PipelineBuilder;
+import com.strategicgains.restexpress.route.RouteResolver;
+import com.strategicgains.restexpress.serialization.DefaultSerializationResolver;
+import com.strategicgains.restexpress.serialization.SerializationProcessor;
+import com.strategicgains.restexpress.serialization.json.DefaultJsonProcessor;
+import com.strategicgains.restexpress.serialization.text.DefaultTxtProcessor;
+import com.strategicgains.restexpress.serialization.xml.DefaultXmlProcessor;
+import com.strategicgains.restexpress.util.Bootstraps;
+import com.strategicgains.restexpress.util.Resolver;
import com.thoughtworks.xstream.XStream;
/**
- * The main entry-point into RestX for the example services.
+ * The main entry-point into RestExpress for the example services.
*
* @author toddf
* @since Aug 31, 2009
@@ -62,7 +62,7 @@ public static void main(String[] args)
bootstrap.setPipelineFactory(pf);
// Bind and start to accept incoming connections.
- System.out.println("Starting RestX Example Server on port " + port);
+ System.out.println("Starting KickStart Example Server on port " + port);
bootstrap.bind(new InetSocketAddress(port));
}
View
2  examples/kickstart/src/java/com/strategicgains/kickstart/Routes.java
@@ -3,7 +3,7 @@
import org.jboss.netty.handler.codec.http.HttpMethod;
import com.strategicgains.kickstart.service.KickStartService;
-import com.strategicgains.restx.route.RouteMapping;
+import com.strategicgains.restexpress.route.RouteMapping;
/**
* @author toddf
View
4 examples/kickstart/src/java/com/strategicgains/kickstart/service/KickStartService.java
@@ -1,7 +1,7 @@
package com.strategicgains.kickstart.service;
-import com.strategicgains.restx.Request;
-import com.strategicgains.restx.Response;
+import com.strategicgains.restexpress.Request;
+import com.strategicgains.restexpress.Response;
/**
* @author toddf
View
14 ...ava/com/strategicgains/restx/Request.java → ...m/strategicgains/restexpress/Request.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package com.strategicgains.restx;
+package com.strategicgains.restexpress;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
@@ -28,11 +28,11 @@
import org.jboss.netty.handler.codec.http.HttpMethod;
import org.jboss.netty.handler.codec.http.HttpRequest;
-import com.strategicgains.restx.exception.BadRequestException;
-import com.strategicgains.restx.route.Route;
-import com.strategicgains.restx.route.RouteResolver;
-import com.strategicgains.restx.serialization.SerializationProcessor;
-import com.strategicgains.restx.util.Resolver;
+import com.strategicgains.restexpress.exception.BadRequestException;
+import com.strategicgains.restexpress.route.Route;
+import com.strategicgains.restexpress.route.RouteResolver;
+import com.strategicgains.restexpress.serialization.SerializationProcessor;
+import com.strategicgains.restexpress.util.Resolver;
/**
* @author toddf
@@ -270,7 +270,7 @@ private String getUri(HttpRequest request)
{
try
{
- return URLDecoder.decode(request.getUri(), RestX.ENCODING);
+ return URLDecoder.decode(request.getUri(), RestExpress.ENCODING);
}
catch (UnsupportedEncodingException e)
{
View
2  ...va/com/strategicgains/restx/Response.java → .../strategicgains/restexpress/Response.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.strategicgains.restx;
+package com.strategicgains.restexpress;
import static org.jboss.netty.handler.codec.http.HttpResponseStatus.OK;
View
6 src/java/com/strategicgains/restx/RestX.java → ...rategicgains/restexpress/RestExpress.java
@@ -14,13 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.strategicgains.restx;
+package com.strategicgains.restexpress;
/**
* @author toddf
*
*/
-public class RestX
+public class RestExpress
{
public static final String JSON_FORMAT = "json";
public static final String TXT_FORMAT = "txt";
@@ -28,7 +28,7 @@
public static final String ENCODING = "UTF-8";
- private RestX()
+ private RestExpress()
{
// prevents instantiation.
}
View
2  ...com/strategicgains/restx/domain/Link.java → ...rategicgains/restexpress/domain/Link.java
@@ -1,7 +1,7 @@
/*
* Copyright 2010, Pearson eCollege
*/
-package com.strategicgains.restx.domain;
+package com.strategicgains.restexpress.domain;
/**
* An immutable object representing an ID with an xlink property.
View
2  .../restx/exception/BadRequestException.java → ...xpress/exception/BadRequestException.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package com.strategicgains.restx.exception;
+package com.strategicgains.restexpress.exception;
import org.jboss.netty.handler.codec.http.HttpResponseStatus;
View
2  ...stx/exception/ConfigurationException.java → ...ess/exception/ConfigurationException.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package com.strategicgains.restx.exception;
+package com.strategicgains.restexpress.exception;
/**
View
4 ...ns/restx/exception/ConflictException.java → ...texpress/exception/ConflictException.java
@@ -13,12 +13,10 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-package com.strategicgains.restx.exception;
+package com.strategicgains.restexpress.exception;
import org.jboss.netty.handler.codec.http.HttpResponseStatus;
-import com.strategicgains.restx.exception.ServiceException;
-
/**
* @author toddf
* @since Jun 28, 2010
View
2  ...tx/exception/CouldNotDeleteException.java → ...ss/exception/CouldNotDeleteException.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package com.strategicgains.restx.exception;
+package com.strategicgains.restexpress.exception;
/**
View
2  ...estx/exception/CouldNotReadException.java → ...ress/exception/CouldNotReadException.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package com.strategicgains.restx.exception;
+package com.strategicgains.restexpress.exception;
/**
View
2  ...tx/exception/CouldNotUpdateException.java → ...ss/exception/CouldNotUpdateException.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package com.strategicgains.restx.exception;
+package com.strategicgains.restexpress.exception;
/**
View
4 ...s/restx/exception/ForbiddenException.java → ...express/exception/ForbiddenException.java
@@ -13,12 +13,10 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-package com.strategicgains.restx.exception;
+package com.strategicgains.restexpress.exception;
import org.jboss.netty.handler.codec.http.HttpResponseStatus;
-import com.strategicgains.restx.exception.ServiceException;
-
/**
* @author toddf
* @since Jun 28, 2010
View
4 ...ns/restx/exception/NotFoundException.java → ...texpress/exception/NotFoundException.java
@@ -13,12 +13,10 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-package com.strategicgains.restx.exception;
+package com.strategicgains.restexpress.exception;
import org.jboss.netty.handler.codec.http.HttpResponseStatus;
-import com.strategicgains.restx.exception.ServiceException;
-
/**
* @author toddf
* @since Jun 28, 2010
View
2  ...ins/restx/exception/ServiceException.java → ...stexpress/exception/ServiceException.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package com.strategicgains.restx.exception;
+package com.strategicgains.restexpress.exception;
import org.jboss.netty.handler.codec.http.HttpResponseStatus;
View
4 ...estx/exception/UnauthorizedException.java → ...ress/exception/UnauthorizedException.java
@@ -13,12 +13,10 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-package com.strategicgains.restx.exception;
+package com.strategicgains.restexpress.exception;
import org.jboss.netty.handler.codec.http.HttpResponseStatus;
-import com.strategicgains.restx.exception.ServiceException;
-
/**
* @author toddf
* @since Jun 28, 2010
View
2  .../restx/exception/ValidationException.java → ...xpress/exception/ValidationException.java
@@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-package com.strategicgains.restx.exception;
+package com.strategicgains.restexpress.exception;
import java.util.List;
View
22 ...restx/pipeline/DefaultRequestHandler.java → ...press/pipeline/DefaultRequestHandler.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.strategicgains.restx.pipeline;
+package com.strategicgains.restexpress.pipeline;
import static org.jboss.netty.handler.codec.http.HttpHeaders.Names.CONTENT_TYPE;
import static org.jboss.netty.handler.codec.http.HttpResponseStatus.INTERNAL_SERVER_ERROR;
@@ -29,16 +29,16 @@
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
import org.jboss.netty.handler.codec.http.HttpRequest;
-import com.strategicgains.restx.Request;
-import com.strategicgains.restx.Response;
-import com.strategicgains.restx.exception.ServiceException;
-import com.strategicgains.restx.response.DefaultHttpResponseWriter;
-import com.strategicgains.restx.response.ErrorHttpResponseWriter;
-import com.strategicgains.restx.response.HttpResponseWriter;
-import com.strategicgains.restx.route.Action;
-import com.strategicgains.restx.route.RouteResolver;
-import com.strategicgains.restx.serialization.SerializationProcessor;
-import com.strategicgains.restx.util.Resolver;
+import com.strategicgains.restexpress.Request;
+import com.strategicgains.restexpress.Response;
+import com.strategicgains.restexpress.exception.ServiceException;
+import com.strategicgains.restexpress.response.DefaultHttpResponseWriter;
+import com.strategicgains.restexpress.response.ErrorHttpResponseWriter;
+import com.strategicgains.restexpress.response.HttpResponseWriter;
+import com.strategicgains.restexpress.route.Action;
+import com.strategicgains.restexpress.route.RouteResolver;
+import com.strategicgains.restexpress.serialization.SerializationProcessor;
+import com.strategicgains.restexpress.util.Resolver;
/**
* @author toddf
View
2  ...gains/restx/pipeline/PipelineBuilder.java → ...restexpress/pipeline/PipelineBuilder.java
@@ -1,7 +1,7 @@
/*
* Copyright 2010, eCollege, Inc. All rights reserved.
*/
-package com.strategicgains.restx.pipeline;
+package com.strategicgains.restexpress.pipeline;
import org.jboss.netty.channel.ChannelHandler;
import org.jboss.netty.channel.ChannelPipeline;
View
6 ...icgains/restx/pipeline/Postprocessor.java → ...s/restexpress/pipeline/Postprocessor.java
@@ -1,10 +1,10 @@
/*
* Copyright 2010, eCollege, Inc. All rights reserved.
*/
-package com.strategicgains.restx.pipeline;
+package com.strategicgains.restexpress.pipeline;
-import com.strategicgains.restx.Request;
-import com.strategicgains.restx.Response;
+import com.strategicgains.restexpress.Request;
+import com.strategicgains.restexpress.Response;
/**
* Defines the interface for processing that happens after the service is called but
View
7 ...ns/restx/pipeline/PostprocessorAware.java → ...texpress/pipeline/PostprocessorAware.java
@@ -1,10 +1,11 @@
/*
* Copyright 2010, eCollege, Inc. All rights reserved.
*/
-package com.strategicgains.restx.pipeline;
+package com.strategicgains.restexpress.pipeline;
+
+import com.strategicgains.restexpress.Request;
+import com.strategicgains.restexpress.Response;
-import com.strategicgains.restx.Request;
-import com.strategicgains.restx.Response;
/**
* Defines the interface for request handlers that
View
5 ...gicgains/restx/pipeline/Preprocessor.java → ...ns/restexpress/pipeline/Preprocessor.java
@@ -1,9 +1,10 @@
/*
* Copyright 2010, eCollege, Inc. All rights reserved.
*/
-package com.strategicgains.restx.pipeline;
+package com.strategicgains.restexpress.pipeline;
+
+import com.strategicgains.restexpress.Request;
-import com.strategicgains.restx.Request;
/**
* @author toddf
View
4 ...ins/restx/pipeline/PreprocessorAware.java → ...stexpress/pipeline/PreprocessorAware.java
@@ -1,9 +1,9 @@
/*
* Copyright 2010, eCollege, Inc. All rights reserved.
*/
-package com.strategicgains.restx.pipeline;
+package com.strategicgains.restexpress.pipeline;
-import com.strategicgains.restx.Request;
+import com.strategicgains.restexpress.Request;
/**
* @author toddf
View
10 ...x/response/DefaultHttpResponseWriter.java → ...s/response/DefaultHttpResponseWriter.java
@@ -1,7 +1,7 @@
/*
* Copyright 2010, eCollege, Inc. All rights reserved.
*/
-package com.strategicgains.restx.response;
+package com.strategicgains.restexpress.response;
import static org.jboss.netty.handler.codec.http.HttpHeaders.Names.CONNECTION;
import static org.jboss.netty.handler.codec.http.HttpHeaders.Names.CONTENT_LENGTH;
@@ -15,9 +15,9 @@
import org.jboss.netty.handler.codec.http.DefaultHttpResponse;
import org.jboss.netty.handler.codec.http.HttpResponse;
-import com.strategicgains.restx.Request;
-import com.strategicgains.restx.Response;
-import com.strategicgains.restx.RestX;
+import com.strategicgains.restexpress.Request;
+import com.strategicgains.restexpress.Response;
+import com.strategicgains.restexpress.RestExpress;
/**
* @author toddf
@@ -37,7 +37,7 @@ public void write(ChannelHandlerContext ctx, Request request, Response response)
StringBuilder builder = new StringBuilder(response.getBody().toString());
builder.append("\r\n");
- httpResponse.setContent(ChannelBuffers.copiedBuffer(builder.toString(), Charset.forName(RestX.ENCODING)));
+ httpResponse.setContent(ChannelBuffers.copiedBuffer(builder.toString(), Charset.forName(RestExpress.ENCODING)));
}
if (request.isKeepAlive())
View
6 ...stx/response/ErrorHttpResponseWriter.java → ...ess/response/ErrorHttpResponseWriter.java
@@ -1,7 +1,7 @@
/*
* Copyright 2010, eCollege, Inc. All rights reserved.
*/
-package com.strategicgains.restx.response;
+package com.strategicgains.restexpress.response;
import static org.jboss.netty.handler.codec.http.HttpHeaders.Names.CONNECTION;
import static org.jboss.netty.handler.codec.http.HttpHeaders.Names.CONTENT_LENGTH;
@@ -16,8 +16,8 @@
import org.jboss.netty.handler.codec.http.DefaultHttpResponse;
import org.jboss.netty.handler.codec.http.HttpResponse;
-import com.strategicgains.restx.Request;
-import com.strategicgains.restx.Response;
+import com.strategicgains.restexpress.Request;
+import com.strategicgains.restexpress.Response;
/**
* @author toddf
View
6 ...ns/restx/response/HttpResponseWriter.java → ...texpress/response/HttpResponseWriter.java
@@ -1,12 +1,12 @@
/*
* Copyright 2010, eCollege, Inc. All rights reserved.
*/
-package com.strategicgains.restx.response;
+package com.strategicgains.restexpress.response;
import org.jboss.netty.channel.ChannelHandlerContext;
-import com.strategicgains.restx.Request;
-import com.strategicgains.restx.Response;
+import com.strategicgains.restexpress.Request;
+import com.strategicgains.restexpress.Response;
/**
* @author toddf
View
8 ...om/strategicgains/restx/route/Action.java → ...ategicgains/restexpress/route/Action.java
@@ -13,13 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-package com.strategicgains.restx.route;
+package com.strategicgains.restexpress.route;
import java.util.Map.Entry;
-import com.strategicgains.restx.Request;
-import com.strategicgains.restx.Response;
-import com.strategicgains.restx.url.UrlMatch;
+import com.strategicgains.restexpress.Request;
+import com.strategicgains.restexpress.Response;
+import com.strategicgains.restexpress.url.UrlMatch;
/**
* @author toddf
View
12 ...com/strategicgains/restx/route/Route.java → ...rategicgains/restexpress/route/Route.java
@@ -13,18 +13,18 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-package com.strategicgains.restx.route;
+package com.strategicgains.restexpress.route;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.jboss.netty.handler.codec.http.HttpMethod;
-import com.strategicgains.restx.Request;
-import com.strategicgains.restx.Response;
-import com.strategicgains.restx.exception.ServiceException;
-import com.strategicgains.restx.url.UrlMatch;
-import com.strategicgains.restx.url.UrlPattern;
+import com.strategicgains.restexpress.Request;
+import com.strategicgains.restexpress.Response;
+import com.strategicgains.restexpress.exception.ServiceException;
+import com.strategicgains.restexpress.url.UrlMatch;
+import com.strategicgains.restexpress.url.UrlPattern;
/**
* A Route is an immutable relationship between a URL pattern and a REST
View
12 ...ategicgains/restx/route/RouteBuilder.java → ...gains/restexpress/route/RouteBuilder.java
@@ -1,11 +1,11 @@
-package com.strategicgains.restx.route;
+package com.strategicgains.restexpress.route;
import static org.jboss.netty.handler.codec.http.HttpMethod.DELETE;
import static org.jboss.netty.handler.codec.http.HttpMethod.GET;
-import static org.jboss.netty.handler.codec.http.HttpMethod.POST;
-import static org.jboss.netty.handler.codec.http.HttpMethod.PUT;
import static org.jboss.netty.handler.codec.http.HttpMethod.HEAD;
import static org.jboss.netty.handler.codec.http.HttpMethod.OPTIONS;
+import static org.jboss.netty.handler.codec.http.HttpMethod.POST;
+import static org.jboss.netty.handler.codec.http.HttpMethod.PUT;
import java.lang.reflect.Method;
import java.util.ArrayList;
@@ -16,9 +16,9 @@
import org.jboss.netty.handler.codec.http.HttpMethod;
-import com.strategicgains.restx.Request;
-import com.strategicgains.restx.Response;
-import com.strategicgains.restx.exception.ConfigurationException;
+import com.strategicgains.restexpress.Request;
+import com.strategicgains.restexpress.Response;
+import com.strategicgains.restexpress.exception.ConfigurationException;
/**
* Builds a route for a single URI. If a URI is given with no methods or actions, the builder
View
2  ...ategicgains/restx/route/RouteMapping.java → ...gains/restexpress/route/RouteMapping.java
@@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-package com.strategicgains.restx.route;
+package com.strategicgains.restexpress.route;
import java.util.ArrayList;
import java.util.Collections;
View
10 ...tegicgains/restx/route/RouteResolver.java → ...ains/restexpress/route/RouteResolver.java
@@ -13,14 +13,14 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-package com.strategicgains.restx.route;
+package com.strategicgains.restexpress.route;
import org.jboss.netty.handler.codec.http.HttpMethod;
-import com.strategicgains.restx.Request;
-import com.strategicgains.restx.exception.BadRequestException;
-import com.strategicgains.restx.url.UrlMatch;
-import com.strategicgains.restx.util.Resolver;
+import com.strategicgains.restexpress.Request;
+import com.strategicgains.restexpress.exception.BadRequestException;
+import com.strategicgains.restexpress.url.UrlMatch;
+import com.strategicgains.restexpress.util.Resolver;
/**
* @author toddf
View
18 ...ization/DefaultSerializationResolver.java → ...ization/DefaultSerializationResolver.java
@@ -15,21 +15,21 @@
* limitations under the License.
*/
-package com.strategicgains.restx.serialization;
+package com.strategicgains.restexpress.serialization;
+
+import static com.strategicgains.restexpress.RestExpress.JSON_FORMAT;
+import static com.strategicgains.restexpress.RestExpress.XML_FORMAT;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import com.strategicgains.restx.Request;
-import com.strategicgains.restx.exception.BadRequestException;
-import com.strategicgains.restx.serialization.json.DefaultJsonProcessor;
-import com.strategicgains.restx.serialization.xml.DefaultXmlProcessor;
-import com.strategicgains.restx.util.Resolver;
-
-import static com.strategicgains.restx.RestX.JSON_FORMAT;
-import static com.strategicgains.restx.RestX.XML_FORMAT;
+import com.strategicgains.restexpress.Request;
+import com.strategicgains.restexpress.exception.BadRequestException;
+import com.strategicgains.restexpress.serialization.json.DefaultJsonProcessor;
+import com.strategicgains.restexpress.serialization.xml.DefaultXmlProcessor;
+import com.strategicgains.restexpress.util.Resolver;
/**
* @author toddf
View
2  ...rialization/DeserializationException.java → ...rialization/DeserializationException.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package com.strategicgains.restx.serialization;
+package com.strategicgains.restexpress.serialization;
/**
* @author toddf
View
2  ...ins/restx/serialization/Deserializer.java → ...stexpress/serialization/Deserializer.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package com.strategicgains.restx.serialization;
+package com.strategicgains.restexpress.serialization;
import org.jboss.netty.buffer.ChannelBuffer;
View
2  ...serialization/SerializationException.java → ...serialization/SerializationException.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package com.strategicgains.restx.serialization;
+package com.strategicgains.restexpress.serialization;
/**
* @author toddf
View
2  ...serialization/SerializationProcessor.java → ...serialization/SerializationProcessor.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package com.strategicgains.restx.serialization;
+package com.strategicgains.restexpress.serialization;
/**
* @author toddf
View
2  ...gains/restx/serialization/Serializer.java → ...restexpress/serialization/Serializer.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package com.strategicgains.restx.serialization;
+package com.strategicgains.restexpress.serialization;
/**
View
4 ...ialization/json/DefaultJsonProcessor.java → ...ialization/json/DefaultJsonProcessor.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package com.strategicgains.restx.serialization.json;
+package com.strategicgains.restexpress.serialization.json;
import java.io.InputStreamReader;
import java.util.Date;
@@ -25,7 +25,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
-import com.strategicgains.restx.serialization.SerializationProcessor;
+import com.strategicgains.restexpress.serialization.SerializationProcessor;
import com.strategicgains.util.date.DateAdapterConstants;
/**
View
2  ...erialization/json/GsonDateSerializer.java → ...erialization/json/GsonDateSerializer.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package com.strategicgains.restx.serialization.json;
+package com.strategicgains.restexpress.serialization.json;
import java.lang.reflect.Type;
import java.text.ParseException;
View
2  ...tx/serialization/json/GsonSerializer.java → ...ss/serialization/json/GsonSerializer.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package com.strategicgains.restx.serialization.json;
+package com.strategicgains.restexpress.serialization.json;
import com.google.gson.InstanceCreator;
import com.google.gson.JsonDeserializer;
View
2  ...ization/json/GsonTimestampSerializer.java → ...ization/json/GsonTimestampSerializer.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package com.strategicgains.restx.serialization.json;
+package com.strategicgains.restexpress.serialization.json;
import com.strategicgains.util.date.TimestampAdapter;
View
4 ...rialization/text/DefaultTxtProcessor.java → ...rialization/text/DefaultTxtProcessor.java
@@ -15,11 +15,11 @@
* limitations under the License.
*/
-package com.strategicgains.restx.serialization.text;
+package com.strategicgains.restexpress.serialization.text;
import org.jboss.netty.buffer.ChannelBuffer;
-import com.strategicgains.restx.serialization.SerializationProcessor;
+import com.strategicgains.restexpress.serialization.SerializationProcessor;
/**
* This SerializationProcessor implementation performs serialize() only so it's applicable
View
4 ...erialization/xml/DefaultXmlProcessor.java → ...erialization/xml/DefaultXmlProcessor.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package com.strategicgains.restx.serialization.xml;
+package com.strategicgains.restexpress.serialization.xml;
import java.util.HashMap;
import java.util.Map;
@@ -23,7 +23,7 @@
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBufferInputStream;
-import com.strategicgains.restx.serialization.SerializationProcessor;
+import com.strategicgains.restexpress.serialization.SerializationProcessor;
import com.thoughtworks.xstream.XStream;
/**
View
4 ...om/strategicgains/restx/url/UrlMatch.java → ...ategicgains/restexpress/url/UrlMatch.java
@@ -13,13 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-package com.strategicgains.restx.url;
+package com.strategicgains.restexpress.url;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
-import java.util.Set;
import java.util.Map.Entry;
+import java.util.Set;
/**
* Contains the results of a UrlPattern.match() call, reflecting the match outcome
View
2  .../strategicgains/restx/url/UrlPattern.java → ...egicgains/restexpress/url/UrlPattern.java
@@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-package com.strategicgains.restx.url;
+package com.strategicgains.restexpress.url;
import java.util.ArrayList;
import java.util.HashMap;
View
2  ...strategicgains/restx/util/Bootstraps.java → ...gicgains/restexpress/util/Bootstraps.java
@@ -1,4 +1,4 @@
-package com.strategicgains.restx.util;
+package com.strategicgains.restexpress.util;
import java.util.concurrent.Executors;
View
2  ...rategicgains/restx/util/Identifiable.java → ...cgains/restexpress/util/Identifiable.java
@@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-package com.strategicgains.restx.util;
+package com.strategicgains.restexpress.util;
/**
* @author toddf
View
6 .../strategicgains/restx/util/LinkUtils.java → ...egicgains/restexpress/util/LinkUtils.java
@@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-package com.strategicgains.restx.util;
+package com.strategicgains.restexpress.util;
import java.util.ArrayList;
import java.util.Collection;
@@ -21,8 +21,8 @@
import java.util.List;
import java.util.Map;
-import com.strategicgains.restx.domain.Link;
-import com.strategicgains.restx.exception.ServiceException;
+import com.strategicgains.restexpress.domain.Link;
+import com.strategicgains.restexpress.exception.ServiceException;
/**
* Non-instantiable class with foreign methods to create and manipulate Link instances.
View
2  ...egicgains/restx/util/MapStringFormat.java → ...ins/restexpress/util/MapStringFormat.java
@@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-package com.strategicgains.restx.util;
+package com.strategicgains.restexpress.util;
import java.util.Map;
View
5 ...m/strategicgains/restx/util/Resolver.java → ...tegicgains/restexpress/util/Resolver.java
@@ -15,9 +15,10 @@
* limitations under the License.
*/
-package com.strategicgains.restx.util;
+package com.strategicgains.restexpress.util;
+
+import com.strategicgains.restexpress.Request;
-import com.strategicgains.restx.Request;
/**
* A Resolver is responsible for determining which object is appropriate for a given request.
View
2  ...trategicgains/restx/util/Validatable.java → ...icgains/restexpress/util/Validatable.java
@@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-package com.strategicgains.restx.util;
+package com.strategicgains.restexpress.util;
/**
* @author toddf
View
6 ...icgains/restx/route/RouteMappingTest.java → ...s/restexpress/route/RouteMappingTest.java
@@ -1,4 +1,4 @@
-package com.strategicgains.restx.route;
+package com.strategicgains.restexpress.route;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -12,8 +12,8 @@
import org.junit.BeforeClass;
import org.junit.Test;
-import com.strategicgains.restx.Request;
-import com.strategicgains.restx.Response;
+import com.strategicgains.restexpress.Request;
+import com.strategicgains.restexpress.Response;
/**
* @author toddf
View
2  ...ategicgains/restx/url/UrlPatternTest.java → ...gains/restexpress/url/UrlPatternTest.java
@@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-package com.strategicgains.restx.url;
+package com.strategicgains.restexpress.url;
import static org.junit.Assert.*;
Please sign in to comment.
Something went wrong with that request. Please try again.