Repository: aries-jax-rs-whiteboard Updated Branches: refs/heads/master 5629d40f0 -> 10b51ef88
Restore DefaultWeb This reverts commit f8f6baa1535707fbd0bb895659378194d9e94525. Project: http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/repo Commit: http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/commit/aa6eaa0e Tree: http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/tree/aa6eaa0e Diff: http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/diff/aa6eaa0e Branch: refs/heads/master Commit: aa6eaa0e58dd9bacfa9277b388ba6f09673e65f5 Parents: 5629d40 Author: Carlos Sierra <[email protected]> Authored: Fri Oct 6 11:12:27 2017 +0200 Committer: Carlos Sierra <[email protected]> Committed: Fri Oct 6 11:59:07 2017 +0200 ---------------------------------------------------------------------- .../jax/rs/whiteboard/internal/DefaultWeb.java | 105 +++++++++++++++++++ 1 file changed, 105 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/aries-jax-rs-whiteboard/blob/aa6eaa0e/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/DefaultWeb.java ---------------------------------------------------------------------- diff --git a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/DefaultWeb.java b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/DefaultWeb.java new file mode 100644 index 0000000..711ee90 --- /dev/null +++ b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/DefaultWeb.java @@ -0,0 +1,105 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.aries.jax.rs.whiteboard.internal; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.CacheControl; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.ResponseBuilder; + +@Path("/") +public class DefaultWeb { + + @GET + @Produces(MediaType.TEXT_HTML) + public Response home(){ + CacheControl cc = new CacheControl(); + cc.setMaxAge(86400); + cc.setPrivate(true); + + ResponseBuilder builder = Response.ok( + getClass().getResourceAsStream("/static/index.html")); + builder.cacheControl(cc); + + return builder.build(); + } + + @GET + @Path("/css") + @Produces("text/css") + public Response css() { + CacheControl cc = new CacheControl(); + cc.setMaxAge(86400); + cc.setPrivate(true); + + ResponseBuilder builder = Response.ok( + getClass().getResourceAsStream("/static/style.css")); + builder.cacheControl(cc); + + return builder.build(); + } + + @GET + @Path("/github") + @Produces("text/css") + public Response github() { + CacheControl cc = new CacheControl(); + cc.setMaxAge(86400); + cc.setPrivate(true); + + ResponseBuilder builder = Response.ok( + getClass().getResourceAsStream("/static/highlight/styles/github.css")); + builder.cacheControl(cc); + + return builder.build(); + } + + @GET + @Path("/highlight") + @Produces("text/javascript") + public Response highlight() { + CacheControl cc = new CacheControl(); + cc.setMaxAge(86400); + cc.setPrivate(true); + + ResponseBuilder builder = Response.ok( + getClass().getResourceAsStream("/static/highlight/highlight.pack.js")); + builder.cacheControl(cc); + + return builder.build(); + } + + @GET + @Path("/logo") + @Produces("image/gif") + public Response logo() { + CacheControl cc = new CacheControl(); + cc.setMaxAge(86400); + cc.setPrivate(true); + + ResponseBuilder builder = Response.ok( + getClass().getResourceAsStream("/static/Arieslogo_Horizontal.gif")); + builder.cacheControl(cc); + + return builder.build(); + } + +} \ No newline at end of file
