Created
April 18, 2014 07:44
-
-
Save SannyStark/11029941 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> | |
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false"> | |
<output url="file://$MODULE_DIR$/target/classes" /> | |
<output-test url="file://$MODULE_DIR$/target/test-classes" /> | |
<content url="file://$MODULE_DIR$"> | |
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> | |
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> | |
<excludeFolder url="file://$MODULE_DIR$/target" /> | |
</content> | |
<orderEntry type="inheritedJdk" /> | |
<orderEntry type="sourceFolder" forTests="false" /> | |
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" /> | |
<orderEntry type="library" name="Maven: com.sun.jersey:jersey-server:1.17" level="project" /> | |
<orderEntry type="library" name="Maven: asm:asm:3.1" level="project" /> | |
<orderEntry type="library" name="Maven: com.sun.jersey:jersey-core:1.17" level="project" /> | |
<orderEntry type="library" name="Maven: com.sun.jersey.contribs:jersey-multipart:1.17" level="project" /> | |
<orderEntry type="library" name="Maven: org.jvnet:mimepull:1.6" level="project" /> | |
<orderEntry type="library" name="Maven: com.sun.jersey:jersey-grizzly2:1.17.1" level="project" /> | |
<orderEntry type="library" name="Maven: org.glassfish.grizzly:grizzly-http:2.2.16" level="project" /> | |
<orderEntry type="library" name="Maven: org.glassfish.grizzly:grizzly-framework:2.2.16" level="project" /> | |
<orderEntry type="library" name="Maven: org.glassfish.grizzly:grizzly-http-server:2.2.16" level="project" /> | |
<orderEntry type="library" name="Maven: org.glassfish.grizzly:grizzly-rcm:2.2.16" level="project" /> | |
<orderEntry type="library" name="Maven: commons-io:commons-io:1.3.2" level="project" /> | |
</component> | |
</module> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.sanny</groupId> | |
<artifactId>backgroundDB</artifactId> | |
<packaging>jar</packaging> | |
<version>1.0-SNAPSHOT</version> | |
<name>backgroundDB</name> | |
<url>http://maven.apache.org</url> | |
<properties> | |
<jdk.version>1.7</jdk.version> | |
</properties> | |
<dependencies> | |
<dependency> | |
<groupId>junit</groupId> | |
<artifactId>junit</artifactId> | |
<version>3.8.1</version> | |
<scope>test</scope> | |
</dependency> | |
<!--<dependency>--> | |
<!--<groupId>org.glassfish.grizzly</groupId>--> | |
<!--<artifactId>grizzly-http-server</artifactId>--> | |
<!--<version>2.3.11</version>--> | |
<!--</dependency>--> | |
<!--<dependency>--> | |
<!--<groupId>org.glassfish.grizzly</groupId>--> | |
<!--<artifactId>grizzly-framework</artifactId>--> | |
<!--<version>2.3.11</version>--> | |
<!--</dependency>--> | |
<!--Имлементация REST сервера--> | |
<dependency> | |
<groupId>com.sun.jersey</groupId> | |
<artifactId>jersey-server</artifactId> | |
<version>1.17</version> | |
</dependency> | |
<!--Плагин для upload файлов через REST--> | |
<dependency> | |
<groupId>com.sun.jersey.contribs</groupId> | |
<artifactId>jersey-multipart</artifactId> | |
<version>1.17</version> | |
</dependency> | |
<!-- Подключение jersey к grizzly--> | |
<dependency> | |
<groupId>com.sun.jersey</groupId> | |
<artifactId>jersey-grizzly2</artifactId> | |
<version>1.17.1</version> | |
</dependency> | |
<!-- Утилиты для IO--> | |
<dependency> | |
<groupId>org.apache.commons</groupId> | |
<artifactId>commons-io</artifactId> | |
<version>1.3.2</version> | |
</dependency> | |
</dependencies> | |
<build> | |
<plugins> | |
<!--Плагин для сборки в jar --> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<version>2.4</version> | |
<configuration> | |
<source>${jdk.version}</source> | |
<target>${jdk.version}</target> | |
</configuration> | |
</plugin> | |
<!--добавление в файл манифеста classpath зависимостей--> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-jar-plugin</artifactId> | |
<version>2.4</version> | |
<configuration> | |
<archive> | |
<manifest> | |
<addClasspath>true</addClasspath> | |
<mainClass>com.sanny.Server</mainClass> | |
<classpathPrefix>libs/</classpathPrefix> | |
</manifest> | |
</archive> | |
</configuration> | |
</plugin> | |
<!--Копирования зависимостей во время сборки--> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-dependency-plugin</artifactId> | |
<version>2.5.1</version> | |
<executions> | |
<execution> | |
<phase>package</phase> | |
<goals> | |
<goal>copy-dependencies</goal> | |
</goals> | |
<configuration> | |
<outputDirectory>${project.build.directory}/libs/</outputDirectory> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> | |
<!-- Для создания автозапускаемого файла--> | |
<!--mvn package appassembler:assemble--> | |
<plugin> | |
<groupId>org.codehaus.mojo</groupId> | |
<artifactId>appassembler-maven-plugin</artifactId> | |
<version>1.8</version> | |
<configuration> | |
<programs> | |
<program> | |
<mainClass>com.sanny.Server</mainClass> | |
<id>server-start</id> | |
</program> | |
</programs> | |
</configuration> | |
</plugin> | |
</plugins> | |
</build> | |
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sanny.data; | |
import java.util.HashMap; | |
import java.util.concurrent.ConcurrentHashMap; | |
/** | |
* Created with IntelliJ IDEA. | |
* User: sanny | |
* Date: 12.04.14 | |
* Time: 13:01 | |
* To change this template use File | Settings | File Templates. | |
*/ | |
public class KeyValueStorage { | |
public static ConcurrentHashMap<String,StoreValue> keyValue=new ConcurrentHashMap<String, StoreValue>(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sanny.data; | |
import com.sanny.enums.DataType; | |
/** | |
* Created with IntelliJ IDEA. | |
* User: sanny | |
* Date: 12.04.14 | |
* Time: 18:35 | |
* To change this template use File | Settings | File Templates. | |
*/ | |
public class StoreValue { | |
private byte[] data; | |
private DataType type; | |
public StoreValue(byte[] data, DataType type) { | |
this.data = data; | |
this.type = type; | |
} | |
public byte[] getData() { | |
return data; | |
} | |
public void setData(byte[] data) { | |
this.data = data; | |
} | |
public DataType getType() { | |
return type; | |
} | |
public void setType(DataType type) { | |
this.type = type; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sanny.enums; | |
/** | |
* Created with IntelliJ IDEA. | |
* User: sanny | |
* Date: 12.04.14 | |
* Time: 18:35 | |
* To change this template use File | Settings | File Templates. | |
*/ | |
public enum DataType { | |
PLAIN_TEXT,BYTES; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sanny.rest; | |
import com.sanny.data.KeyValueStorage; | |
import com.sanny.enums.DataType; | |
import com.sanny.data.StoreValue; | |
import com.sanny.utils.BufferStreamOutput; | |
import com.sun.jersey.core.header.FormDataContentDisposition; | |
import com.sun.jersey.multipart.FormDataParam; | |
import org.apache.commons.io.IOUtils; | |
import javax.ws.rs.*; | |
import javax.ws.rs.core.MediaType; | |
import javax.ws.rs.core.Response; | |
import javax.ws.rs.core.StreamingOutput; | |
import java.io.*; | |
/** | |
* Created with IntelliJ IDEA. | |
* User: sanny | |
* Date: 12.04.14 | |
* Time: 17:00 | |
* To change this template use File | Settings | File Templates. | |
*/ | |
@Path("/files") | |
public class FilesREST { | |
private void saveFile(String id,InputStream uploadedInputStream) throws IOException { | |
byte[] buf = IOUtils.toByteArray(uploadedInputStream); | |
StoreValue value = new StoreValue(buf, DataType.BYTES); | |
KeyValueStorage.keyValue.put(id,value); | |
} | |
@POST | |
@Path("set/{id}") | |
@Consumes(MediaType.MULTIPART_FORM_DATA) | |
public Response uploadFile( | |
@PathParam("id") String id, | |
@FormDataParam("file") InputStream fileInputStream, | |
@FormDataParam("file") FormDataContentDisposition contentDispositionHeader) { | |
try { | |
// save the file to the server | |
saveFile(id, fileInputStream); | |
return Response.status(Response.Status.OK).build(); | |
} catch (IOException e) { | |
return Response.status(Response.Status.CONFLICT).build(); | |
} | |
} | |
@GET | |
@Produces(MediaType.APPLICATION_OCTET_STREAM) | |
@Path("get/{id}") | |
public Response getFileById(@PathParam("id") String id) { | |
try { | |
// TODO : написать фабрику | |
StreamingOutput stream = new BufferStreamOutput(id); | |
return Response.ok(stream,MediaType.APPLICATION_OCTET_STREAM).build(); | |
}catch (Exception e){ | |
return Response.status(Response.Status.CONFLICT).build(); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sanny.rest; | |
import com.sanny.Server; | |
import com.sanny.data.KeyValueStorage; | |
import com.sanny.enums.DataType; | |
import com.sanny.data.StoreValue; | |
import com.sanny.utils.Utils; | |
import javax.ws.rs.*; | |
import javax.ws.rs.core.MediaType; | |
import javax.ws.rs.core.Response; | |
/** | |
* Created with IntelliJ IDEA. | |
* User: sanny | |
* Date: 12.04.14 | |
* Time: 16:53 | |
* To change this template use File | Settings | File Templates. | |
*/ | |
@Path("/json") | |
public class JsonREST { | |
@GET | |
@Produces("application/json") | |
@Path("get/{id}") | |
public String getById( @PathParam("id") String id) { | |
if(KeyValueStorage.keyValue.keySet().contains(id)){ | |
StoreValue storeValue = KeyValueStorage.keyValue.get(id); | |
if (storeValue.getType().equals(DataType.PLAIN_TEXT)){ | |
return "{ value : '" + new String(storeValue.getData()) + "'}"; | |
} else { | |
return "{ value : '" + Utils.buildStringUrl(Server.prop) + "/files/get/"+id+"'}"; | |
} | |
} else { | |
return "{ value : 'null'}"; | |
} | |
} | |
@GET | |
@Path("set/{id}/{value}") | |
public Response setByIdGET( @PathParam("id") String id, @PathParam("value") String value) { | |
try { | |
StoreValue storeValue = new StoreValue(value.getBytes(),DataType.PLAIN_TEXT); | |
KeyValueStorage.keyValue.put(id,storeValue); | |
return Response.status(Response.Status.OK).build(); | |
} catch (Throwable throwable){ | |
return Response.status(Response.Status.CONFLICT).build(); | |
} | |
} | |
@POST | |
@Path("set") | |
@Consumes(MediaType.APPLICATION_FORM_URLENCODED) | |
public Response setByIdPOST( @FormParam("id") String id, @FormParam("value") String value) { | |
try { | |
StoreValue storeValue = new StoreValue(value.getBytes(),DataType.PLAIN_TEXT); | |
KeyValueStorage.keyValue.put(id,storeValue); | |
return Response.status(Response.Status.OK).build(); | |
} catch (Throwable throwable){ | |
return Response.status(Response.Status.CONFLICT).build(); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sanny; | |
import com.sanny.utils.Constants; | |
import com.sanny.utils.Utils; | |
import com.sun.jersey.api.container.grizzly2.GrizzlyServerFactory; | |
import com.sun.jersey.api.core.PackagesResourceConfig; | |
import com.sun.jersey.api.core.ResourceConfig; | |
import org.glassfish.grizzly.http.server.HttpServer; | |
import java.io.IOException; | |
import java.net.InetAddress; | |
import java.net.NetworkInterface; | |
import java.net.URI; | |
import java.util.Enumeration; | |
import java.util.Properties; | |
/** | |
* Server | |
*/ | |
public class Server { | |
public static Properties prop = new Properties(); | |
public static void main(String[] args) throws IOException { | |
prop.load(Server.class.getClassLoader().getResourceAsStream("backgroundDB.properties")); | |
prop = Utils.validateProperties(prop); | |
ResourceConfig rc = new PackagesResourceConfig("com.sanny"); | |
HttpServer server = GrizzlyServerFactory.createHttpServer(Utils.buildStringUrl(prop), rc); | |
try { | |
server.start(); | |
System.out.println("Press any key to stop the server..."); | |
System.in.read(); | |
} catch (Exception ex) { | |
System.err.println(ex); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sanny.utils; | |
import com.sanny.data.KeyValueStorage; | |
import javax.ws.rs.WebApplicationException; | |
import javax.ws.rs.core.StreamingOutput; | |
import java.io.ByteArrayInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
/** | |
* Created with IntelliJ IDEA. | |
* User: sanny | |
* Date: 12.04.14 | |
* Time: 20:24 | |
* To change this template use File | Settings | File Templates. | |
*/ | |
public class BufferStreamOutput implements StreamingOutput { | |
private static final int BUFFER_SIZE = 1024; | |
private static final int END_OF_FILE = -1; | |
private String id; | |
public BufferStreamOutput(String id) { | |
this.id = id; | |
} | |
private void streamPipe(InputStream inputStream, OutputStream outputStream) throws IOException { | |
int n; | |
byte[] buffer = new byte[BUFFER_SIZE]; | |
while ((n = inputStream.read(buffer)) > END_OF_FILE) { | |
outputStream.write(buffer, 0, n); // Don't allow any extra bytes to creep in, final write | |
} | |
outputStream.close(); | |
} | |
private byte[] getBytes(){ | |
return KeyValueStorage.keyValue.get(id).getData(); | |
} | |
@Override | |
public void write(OutputStream outputStream) throws IOException, WebApplicationException { | |
// TODO : фабрика для inputStream | |
try(InputStream inputStream = new ByteArrayInputStream(getBytes())) { | |
streamPipe(inputStream, outputStream); | |
} catch (Exception e) { | |
outputStream.close(); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sanny.utils; | |
import java.util.Properties; | |
/** | |
* Created with IntelliJ IDEA. | |
* User: sanny | |
* Date: 15.04.14 | |
* Time: 20:49 | |
* To change this template use File | Settings | File Templates. | |
*/ | |
public class Constants { | |
public static String BACKGROUD_IP="backgroud.ip"; | |
public static String BACKGROUD_PORT="backgroud.port"; | |
public static String BACKGROUD_PORT_DEFAULT="8080"; | |
public static String BACKGROUD_IP_DEFAULT="localhost"; | |
public Properties validateProperties(Properties props){ | |
if(props == null){ | |
props = new Properties(); | |
} | |
if(props.get(BACKGROUD_IP) == null){ | |
props.put(BACKGROUD_IP,BACKGROUD_IP_DEFAULT); | |
} | |
if(props.get(BACKGROUD_PORT) == null){ | |
props.put(BACKGROUD_PORT,BACKGROUD_PORT_DEFAULT); | |
} | |
return props; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sanny.utils; | |
import java.util.Properties; | |
/** | |
* Created with IntelliJ IDEA. | |
* User: sanny | |
* Date: 15.04.14 | |
* Time: 20:57 | |
* To change this template use File | Settings | File Templates. | |
*/ | |
public class Utils { | |
public static Properties validateProperties(Properties props){ | |
if(props == null){ | |
props = new Properties(); | |
} | |
if(props.get(Constants.BACKGROUD_IP) == null){ | |
System.out.println(Constants.BACKGROUD_IP + " set Default"); | |
props.put(Constants.BACKGROUD_IP,Constants.BACKGROUD_IP_DEFAULT); | |
} | |
if(props.get(Constants.BACKGROUD_PORT) == null){ | |
System.out.println(Constants.BACKGROUD_PORT + " set Default"); | |
props.put(Constants.BACKGROUD_PORT,Constants.BACKGROUD_PORT_DEFAULT); | |
} | |
return props; | |
} | |
public static String buildStringUrl(Properties prop){ | |
return "http://"+prop.get(Constants.BACKGROUD_IP)+":"+prop.get(Constants.BACKGROUD_PORT); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backgroud.ip=localhost | |
backgroud.port=8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# ---------------------------------------------------------------------------- | |
# Copyright 2001-2006 The Apache Software Foundation. | |
# | |
# Licensed 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. | |
# ---------------------------------------------------------------------------- | |
# | |
# Copyright (c) 2001-2006 The Apache Software Foundation. All rights | |
# reserved. | |
# resolve links - $0 may be a softlink | |
PRG="$0" | |
while [ -h "$PRG" ]; do | |
ls=`ls -ld "$PRG"` | |
link=`expr "$ls" : '.*-> \(.*\)$'` | |
if expr "$link" : '/.*' > /dev/null; then | |
PRG="$link" | |
else | |
PRG=`dirname "$PRG"`/"$link" | |
fi | |
done | |
PRGDIR=`dirname "$PRG"` | |
BASEDIR=`cd "$PRGDIR/.." >/dev/null; pwd` | |
# Reset the REPO variable. If you need to influence this use the environment setup file. | |
REPO= | |
# OS specific support. $var _must_ be set to either true or false. | |
cygwin=false; | |
darwin=false; | |
case "`uname`" in | |
CYGWIN*) cygwin=true ;; | |
Darwin*) darwin=true | |
if [ -z "$JAVA_VERSION" ] ; then | |
JAVA_VERSION="CurrentJDK" | |
else | |
echo "Using Java version: $JAVA_VERSION" | |
fi | |
if [ -z "$JAVA_HOME" ]; then | |
if [ -x "/usr/libexec/java_home" ]; then | |
JAVA_HOME=`/usr/libexec/java_home` | |
else | |
JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home | |
fi | |
fi | |
;; | |
esac | |
if [ -z "$JAVA_HOME" ] ; then | |
if [ -r /etc/gentoo-release ] ; then | |
JAVA_HOME=`java-config --jre-home` | |
fi | |
fi | |
# For Cygwin, ensure paths are in UNIX format before anything is touched | |
if $cygwin ; then | |
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` | |
[ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"` | |
fi | |
# If a specific java binary isn't specified search for the standard 'java' binary | |
if [ -z "$JAVACMD" ] ; then | |
if [ -n "$JAVA_HOME" ] ; then | |
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then | |
# IBM's JDK on AIX uses strange locations for the executables | |
JAVACMD="$JAVA_HOME/jre/sh/java" | |
else | |
JAVACMD="$JAVA_HOME/bin/java" | |
fi | |
else | |
JAVACMD=`which java` | |
fi | |
fi | |
if [ ! -x "$JAVACMD" ] ; then | |
echo "Error: JAVA_HOME is not defined correctly." 1>&2 | |
echo " We cannot execute $JAVACMD" 1>&2 | |
exit 1 | |
fi | |
if [ -z "$REPO" ] | |
then | |
REPO="$BASEDIR"/repo | |
fi | |
CLASSPATH="$BASEDIR"/etc:"$REPO"/com/sun/jersey/jersey-server/1.17/jersey-server-1.17.jar:"$REPO"/asm/asm/3.1/asm-3.1.jar:"$REPO"/com/sun/jersey/jersey-core/1.17/jersey-core-1.17.jar:"$REPO"/com/sun/jersey/contribs/jersey-multipart/1.17/jersey-multipart-1.17.jar:"$REPO"/org/jvnet/mimepull/1.6/mimepull-1.6.jar:"$REPO"/com/sun/jersey/jersey-grizzly2/1.17.1/jersey-grizzly2-1.17.1.jar:"$REPO"/org/glassfish/grizzly/grizzly-http/2.2.16/grizzly-http-2.2.16.jar:"$REPO"/org/glassfish/grizzly/grizzly-framework/2.2.16/grizzly-framework-2.2.16.jar:"$REPO"/org/glassfish/grizzly/grizzly-http-server/2.2.16/grizzly-http-server-2.2.16.jar:"$REPO"/org/glassfish/grizzly/grizzly-rcm/2.2.16/grizzly-rcm-2.2.16.jar:"$REPO"/commons-io/commons-io/1.3.2/commons-io-1.3.2.jar:"$REPO"/com/sanny/backgroundDB/1.0-SNAPSHOT/backgroundDB-1.0-SNAPSHOT.jar | |
ENDORSED_DIR= | |
if [ -n "$ENDORSED_DIR" ] ; then | |
CLASSPATH=$BASEDIR/$ENDORSED_DIR/*:$CLASSPATH | |
fi | |
if [ -n "$CLASSPATH_PREFIX" ] ; then | |
CLASSPATH=$CLASSPATH_PREFIX:$CLASSPATH | |
fi | |
# For Cygwin, switch paths to Windows format before running java | |
if $cygwin; then | |
[ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --windows "$CLASSPATH"` | |
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` | |
[ -n "$HOME" ] && HOME=`cygpath --path --windows "$HOME"` | |
[ -n "$BASEDIR" ] && BASEDIR=`cygpath --path --windows "$BASEDIR"` | |
[ -n "$REPO" ] && REPO=`cygpath --path --windows "$REPO"` | |
fi | |
exec "$JAVACMD" $JAVA_OPTS \ | |
-classpath "$CLASSPATH" \ | |
-Dapp.name="server-start" \ | |
-Dapp.pid="$$" \ | |
-Dapp.repo="$REPO" \ | |
-Dapp.home="$BASEDIR" \ | |
-Dbasedir="$BASEDIR" \ | |
com.sanny.Server \ | |
"$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@REM ---------------------------------------------------------------------------- | |
@REM Copyright 2001-2006 The Apache Software Foundation. | |
@REM | |
@REM Licensed under the Apache License, Version 2.0 (the "License"); | |
@REM you may not use this file except in compliance with the License. | |
@REM You may obtain a copy of the License at | |
@REM | |
@REM http://www.apache.org/licenses/LICENSE-2.0 | |
@REM | |
@REM Unless required by applicable law or agreed to in writing, software | |
@REM distributed under the License is distributed on an "AS IS" BASIS, | |
@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
@REM See the License for the specific language governing permissions and | |
@REM limitations under the License. | |
@REM ---------------------------------------------------------------------------- | |
@REM | |
@REM Copyright (c) 2001-2006 The Apache Software Foundation. All rights | |
@REM reserved. | |
@echo off | |
set ERROR_CODE=0 | |
:init | |
@REM Decide how to startup depending on the version of windows | |
@REM -- Win98ME | |
if NOT "%OS%"=="Windows_NT" goto Win9xArg | |
@REM set local scope for the variables with windows NT shell | |
if "%OS%"=="Windows_NT" @setlocal | |
@REM -- 4NT shell | |
if "%eval[2+2]" == "4" goto 4NTArgs | |
@REM -- Regular WinNT shell | |
set CMD_LINE_ARGS=%* | |
goto WinNTGetScriptDir | |
@REM The 4NT Shell from jp software | |
:4NTArgs | |
set CMD_LINE_ARGS=%$ | |
goto WinNTGetScriptDir | |
:Win9xArg | |
@REM Slurp the command line arguments. This loop allows for an unlimited number | |
@REM of arguments (up to the command line limit, anyway). | |
set CMD_LINE_ARGS= | |
:Win9xApp | |
if %1a==a goto Win9xGetScriptDir | |
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1 | |
shift | |
goto Win9xApp | |
:Win9xGetScriptDir | |
set SAVEDIR=%CD% | |
%0\ | |
cd %0\..\.. | |
set BASEDIR=%CD% | |
cd %SAVEDIR% | |
set SAVE_DIR= | |
goto repoSetup | |
:WinNTGetScriptDir | |
set BASEDIR=%~dp0\.. | |
:repoSetup | |
set REPO= | |
if "%JAVACMD%"=="" set JAVACMD=java | |
if "%REPO%"=="" set REPO=%BASEDIR%\repo | |
set CLASSPATH="%BASEDIR%"\etc;"%REPO%"\com\sun\jersey\jersey-server\1.17\jersey-server-1.17.jar;"%REPO%"\asm\asm\3.1\asm-3.1.jar;"%REPO%"\com\sun\jersey\jersey-core\1.17\jersey-core-1.17.jar;"%REPO%"\com\sun\jersey\contribs\jersey-multipart\1.17\jersey-multipart-1.17.jar;"%REPO%"\org\jvnet\mimepull\1.6\mimepull-1.6.jar;"%REPO%"\com\sun\jersey\jersey-grizzly2\1.17.1\jersey-grizzly2-1.17.1.jar;"%REPO%"\org\glassfish\grizzly\grizzly-http\2.2.16\grizzly-http-2.2.16.jar;"%REPO%"\org\glassfish\grizzly\grizzly-framework\2.2.16\grizzly-framework-2.2.16.jar;"%REPO%"\org\glassfish\grizzly\grizzly-http-server\2.2.16\grizzly-http-server-2.2.16.jar;"%REPO%"\org\glassfish\grizzly\grizzly-rcm\2.2.16\grizzly-rcm-2.2.16.jar;"%REPO%"\commons-io\commons-io\1.3.2\commons-io-1.3.2.jar;"%REPO%"\com\sanny\backgroundDB\1.0-SNAPSHOT\backgroundDB-1.0-SNAPSHOT.jar | |
set ENDORSED_DIR= | |
if NOT "%ENDORSED_DIR%" == "" set CLASSPATH="%BASEDIR%"\%ENDORSED_DIR%\*;%CLASSPATH% | |
if NOT "%CLASSPATH_PREFIX%" == "" set CLASSPATH=%CLASSPATH_PREFIX%;%CLASSPATH% | |
@REM Reaching here means variables are defined and arguments have been captured | |
:endInit | |
%JAVACMD% %JAVA_OPTS% -classpath %CLASSPATH% -Dapp.name="server-start" -Dapp.repo="%REPO%" -Dapp.home="%BASEDIR%" -Dbasedir="%BASEDIR%" com.sanny.Server %CMD_LINE_ARGS% | |
if %ERRORLEVEL% NEQ 0 goto error | |
goto end | |
:error | |
if "%OS%"=="Windows_NT" @endlocal | |
set ERROR_CODE=%ERRORLEVEL% | |
:end | |
@REM set local scope for the variables with windows NT shell | |
if "%OS%"=="Windows_NT" goto endNT | |
@REM For old DOS remove the set variables from ENV - we assume they were not set | |
@REM before we started - at least we don't leave any baggage around | |
set CMD_LINE_ARGS= | |
goto postExec | |
:endNT | |
@REM If error code is set to 1 then the endlocal was done already in :error. | |
if %ERROR_CODE% EQU 0 @endlocal | |
:postExec | |
if "%FORCE_EXIT_ON_ERROR%" == "on" ( | |
if %ERROR_CODE% NEQ 0 exit %ERROR_CODE% | |
) | |
exit /B %ERROR_CODE% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PK �)48V}��� � META-INF/MANIFEST.MFm�� | |
�0 �@��M�CB�ԡ[U�]lq���b�y)I��t���V�1&q��� | |
�8��Գ6�̲�˒�c@�p��z#uS[qW%��'AkM�q� ]����pָyB��t�M��4a.w��lw��#i�s�dz��x�Չ3�^PK �)48E��B� � ) org/objectweb/asm/AnnotationVisitor.class��= | |
�@�����{c�֒��ʀ�`��t6���,<���UP$H����{��� | |
`�.� | |
�K�8�R~�l�E�Z%"��T1��t�֧��l�&BH�u"�2�-UH��~l��AX��~+��-�\������Я�J��EG����Q�� 3Lņ���ޅ��u�Q�]ϕ���-؆�>j�MP!} PK �)48m��� o ( org/objectweb/asm/AnnotationWriter.class�U�SW�m�� �(�6塈Ր���B�'��-!D���&AK��*Z��>M��/�tڙv֙v�i?����Gg��S���ݍ��Y����ܽ�w��s������ �qO��]۪a@à�����s��ц�hr��+�N$�5g��! ����j;S顆���x,{!>�͌6���F���xEw�#V�)Bj���C��JkBE9��Fwp9&>w�z�k�F�ӽ�<\�}�Ƌȴ$��l4�H%C�LBOpK��E���1g�ϸ�r^�~��μ���/� �D3�p:�����5̽A��i]�8쎘���'���J�3����� }��D2�m��H �t6-'����2^�D�(}��H+C�����!�����@<!Jπ e ��G����8%\2�!���ņ��,9��w���,=CVųm�L,��TilX���3ҪG��`��(��|4F�P��XUp�S��H� '�z��� | |
�Y�i��b�}Pa�+*M�D����FQG���D���Q�^K:�����`��n��QG���-�y^K��K!�>��ص�CI���;>j�KF���2jdl���2��p��-c���2����h��_F��2�h�Ѫ�I��)�����P 0�dX�P����Z�+h�Y���:lP��ȡ�[Q�`�v��@�����^J�6<����CRp����I����.0L��Y�0�����r �1N#�@/��e"H;hZ�a��U�e��p��e�Wxq��C� ����EZ���X����c����f���f��\���l =��VN=���n��ǻ��x*fp�S7�I�K��u�S����5O��6��D?XÞ�i\�gp�3�k9�����W�]��}?#�C9�f��� ��Qx��"w8�j��j��*�V��4��H�����K����r��)��fmRO�,��B��ỳ�yZ�;���D�˓�R��ۅ��D��P��b)��|��^bˡ�ƏQ;�1#u����b�����9��&Ea��)K����A*=Ԋ���/�U�UX�������s�f�S���kQN�eR9���f�0Tv.V�G*�t�S��T��J�"�E*]�J53�C�A�T�%����Ijf*��V�-P"��� jf*m��6�.P����/��k��M�M�����Ƨz"�K~pZ踡��T��p慃(3��t�X��,O�`���Gę^ ��L�ui�>���ׁ�F�����X^���ˑ�a5�A��cU�cx�v}��L�V'�ߠ�j����n�M�����z]�P���$�.�&�Q���>=hu^;:����o�r�&(4ߨ���R��/ | |
~�%��;i*]�!��U|�]t��t�L!E�H_��n�\�[�pI~�'�x����y w�ܿɓ���)�'�4TJ�N�kQ�̖�7�����Ѭ��8��B�N��]�7k��G� *>?�1�,�$�m�ݲK�ÆIYpI��e�%H~�K�%H,┵�m�."��إg/d/q�����cl��PK �)48۠(�� ! org/objectweb/asm/Attribute.class�RQSQ�.{�6C�jS2���2����i&SƘf\t�0gYcx���C� 6���C��s��Qv�ν�|�;�9��}�0�$��4p��oz��l�̆�5c�*��^���c=���OZ��e�X�}�$��]�?��u=� ����GIQ��/y�2s�lTxjyN����z����W �dӉ��-�r?i�~f�2�����)3g�~:�$��p�|̳�5}.��*b0�~A<����s��=QX5u�ur��3eK�����MS/�6˴��>kX�Y.劢��{�����R��s���h�\�� �7J�gF��8�/�]��O����|�-0(�[�Л��i�̓c'-��LZ�MҢ`�7ɏ�$nr�����q���帥�6NW�%�/dW�@�p}���6 | |
���N�p�� �����ᾀ�.1�� ��せ�C�ܔ�X���'n���J�H��?2P�d���� | |
z���������"���ePI����(��;����9������اf���7r�p�``�%���.��r�7g�`O{T^AT�}����д�A��)��A[��TDVe҉V1�X�W1�ʍ��5/�Q�(z��6:@�G�BD�v���i�"��iY�|���*��^��t�v���DyyY�H0"o���#I�)� �� $5��*?҈8IQ�.�kx�:I����*���<�N R$·���PK �)48K�;T 4 " |