diff --git a/apps/jetty/README-i2p.txt b/apps/jetty/README-i2p.txt new file mode 100644 index 0000000000000000000000000000000000000000..3aa81e1ec118388374427ea9bc2ab6edafda2447 --- /dev/null +++ b/apps/jetty/README-i2p.txt @@ -0,0 +1,3 @@ +jetty-distribution-xxx is only what we need out of jetty-distribution-xxx.zip. + +NOTICE and LICENSE files moved to ../../../licenses diff --git a/apps/jetty/build.xml b/apps/jetty/build.xml index 04f988b90d73b26e3a5d21ccfcc07562b251b29b..9a04e2deca42d240fdb2023154ad06b2d44bc142 100644 --- a/apps/jetty/build.xml +++ b/apps/jetty/build.xml @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <project basedir="." default="all" name="jetty"> - <property name="jetty.ver" value="6.1.26" /> - <property name="jetty.base" value="jetty-${jetty.ver}" /> - <property name="jetty.sha1" value="9485913f1a1945a849a90f1a34853d22350bc524" /> + <property name="jetty.ver" value="7.6.8.v20121106" /> + <property name="jetty.base" value="jetty-distribution-${jetty.ver}" /> + <property name="jetty.sha1" value="6fcdc3f532c5ab72843e12cbac3d7cb797cdb5b9" /> <property name="jetty.filename" value="${jetty.base}.zip" /> - <property name="jetty.url" value="http://dist.codehaus.org/jetty/${jetty.base}/${jetty.filename}" /> + <property name="jetty.url" value="http://download.eclipse.org/jetty/${jetty.ver}/dist/${jetty.filename}" /> <property name="verified.filename" value="verified.txt" /> <property name="javac.compilerargs" value="" /> <property name="tomcat.lib" value="apache-tomcat-deployer/lib" /> @@ -97,12 +97,29 @@ All of these are available in the Ubuntu packages libjetty-java and libjetty-extra-java --> <copy preservelastmodified="true" file="${jetty.base}/start.jar" tofile="jettylib/jetty-start.jar" /> - <copy file="${jetty.base}/lib/${jetty.base}.jar" tofile="jettylib/org.mortbay.jetty.jar" /> + <copy file="${jetty.base}/lib/jetty-server-${jetty.ver}.jar" tofile="jettylib/org.mortbay.jetty.jar" /> + <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-continuation-${jetty.ver}.jar" tofile="jettylib/jetty-continuation.jar" /> + <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-deploy-${jetty.ver}.jar" tofile="jettylib/jetty-deploy.jar" /> + <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-http-${jetty.ver}.jar" tofile="jettylib/jetty-http.jar" /> + <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-io-${jetty.ver}.jar" tofile="jettylib/jetty-io.jar" /> + <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-jmx-${jetty.ver}.jar" tofile="jettylib/org.mortbay.jmx.jar" /> + <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-rewrite-${jetty.ver}.jar" tofile="jettylib/jetty-rewrite-handler.jar" /> + <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-security-${jetty.ver}.jar" tofile="jettylib/jetty-security.jar" /> + <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-servlet-${jetty.ver}.jar" tofile="jettylib/jetty-servlet.jar" /> + <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-servlets-${jetty.ver}.jar" tofile="jettylib/jetty-servlets.jar" /> <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-util-${jetty.ver}.jar" tofile="jettylib/jetty-util.jar" /> - <copy preservelastmodified="true" file="${jetty.base}/lib/ext/jetty-java5-threadpool-${jetty.ver}.jar" tofile="jettylib/jetty-java5-threadpool.jar" /> - <copy preservelastmodified="true" file="${jetty.base}/lib/ext/jetty-rewrite-handler-${jetty.ver}.jar" tofile="jettylib/jetty-rewrite-handler.jar" /> - <copy preservelastmodified="true" file="${jetty.base}/lib/ext/jetty-sslengine-${jetty.ver}.jar" tofile="jettylib/jetty-sslengine.jar" /> - <copy preservelastmodified="true" file="${jetty.base}/lib/management/jetty-management-${jetty.ver}.jar" tofile="jettylib/org.mortbay.jmx.jar" /> + <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-webapp-${jetty.ver}.jar" tofile="jettylib/jetty-webapp.jar" /> + <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-xml-${jetty.ver}.jar" tofile="jettylib/jetty-xml.jar" /> + <jar destfile="jettylib/jetty-java5-threadpool.jar" > + <manifest> + <attribute name="Note" value="Intentionally empty" /> + </manifest> + </jar> + <jar destfile="jettylib/jetty-sslengine.jar" > + <manifest> + <attribute name="Note" value="Intentionally empty" /> + </manifest> + </jar> <delete file="jetty.tar" /> <!-- <delete dir="${jetty.base}" /> @@ -155,15 +172,16 @@ <target name="build" depends="jar" /> <target name="builddep" /> + <target name="compile" depends="builddep, ensureJettylib" > <mkdir dir="./build" /> <mkdir dir="./build/obj" /> <javac srcdir="./java/src" - debug="true" source="1.5" target="1.5" + debug="true" deprecation="on" source="1.5" target="1.5" destdir="./build/obj" includeAntRuntime="false" - classpath="../../core/java/build/i2p.jar:./jettylib/commons-logging.jar:./jettylib/javax.servlet.jar:./jettylib/org.mortbay.jetty.jar:./jettylib/jetty-util.jar" > + classpath="../../core/java/build/i2p.jar:./jettylib/commons-logging.jar:./jettylib/javax.servlet.jar:./jettylib/org.mortbay.jetty.jar:./jettylib/jetty-http.jar:./jettylib/jetty-io.jar:./jettylib/jetty-util.jar:./jettylib/jetty-xml.jar" > <compilerarg line="${javac.compilerargs}" /> </javac> </target> diff --git a/apps/jetty/java/src/net/i2p/jetty/I2PLogger.java b/apps/jetty/java/src/net/i2p/jetty/I2PLogger.java index 6329464c345053cff74570a59243ca48545b16d7..309d8819fbd12156e57f9211415ed7b16811d61b 100644 --- a/apps/jetty/java/src/net/i2p/jetty/I2PLogger.java +++ b/apps/jetty/java/src/net/i2p/jetty/I2PLogger.java @@ -17,13 +17,13 @@ package net.i2p.jetty; import net.i2p.I2PAppContext; import net.i2p.util.Log; -import org.mortbay.jetty.Server; -import org.mortbay.log.Logger; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.util.log.Logger; /** * Modified from Jetty 6.1.26 StdErrLog.java and Slf4jLog.java * - * Usage: org.mortbay.log.Log.setLog(new I2PLogger(ctx)); + * Usage: org.eclipse.log.Log.setLog(new I2PLogger(ctx)); * * @since Jetty 6 */ @@ -182,5 +182,80 @@ public class I2PLogger implements Logger return "I2PLogger"; } + /** + * @since Jetty 7 + */ + public void ignore(Throwable ignored) + { + warn("IGNORED", ignored); + } + + /** + * @since Jetty 7 + */ + public void debug(Throwable thrown) + { + debug("", thrown); + } + + /** + * @since Jetty 7 + */ + public void debug(String msg, Object... args) + { + Object a1 = args.length > 0 ? args[0] : null; + Object a2 = args.length > 1 ? args[1] : null; + debug(msg, a1, a2); + } + + /** + * @since Jetty 7 + */ + public void info(Throwable thrown) + { + info("", thrown); + } + + /** + * @since Jetty 7 + */ + public void info(String msg, Object... args) + { + Object a1 = args.length > 0 ? args[0] : null; + Object a2 = args.length > 1 ? args[1] : null; + info(msg, a1, a2); + } + + /** + * @since Jetty 7 + */ + public void info(String msg, Throwable th) + { + _log.info(msg,th); + } + + /** + * @since Jetty 7 + */ + public void warn(Throwable thrown) + { + warn("", thrown); + } + + /** + * @since Jetty 7 + */ + public void warn(String msg, Object... args) + { + Object a1 = args.length > 0 ? args[0] : null; + Object a2 = args.length > 1 ? args[1] : null; + warn(msg, a1, a2); + } + /** + * @since Jetty 7 + */ + public String getName() { + return "net.i2p.jetty.I2PLogger"; + } } diff --git a/apps/jetty/java/src/net/i2p/jetty/I2PRequestLog.java b/apps/jetty/java/src/net/i2p/jetty/I2PRequestLog.java index 6aa001146f75ed2d543166396870907775ffb702..77d9afa052d7e8e721ab6c771940935ab680a5e1 100644 --- a/apps/jetty/java/src/net/i2p/jetty/I2PRequestLog.java +++ b/apps/jetty/java/src/net/i2p/jetty/I2PRequestLog.java @@ -24,18 +24,18 @@ import java.util.TimeZone; import javax.servlet.http.Cookie; -import org.mortbay.component.AbstractLifeCycle; -import org.mortbay.jetty.HttpHeaders; -import org.mortbay.jetty.Request; -import org.mortbay.jetty.RequestLog; -import org.mortbay.jetty.Response; -import org.mortbay.jetty.servlet.PathMap; -import org.mortbay.log.Log; -import org.mortbay.util.DateCache; -import org.mortbay.util.RolloverFileOutputStream; -import org.mortbay.util.StringUtil; -import org.mortbay.util.TypeUtil; -import org.mortbay.util.Utf8StringBuffer; +import org.eclipse.jetty.http.HttpHeaders; +import org.eclipse.jetty.http.PathMap; +import org.eclipse.jetty.server.Request; +import org.eclipse.jetty.server.RequestLog; +import org.eclipse.jetty.server.Response; +import org.eclipse.jetty.util.DateCache; +import org.eclipse.jetty.util.RolloverFileOutputStream; +import org.eclipse.jetty.util.StringUtil; +import org.eclipse.jetty.util.TypeUtil; +import org.eclipse.jetty.util.Utf8StringBuilder; +import org.eclipse.jetty.util.component.AbstractLifeCycle; +import org.eclipse.jetty.util.log.Log; /** * This {@link RequestLog} implementation outputs logs in the pseudo-standard NCSA common log format. @@ -56,8 +56,6 @@ import org.mortbay.util.Utf8StringBuffer; * * So that we will work with system Jetty 6 packages, we just copy the whole thing * and modify log() as required. - * We leave the package as org.mortbay.http for compatibility with old - * jetty.xml files. * * @author Greg Wilkins * @author Nigel Canonizado @@ -259,13 +257,13 @@ public class I2PRequestLog extends AbstractLifeCycle implements RequestLog if (_fileOut == null) return; - Utf8StringBuffer u8buf; - StringBuffer buf; + Utf8StringBuilder u8buf; + StringBuilder buf; synchronized(_writer) { int size=_buffers.size(); - u8buf = size==0?new Utf8StringBuffer(160):(Utf8StringBuffer)_buffers.remove(size-1); - buf = u8buf.getStringBuffer(); + u8buf = size==0?new Utf8StringBuilder(160):(Utf8StringBuilder)_buffers.remove(size-1); + buf = u8buf.getStringBuilder(); } synchronized(buf) // for efficiency until we can use StringBuilder @@ -398,7 +396,7 @@ public class I2PRequestLog extends AbstractLifeCycle implements RequestLog if (_logLatency) { _writer.write(' '); - _writer.write(TypeUtil.toString(System.currentTimeMillis() - request.getTimeStamp())); + _writer.write(Long.toString(System.currentTimeMillis() - request.getTimeStamp())); } _writer.write(StringUtil.__LINE_SEPARATOR); diff --git a/apps/jetty/java/src/net/i2p/jetty/JettyStart.java b/apps/jetty/java/src/net/i2p/jetty/JettyStart.java index f5b3295b546deeff4525c7aceab865df990c72d6..af396876993398f385c1d82388ad0d0d9975ed59 100644 --- a/apps/jetty/java/src/net/i2p/jetty/JettyStart.java +++ b/apps/jetty/java/src/net/i2p/jetty/JettyStart.java @@ -19,15 +19,16 @@ package net.i2p.jetty; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Map; import java.util.Properties; import net.i2p.I2PAppContext; import net.i2p.app.*; import static net.i2p.app.ClientAppState.*; -import org.mortbay.component.LifeCycle; -import org.mortbay.resource.Resource; -import org.mortbay.xml.XmlConfiguration; +import org.eclipse.jetty.util.component.LifeCycle; +import org.eclipse.jetty.util.resource.Resource; +import org.eclipse.jetty.xml.XmlConfiguration; /** * Start Jetty where the args are one or more XML files. @@ -73,8 +74,11 @@ public class JettyStart implements ClientApp { XmlConfiguration configuration = new XmlConfiguration(Resource.newResource(args[i]).getURL()); if (last!=null) configuration.getIdMap().putAll(last.getIdMap()); - if (properties.size()>0) - configuration.setProperties(properties); + if (properties.size()>0) { + // to avoid compiler errror + Map foo = configuration.getProperties(); + foo.putAll(properties); + } Object o = configuration.configure(); if (o instanceof LifeCycle) _jettys.add((LifeCycle)o); diff --git a/apps/jetty/jetty-6.1.26/README-i2p.txt b/apps/jetty/jetty-6.1.26/README-i2p.txt deleted file mode 100644 index efbecbcdc7a8b90db10fd45cbc8727525f48b5ba..0000000000000000000000000000000000000000 --- a/apps/jetty/jetty-6.1.26/README-i2p.txt +++ /dev/null @@ -1,3 +0,0 @@ -This is only what we need out of the 25 MB Jetty-6.1.26.zip. - -NOTICE and LICENSE files moved to ../../../licenses diff --git a/apps/jetty/jetty-6.1.26/lib/ext/jetty-java5-threadpool-6.1.26.jar b/apps/jetty/jetty-6.1.26/lib/ext/jetty-java5-threadpool-6.1.26.jar deleted file mode 100644 index fb75a1c62882bfc792ca09d52746d75eccbe2d9e..0000000000000000000000000000000000000000 Binary files a/apps/jetty/jetty-6.1.26/lib/ext/jetty-java5-threadpool-6.1.26.jar and /dev/null differ diff --git a/apps/jetty/jetty-6.1.26/lib/ext/jetty-rewrite-handler-6.1.26.jar b/apps/jetty/jetty-6.1.26/lib/ext/jetty-rewrite-handler-6.1.26.jar deleted file mode 100644 index 3d0a7fbe4aaecac516914cd10dabf57e52756bec..0000000000000000000000000000000000000000 Binary files a/apps/jetty/jetty-6.1.26/lib/ext/jetty-rewrite-handler-6.1.26.jar and /dev/null differ diff --git a/apps/jetty/jetty-6.1.26/lib/ext/jetty-sslengine-6.1.26.jar b/apps/jetty/jetty-6.1.26/lib/ext/jetty-sslengine-6.1.26.jar deleted file mode 100644 index 051efb59d6b215888b9630336bb1fa4f705d3b4f..0000000000000000000000000000000000000000 Binary files a/apps/jetty/jetty-6.1.26/lib/ext/jetty-sslengine-6.1.26.jar and /dev/null differ diff --git a/apps/jetty/jetty-6.1.26/lib/jetty-6.1.26.jar b/apps/jetty/jetty-6.1.26/lib/jetty-6.1.26.jar deleted file mode 100644 index 2cbe07aeefa47ad6321addf0e75e010858f72fba..0000000000000000000000000000000000000000 Binary files a/apps/jetty/jetty-6.1.26/lib/jetty-6.1.26.jar and /dev/null differ diff --git a/apps/jetty/jetty-6.1.26/lib/jetty-util-6.1.26.jar b/apps/jetty/jetty-6.1.26/lib/jetty-util-6.1.26.jar deleted file mode 100644 index cd237528add68b792f2e6e030344f27d9d07ec31..0000000000000000000000000000000000000000 Binary files a/apps/jetty/jetty-6.1.26/lib/jetty-util-6.1.26.jar and /dev/null differ diff --git a/apps/jetty/jetty-6.1.26/lib/management/jetty-management-6.1.26.jar b/apps/jetty/jetty-6.1.26/lib/management/jetty-management-6.1.26.jar deleted file mode 100644 index b5eeecb3278908eced646acb954042a0b9589c57..0000000000000000000000000000000000000000 Binary files a/apps/jetty/jetty-6.1.26/lib/management/jetty-management-6.1.26.jar and /dev/null differ diff --git a/apps/jetty/jetty-6.1.26/start.jar b/apps/jetty/jetty-6.1.26/start.jar deleted file mode 100644 index d3a94bcfae630a90d4103437bd3c2da0d37d98c9..0000000000000000000000000000000000000000 Binary files a/apps/jetty/jetty-6.1.26/start.jar and /dev/null differ