Repository: incubator-wave Updated Branches: refs/heads/fix/dependendices-2016 [created] 61c1b21c7
remove cc.kune dependency and replace with an initial default servlet. Project: http://git-wip-us.apache.org/repos/asf/incubator-wave/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-wave/commit/61c1b21c Tree: http://git-wip-us.apache.org/repos/asf/incubator-wave/tree/61c1b21c Diff: http://git-wip-us.apache.org/repos/asf/incubator-wave/diff/61c1b21c Branch: refs/heads/fix/dependendices-2016 Commit: 61c1b21c71140ab5f3f885a452b56002d8cf6ebf Parents: 835cc9e Author: wisebaldone <[email protected]> Authored: Fri Nov 18 20:46:41 2016 +1000 Committer: wisebaldone <[email protected]> Committed: Fri Nov 18 20:46:41 2016 +1000 ---------------------------------------------------------------------- gradle/wrapper/gradle-wrapper.properties | 1 - wave/build.gradle | 45 +++++---------- .../box/server/rpc/InitialsAvatarsServlet.java | 57 +++++++++++++++++++ .../org/waveprotocol/box/server/ServerMain.java | 2 +- .../box/server/rpc/InitialsAvatarDefault.jpg | Bin 0 -> 666 bytes 5 files changed, 71 insertions(+), 34 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/61c1b21c/gradle/wrapper/gradle-wrapper.properties ---------------------------------------------------------------------- diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 08ca730..7d05de3 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,4 +1,3 @@ -#Sun Feb 21 14:40:07 AEST 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/61c1b21c/wave/build.gradle ---------------------------------------------------------------------- diff --git a/wave/build.gradle b/wave/build.gradle index 6dc56da..ed34626 100644 --- a/wave/build.gradle +++ b/wave/build.gradle @@ -53,16 +53,6 @@ configurations { gwt } -// -// Workaround for validation API conflicts (GWT has not updated the dependency) -// https://groups.google.com/forum/#!topic/google-web-toolkit/KtdRAWNotXE -// -configurations.gwt { - resolutionStrategy { - force 'javax.validation:validation-api:1.0.0.GA' - } -} - //============================================================================= // Source's //============================================================================= @@ -110,28 +100,21 @@ repositories { url 'https://oauth.googlecode.com/svn/code/maven/' } maven { - url 'https://oss.sonatype.org/content/repositories/google-snapshots/' - } - maven { url 'https://oss.sonatype.org/service/local/repositories/snapshots/content/' } } - +configurations.gwt { + resolutionStrategy { + failOnVersionConflict() + } +} dependencies { - gwt( - [group: "javax.validation", name: "validation-api", version: "1.1.0.Final"], // [?, ?] - [group: "javax.validation", name: "validation-api", version: "1.1.0.Final", classifier: "sources"], // [?, ?] - [group: "com.google.gwt", name: "gwt-dev", version: "2.8.0"], // [?, ?] - [group: "com.google.gwt", name: "gwt-user", version: "2.8.0"], // [?, ?] - [group: "com.google.gwt", name: "gwt-codeserver", version: "2.8.0"], // [?, ?] - ) compile ( [group: "com.google.gwt", name: "gwt-dev", version: "2.8.0"], // [?, ?] [group: "com.google.gwt", name: "gwt-user", version: "2.8.0"], // [?, ?] [group: "com.google.gwt", name: "gwt-codeserver", version: "2.8.0"], // [?, ?] - [group: "aopalliance", name: "aopalliance", version: "1.0"], // [?, ?] - [group: "cc.kune", name: "gwt-initials-avatars-shared", version: "1.0-SNAPSHOT"], // [?, ?] - [group: "cc.kune", name: "gwt-initials-avatars-server", version: "1.0-SNAPSHOT"], // [?, ?] + //[group: "cc.kune", name: "gwt-initials-avatars-shared", version: "1.0-SNAPSHOT"], // [?, ?] + //[group: "cc.kune", name: "gwt-initials-avatars-server", version: "1.0-SNAPSHOT"], // [?, ?] [group: "commons-fileupload", name: "commons-fileupload", version: "1.2.2"], // [?, ?] [group: "commons-cli", name: "commons-cli", version: "1.2"], // [?, ?] [group: "commons-codec", name: "commons-codec", version: "1.4"], // [?, ?] @@ -316,6 +299,8 @@ task generateGXP { //============================================================================= task compileGwt { description = 'Compiles the GWT sources for production' + FileTree inputFiles = fileTree(dir: 'generated/src/main/java', include: '**/*.java') + inputs.property "files", inputFiles doLast { javaexec { main = "com.google.gwt.dev.Compiler" @@ -323,8 +308,7 @@ task compileGwt { [ sourceSets.main.java.srcDirs, sourceSets.main.compileClasspath, - sourceSets.main.resources.srcDirs, - configurations.gwt + sourceSets.main.resources.srcDirs ] } jvmArgs = [ @@ -353,8 +337,7 @@ task compileGwtDemo { [ sourceSets.main.java.srcDirs, sourceSets.main.compileClasspath, - sourceSets.main.resources.srcDirs, - configurations.gwt + sourceSets.main.resources.srcDirs ] } args = [ @@ -375,8 +358,7 @@ task compileGwtDev { [ sourceSets.main.java.srcDirs, sourceSets.main.compileClasspath, - sourceSets.main.resources.srcDirs, - configurations.gwt + sourceSets.main.resources.srcDirs ] } args = [ @@ -414,8 +396,7 @@ task gwtDev { [ sourceSets.main.java.srcDirs, sourceSets.main.compileClasspath, - sourceSets.main.resources.srcDirs, - configurations.gwt, + sourceSets.main.resources.srcDirs ] } args = [ http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/61c1b21c/wave/src/main/java/org/apache/wave/box/server/rpc/InitialsAvatarsServlet.java ---------------------------------------------------------------------- diff --git a/wave/src/main/java/org/apache/wave/box/server/rpc/InitialsAvatarsServlet.java b/wave/src/main/java/org/apache/wave/box/server/rpc/InitialsAvatarsServlet.java new file mode 100644 index 0000000..98a482b --- /dev/null +++ b/wave/src/main/java/org/apache/wave/box/server/rpc/InitialsAvatarsServlet.java @@ -0,0 +1,57 @@ +/** + * 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.wave.box.server.rpc; + +import com.google.common.annotations.VisibleForTesting; +import com.google.inject.Inject; +import com.google.common.io.Resources; +import org.waveprotocol.wave.util.logging.Log; + +import javax.imageio.ImageIO; +import javax.inject.Singleton; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.awt.image.BufferedImage; +import java.io.IOException; + +/** + * A servlet for fetching the users Initials Avatar. + */ +@Singleton +public final class InitialsAvatarsServlet extends HttpServlet { + private static final Log LOG = Log.get(InitialsAvatarsServlet.class); + private BufferedImage DEFAULT; + + @Inject + public InitialsAvatarsServlet() throws IOException { + DEFAULT = ImageIO.read(Resources.getResource("org/apache/wave/box/server/rpc/InitialsAvatarDefault.jpg")); + } + + /** + * Create an http response to the fetch query. Main entrypoint for this class. + */ + @Override + @VisibleForTesting + protected void doGet(HttpServletRequest req, HttpServletResponse response) throws IOException { + response.setContentType("image/jpg"); + ImageIO.write(DEFAULT, "JPG", response.getOutputStream()); + } +} http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/61c1b21c/wave/src/main/java/org/waveprotocol/box/server/ServerMain.java ---------------------------------------------------------------------- diff --git a/wave/src/main/java/org/waveprotocol/box/server/ServerMain.java b/wave/src/main/java/org/waveprotocol/box/server/ServerMain.java index 727ad44..ce5bb5e 100644 --- a/wave/src/main/java/org/waveprotocol/box/server/ServerMain.java +++ b/wave/src/main/java/org/waveprotocol/box/server/ServerMain.java @@ -19,13 +19,13 @@ package org.waveprotocol.box.server; -import cc.kune.initials.InitialsAvatarsServlet; import com.google.gwt.logging.server.RemoteLoggingServiceImpl; import com.google.inject.*; import com.google.inject.name.Names; import com.typesafe.config.Config; import com.typesafe.config.ConfigFactory; import org.apache.commons.configuration.ConfigurationException; +import org.apache.wave.box.server.rpc.InitialsAvatarsServlet; import org.waveprotocol.box.common.comms.WaveClientRpc.ProtocolWaveClientRpc; import org.waveprotocol.box.server.authentication.AccountStoreHolder; import org.waveprotocol.box.server.authentication.SessionManager; http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/61c1b21c/wave/src/main/resources/org/apache/wave/box/server/rpc/InitialsAvatarDefault.jpg ---------------------------------------------------------------------- diff --git a/wave/src/main/resources/org/apache/wave/box/server/rpc/InitialsAvatarDefault.jpg b/wave/src/main/resources/org/apache/wave/box/server/rpc/InitialsAvatarDefault.jpg new file mode 100644 index 0000000..d0266df Binary files /dev/null and b/wave/src/main/resources/org/apache/wave/box/server/rpc/InitialsAvatarDefault.jpg differ
