();
@@ -381,6 +377,8 @@ public class ResourceCache
_cachedSize.addAndGet(_length);
_cachedFiles.incrementAndGet();
_lastAccessed=System.currentTimeMillis();
+
+ _etagBuffer=_etags?new ByteArrayBuffer(resource.getWeakETag()):null;
}
@@ -407,11 +405,17 @@ public class ResourceCache
{
return _resource;
}
+
+ /* ------------------------------------------------------------ */
+ public Buffer getETag()
+ {
+ return _etagBuffer;
+ }
/* ------------------------------------------------------------ */
boolean isValid()
{
- if (_lastModified==_resource.lastModified())
+ if (_lastModified==_resource.lastModified() && _length==_resource.length())
{
_lastAccessed=System.currentTimeMillis();
return true;
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java
index b8f9ccb9a78..b31c5a00036 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -469,15 +469,23 @@ public class Response implements HttpServletResponse
{
buf = _connection.getRequest().getRootURL();
buf.append(URIUtil.encodePath(canonical));
- if (uri.getQuery()!=null)
+ String param=uri.getParam();
+ if (param!=null)
+ {
+ buf.append(';');
+ buf.append(param);
+ }
+ String query=uri.getQuery();
+ if (query!=null)
{
buf.append('?');
- buf.append(uri.getQuery());
+ buf.append(query);
}
- if (uri.getFragment()!=null)
+ String fragment=uri.getFragment();
+ if (fragment!=null)
{
buf.append('#');
- buf.append(uri.getFragment());
+ buf.append(fragment);
}
location=buf.toString();
}
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java
index 6699c674486..a6e00d48c63 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -262,11 +262,14 @@ public class Server extends HandlerWrapper implements Attributes
@Override
protected void doStart() throws Exception
{
- if (getStopAtShutdown())
+ if (getStopAtShutdown()) {
ShutdownThread.register(this);
+ ShutdownMonitor.getInstance().start(); // initialize
+ }
LOG.info("jetty-"+__version);
HttpGenerator.setServerVersion(__version);
+
MultiException mex=new MultiException();
if (_threadPool==null)
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ServletRequestHttpWrapper.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ServletRequestHttpWrapper.java
index 463e57cf3c5..a60bb193c48 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/ServletRequestHttpWrapper.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ServletRequestHttpWrapper.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ServletResponseHttpWrapper.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ServletResponseHttpWrapper.java
index 4b62f0809da..29dadafac87 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/ServletResponseHttpWrapper.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ServletResponseHttpWrapper.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/SessionIdManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/SessionIdManager.java
index 71412fdef7b..cace2ee4d82 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/SessionIdManager.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/SessionIdManager.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/SessionManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/SessionManager.java
index 43c8947d890..de36b5b2f21 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/SessionManager.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/SessionManager.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ShutdownMonitor.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ShutdownMonitor.java
new file mode 100644
index 00000000000..3edf45b3760
--- /dev/null
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ShutdownMonitor.java
@@ -0,0 +1,318 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
+// ------------------------------------------------------------------------
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// and Apache License v2.0 which accompanies this distribution.
+//
+// The Eclipse Public License is available at
+// http://www.eclipse.org/legal/epl-v10.html
+//
+// The Apache License v2.0 is available at
+// http://www.opensource.org/licenses/apache2.0.php
+//
+// You may elect to redistribute this code under either of these licenses.
+// ========================================================================
+//
+
+package org.eclipse.jetty.server;
+
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.LineNumberReader;
+import java.io.OutputStream;
+import java.net.InetAddress;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.util.Properties;
+
+import org.eclipse.jetty.util.StringUtil;
+import org.eclipse.jetty.util.thread.ShutdownThread;
+
+/**
+ * Shutdown/Stop Monitor thread.
+ *
+ * This thread listens on the port specified by the STOP.PORT system parameter (defaults to -1 for not listening) for request authenticated with the key given
+ * by the STOP.KEY system parameter (defaults to "eclipse") for admin requests.
+ *
+ * If the stop port is set to zero, then a random port is assigned and the port number is printed to stdout.
+ *
+ * Commands "stop" and "status" are currently supported.
+ */
+public class ShutdownMonitor extends Thread
+{
+ // Implementation of safe lazy init, using Initialization on Demand Holder technique.
+ static class Holder
+ {
+ static ShutdownMonitor instance = new ShutdownMonitor();
+ }
+
+ public static ShutdownMonitor getInstance()
+ {
+ return Holder.instance;
+ }
+
+ private boolean DEBUG;
+ private int port;
+ private String key;
+ private boolean exitVm;
+ private ServerSocket serverSocket;
+
+ /**
+ * Create a ShutdownMonitor using configuration from the System properties.
+ *
+ * STOP.PORT
= the port to listen on (empty, null, or values less than 0 disable the stop ability)
+ * STOP.KEY
= the magic key/passphrase to allow the stop (defaults to "eclipse")
+ *
+ * Note: server socket will only listen on localhost, and a successful stop will issue a System.exit() call.
+ */
+ private ShutdownMonitor()
+ {
+ Properties props = System.getProperties();
+
+ this.DEBUG = props.containsKey("DEBUG");
+
+ // Use values passed thru via /jetty-start/
+ this.port = Integer.parseInt(props.getProperty("STOP.PORT","-1"));
+ this.key = props.getProperty("STOP.KEY","eclipse");
+ this.exitVm = true;
+ }
+
+ private void close(ServerSocket server)
+ {
+ if (server == null)
+ {
+ return;
+ }
+
+ try
+ {
+ server.close();
+ }
+ catch (IOException ignore)
+ {
+ /* ignore */
+ }
+ }
+
+ private void close(Socket socket)
+ {
+ if (socket == null)
+ {
+ return;
+ }
+
+ try
+ {
+ socket.close();
+ }
+ catch (IOException ignore)
+ {
+ /* ignore */
+ }
+ }
+
+ private void debug(String format, Object... args)
+ {
+ if (DEBUG)
+ {
+ System.err.printf("[ShutdownMonitor] " + format + "%n",args);
+ }
+ }
+
+ private void debug(Throwable t)
+ {
+ if (DEBUG)
+ {
+ t.printStackTrace(System.err);
+ }
+ }
+
+ public String getKey()
+ {
+ return key;
+ }
+
+ public int getPort()
+ {
+ return port;
+ }
+
+ public ServerSocket getServerSocket()
+ {
+ return serverSocket;
+ }
+
+ public boolean isExitVm()
+ {
+ return exitVm;
+ }
+
+ @Override
+ public void run()
+ {
+ if (serverSocket == null)
+ {
+ return;
+ }
+
+ while (true)
+ {
+ Socket socket = null;
+ try
+ {
+ socket = serverSocket.accept();
+
+ LineNumberReader lin = new LineNumberReader(new InputStreamReader(socket.getInputStream()));
+ String key = lin.readLine();
+ if (!this.key.equals(key))
+ {
+ System.err.println("Ignoring command with incorrect key");
+ continue;
+ }
+
+ OutputStream out = socket.getOutputStream();
+
+ String cmd = lin.readLine();
+ debug("command=%s",cmd);
+ if ("stop".equals(cmd))
+ {
+ // Graceful Shutdown
+ debug("Issuing graceful shutdown..");
+ ShutdownThread.getInstance().run();
+
+ // Reply to client
+ debug("Informing client that we are stopped.");
+ out.write("Stopped\r\n".getBytes(StringUtil.__UTF8));
+ out.flush();
+
+ // Shutdown Monitor
+ debug("Shutting down monitor");
+ close(socket);
+ close(serverSocket);
+
+ if (exitVm)
+ {
+ // Kill JVM
+ debug("Killing JVM");
+ System.exit(0);
+ }
+ }
+ else if ("status".equals(cmd))
+ {
+ // Reply to client
+ out.write("OK\r\n".getBytes(StringUtil.__UTF8));
+ out.flush();
+ }
+ }
+ catch (Exception e)
+ {
+ debug(e);
+ System.err.println(e.toString());
+ }
+ finally
+ {
+ close(socket);
+ socket = null;
+ }
+ }
+ }
+
+ public void setDebug(boolean flag)
+ {
+ this.DEBUG = flag;
+ }
+
+ public void setExitVm(boolean exitVm)
+ {
+ if (isAlive())
+ {
+ throw new IllegalStateException("ShutdownMonitor already started");
+ }
+ this.exitVm = exitVm;
+ }
+
+ public void setKey(String key)
+ {
+ if (isAlive())
+ {
+ throw new IllegalStateException("ShutdownMonitor already started");
+ }
+ this.key = key;
+ }
+
+ public void setPort(int port)
+ {
+ if (isAlive())
+ {
+ throw new IllegalStateException("ShutdownMonitor already started");
+ }
+ this.port = port;
+ }
+
+ public void start()
+ {
+ if (isAlive())
+ {
+ System.err.printf("ShutdownMonitor already started");
+ return; // cannot start it again
+ }
+ startListenSocket();
+ if (serverSocket == null)
+ {
+ return;
+ }
+
+ super.start();
+ }
+
+ private void startListenSocket()
+ {
+ if (this.port < 0)
+ {
+ if (DEBUG)
+ System.err.println("ShutdownMonitor not in use (port < 0): " + port);
+ return;
+ }
+
+ try
+ {
+ setDaemon(true);
+ setName("ShutdownMonitor");
+
+ this.serverSocket = new ServerSocket(this.port,1,InetAddress.getByName("127.0.0.1"));
+ if (this.port == 0)
+ {
+ // server assigned port in use
+ this.port = serverSocket.getLocalPort();
+ System.out.printf("STOP.PORT=%d%n",this.port);
+ }
+
+ if (this.key == null)
+ {
+ // create random key
+ this.key = Long.toString((long)(Long.MAX_VALUE * Math.random() + this.hashCode() + System.currentTimeMillis()),36);
+ System.out.printf("STOP.KEY=%s%n",this.key);
+ }
+ }
+ catch (Exception e)
+ {
+ debug(e);
+ System.err.println("Error binding monitor port " + this.port + ": " + e.toString());
+ }
+ finally
+ {
+ // establish the port and key that are in use
+ debug("STOP.PORT=%d",this.port);
+ debug("STOP.KEY=%s",this.key);
+ debug("%s",serverSocket);
+ }
+ }
+
+ @Override
+ public String toString()
+ {
+ return String.format("%s[port=%d]",this.getClass().getName(),port);
+ }
+}
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/UserIdentity.java b/jetty-server/src/main/java/org/eclipse/jetty/server/UserIdentity.java
index dedb9bc06d8..c875074035a 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/UserIdentity.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/UserIdentity.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/bio/SocketConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/bio/SocketConnector.java
index 1fea21f5e18..d8c7862b87f 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/bio/SocketConnector.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/bio/SocketConnector.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandler.java
index 102ed5185fa..d78c37294a6 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandler.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandlerContainer.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandlerContainer.java
index eec8e19fd6a..e758d3dc7d2 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandlerContainer.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandlerContainer.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ConnectHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ConnectHandler.java
index 27c262e25c8..07f6c1b66c7 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ConnectHandler.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ConnectHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java
index ec4f6af5c1e..fbee38f6ad2 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -32,11 +32,12 @@ import java.util.Enumeration;
import java.util.EventListener;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
-import java.util.EnumSet;
+import java.util.concurrent.CopyOnWriteArrayList;
import javax.servlet.DispatcherType;
import javax.servlet.RequestDispatcher;
@@ -139,8 +140,8 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server.
private EventListener[] _eventListeners;
private Logger _logger;
private boolean _allowNullPathInfo;
- private int _maxFormKeys = Integer.getInteger("org.eclipse.jetty.server.Request.maxFormKeys",1000).intValue();
- private int _maxFormContentSize = Integer.getInteger("org.eclipse.jetty.server.Request.maxFormContentSize",200000).intValue();
+ private int _maxFormKeys = Integer.getInteger("org.eclipse.jetty.server.Request.maxFormKeys",-1).intValue();
+ private int _maxFormContentSize = Integer.getInteger("org.eclipse.jetty.server.Request.maxFormContentSize",-1).intValue();
private boolean _compactPath = false;
private boolean _aliases = false;
@@ -150,6 +151,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server.
private Object _requestAttributeListeners;
private Map _managedAttributes;
private String[] _protectedTargets;
+ private final CopyOnWriteArrayList _aliasChecks = new CopyOnWriteArrayList();
private boolean _shutdown = false;
private boolean _available = true;
@@ -168,6 +170,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server.
_attributes = new AttributesMap();
_contextAttributes = new AttributesMap();
_initParams = new HashMap();
+ addAliasCheck(new ApproveNonExistentDirectoryAliases());
}
/* ------------------------------------------------------------ */
@@ -181,6 +184,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server.
_attributes = new AttributesMap();
_contextAttributes = new AttributesMap();
_initParams = new HashMap();
+ addAliasCheck(new ApproveNonExistentDirectoryAliases());
}
/* ------------------------------------------------------------ */
@@ -769,7 +773,6 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server.
public void callContextInitialized (ServletContextListener l, ServletContextEvent e)
{
l.contextInitialized(e);
- LOG.info("started {}",this);
}
/* ------------------------------------------------------------ */
@@ -1566,14 +1569,23 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server.
path = URIUtil.canonicalPath(path);
Resource resource = _baseResource.addPath(path);
+ // Is the resource aliased?
if (!_aliases && resource.getAlias() != null)
{
- if (resource.exists())
- LOG.warn("Aliased resource: " + resource + "~=" + resource.getAlias());
- else if (path.endsWith("/") && resource.getAlias().toString().endsWith(path))
- return resource;
- else if (LOG.isDebugEnabled())
+ if (LOG.isDebugEnabled())
LOG.debug("Aliased resource: " + resource + "~=" + resource.getAlias());
+
+ // alias checks
+ for (Iterator i=_aliasChecks.iterator();i.hasNext();)
+ {
+ AliasCheck check = i.next();
+ if (check.check(path,resource))
+ {
+ if (LOG.isDebugEnabled())
+ LOG.debug("Aliased resource: " + resource + " approved by " + check);
+ return resource;
+ }
+ }
return null;
}
@@ -1654,6 +1666,25 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server.
return host;
}
+
+ /* ------------------------------------------------------------ */
+ /**
+ * Add an AliasCheck instance to possibly permit aliased resources
+ * @param check The alias checker
+ */
+ public void addAliasCheck(AliasCheck check)
+ {
+ _aliasChecks.add(check);
+ }
+
+ /* ------------------------------------------------------------ */
+ /**
+ * @return Mutable list of Alias checks
+ */
+ public List getAliasChecks()
+ {
+ return _aliasChecks;
+ }
/* ------------------------------------------------------------ */
/**
@@ -2432,4 +2463,71 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server.
}
}
+
+
+ /* ------------------------------------------------------------ */
+ /** Interface to check aliases
+ */
+ public interface AliasCheck
+ {
+ /* ------------------------------------------------------------ */
+ /** Check an alias
+ * @param path The path the aliased resource was created for
+ * @param resource The aliased resourced
+ * @return True if the resource is OK to be served.
+ */
+ boolean check(String path, Resource resource);
+ }
+
+
+ /* ------------------------------------------------------------ */
+ /** Approve Aliases with same suffix.
+ * Eg. a symbolic link from /foobar.html to /somewhere/wibble.html would be
+ * approved because both the resource and alias end with ".html".
+ */
+ public static class ApproveSameSuffixAliases implements AliasCheck
+ {
+ public boolean check(String path, Resource resource)
+ {
+ int dot = path.lastIndexOf('.');
+ if (dot<0)
+ return false;
+ String suffix=path.substring(dot);
+ return resource.getAlias().toString().endsWith(suffix);
+ }
+ }
+
+
+ /* ------------------------------------------------------------ */
+ /** Approve Aliases with a path prefix.
+ * Eg. a symbolic link from /dirA/foobar.html to /dirB/foobar.html would be
+ * approved because both the resource and alias end with "/foobar.html".
+ */
+ public static class ApprovePathPrefixAliases implements AliasCheck
+ {
+ public boolean check(String path, Resource resource)
+ {
+ int slash = path.lastIndexOf('/');
+ if (slash<0)
+ return false;
+ String suffix=path.substring(slash);
+ return resource.getAlias().toString().endsWith(suffix);
+ }
+ }
+ /* ------------------------------------------------------------ */
+ /** Approve Aliases of a non existent directory.
+ * If a directory "/foobar/" does not exist, then the resource is
+ * aliased to "/foobar". Accept such aliases.
+ */
+ public static class ApproveNonExistentDirectoryAliases implements AliasCheck
+ {
+ public boolean check(String path, Resource resource)
+ {
+ int slash = path.lastIndexOf('/');
+ if (slash<0)
+ return false;
+ String suffix=path.substring(slash);
+ return resource.getAlias().toString().endsWith(suffix);
+ }
+ }
}
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java
index 287fa15e7f4..c4d2c97f608 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/DebugHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/DebugHandler.java
index fc2bbf811e1..0630ff60343 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/DebugHandler.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/DebugHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/DefaultHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/DefaultHandler.java
index 01987404524..2451895745a 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/DefaultHandler.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/DefaultHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ErrorHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ErrorHandler.java
index 9f9a1ccbd3f..323ac4e7e92 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ErrorHandler.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ErrorHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/GzipHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/GzipHandler.java
index 7c0979aca92..68075f49e57 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/GzipHandler.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/GzipHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -68,6 +68,7 @@ public class GzipHandler extends HandlerWrapper
protected Set _excluded;
protected int _bufferSize = 8192;
protected int _minGzipSize = 256;
+ protected String _vary = "Accept-Encoding, User-Agent";
/* ------------------------------------------------------------ */
/**
@@ -161,6 +162,31 @@ public class GzipHandler extends HandlerWrapper
}
}
+ /* ------------------------------------------------------------ */
+ /**
+ * @return The value of the Vary header set if a response can be compressed.
+ */
+ public String getVary()
+ {
+ return _vary;
+ }
+
+ /* ------------------------------------------------------------ */
+ /**
+ * Set the value of the Vary header sent with responses that could be compressed.
+ *
+ * By default it is set to 'Accept-Encoding, User-Agent' since IE6 is excluded by
+ * default from the excludedAgents. If user-agents are not to be excluded, then
+ * this can be set to 'Accept-Encoding'. Note also that shared caches may cache
+ * many copies of a resource that is varied by User-Agent - one per variation of the
+ * User-Agent, unless the cache does some normalization of the UA string.
+ * @param vary The value of the Vary header set if a response can be compressed.
+ */
+ public void setVary(String vary)
+ {
+ _vary = vary;
+ }
+
/* ------------------------------------------------------------ */
/**
* Get the buffer size.
@@ -295,9 +321,9 @@ public class GzipHandler extends HandlerWrapper
}
@Override
- protected AbstractCompressedStream newCompressedStream(HttpServletRequest request,HttpServletResponse response,long contentLength,int bufferSize, int minCompressSize) throws IOException
+ protected AbstractCompressedStream newCompressedStream(HttpServletRequest request,HttpServletResponse response) throws IOException
{
- return new AbstractCompressedStream("gzip",request,response,contentLength,bufferSize,minCompressSize)
+ return new AbstractCompressedStream("gzip",request,this,_vary)
{
@Override
protected DeflaterOutputStream createStream() throws IOException
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerCollection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerCollection.java
index 5518d00c826..64025c73440 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerCollection.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerCollection.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerList.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerList.java
index 9bcef2486a9..43136c6e014 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerList.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerList.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerWrapper.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerWrapper.java
index dbaa5381cbc..d55fc017bcc 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerWrapper.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerWrapper.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HotSwapHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HotSwapHandler.java
index aad1a2d071a..bf806f4180c 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HotSwapHandler.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HotSwapHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/IPAccessHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/IPAccessHandler.java
index b4642ece912..d5b17803ca5 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/IPAccessHandler.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/IPAccessHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/MovedContextHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/MovedContextHandler.java
index f6dc5eb0ed5..fc411027f72 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/MovedContextHandler.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/MovedContextHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ProxyHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ProxyHandler.java
index 819e59460ef..5654f780089 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ProxyHandler.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ProxyHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/RequestLogHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/RequestLogHandler.java
index b5bc248f3a9..e9eb6d9afda 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/RequestLogHandler.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/RequestLogHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java
index 49eccb3a036..97f784e3319 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -69,6 +69,7 @@ public class ResourceHandler extends HandlerWrapper
ByteArrayBuffer _cacheControl;
boolean _aliases;
boolean _directory;
+ boolean _etags;
/* ------------------------------------------------------------ */
public ResourceHandler()
@@ -128,6 +129,24 @@ public class ResourceHandler extends HandlerWrapper
_directory = directory;
}
+ /* ------------------------------------------------------------ */
+ /**
+ * @return True if ETag processing is done
+ */
+ public boolean isEtags()
+ {
+ return _etags;
+ }
+
+ /* ------------------------------------------------------------ */
+ /**
+ * @param etags True if ETag processing is done
+ */
+ public void setEtags(boolean etags)
+ {
+ _etags = etags;
+ }
+
/* ------------------------------------------------------------ */
@Override
public void doStart()
@@ -419,6 +438,21 @@ public class ResourceHandler extends HandlerWrapper
// set some headers
long last_modified=resource.lastModified();
+ String etag=null;
+ if (_etags)
+ {
+ // simple handling of only a single etag
+ String ifnm = request.getHeader(HttpHeaders.IF_NONE_MATCH);
+ etag=resource.getWeakETag();
+ if (ifnm!=null && resource!=null && ifnm.equals(etag))
+ {
+ response.setStatus(HttpStatus.NOT_MODIFIED_304);
+ baseRequest.getResponse().getHttpFields().put(HttpHeaders.ETAG_BUFFER,etag);
+ return;
+ }
+ }
+
+
if (last_modified>0)
{
long if_modified=request.getDateHeader(HttpHeaders.IF_MODIFIED_SINCE);
@@ -436,6 +470,9 @@ public class ResourceHandler extends HandlerWrapper
// set the headers
doResponseHeaders(response,resource,mime!=null?mime.toString():null);
response.setDateHeader(HttpHeaders.LAST_MODIFIED,last_modified);
+ if (_etags)
+ baseRequest.getResponse().getHttpFields().put(HttpHeaders.ETAG_BUFFER,etag);
+
if(skipContentBody)
return;
// Send the content
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ScopedHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ScopedHandler.java
index 7172e820d18..78527a9164a 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ScopedHandler.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ScopedHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ShutdownHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ShutdownHandler.java
index b884887189f..d80451638f7 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ShutdownHandler.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ShutdownHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StatisticsHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StatisticsHandler.java
index 6a339008e0e..1be2c1a8441 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StatisticsHandler.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StatisticsHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/jmx/AbstractHandlerMBean.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/jmx/AbstractHandlerMBean.java
index c0380eb6803..2be55b40657 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/jmx/AbstractHandlerMBean.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/jmx/AbstractHandlerMBean.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/jmx/ContextHandlerMBean.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/jmx/ContextHandlerMBean.java
index a849ab5902d..c94c3fe3c41 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/jmx/ContextHandlerMBean.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/jmx/ContextHandlerMBean.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/jmx/ServerMBean.java b/jetty-server/src/main/java/org/eclipse/jetty/server/jmx/ServerMBean.java
index 09e77f5fc73..a2f361f8e40 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/jmx/ServerMBean.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/jmx/ServerMBean.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/nio/AbstractNIOConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/nio/AbstractNIOConnector.java
index e8d0c637ef1..a60073149dc 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/nio/AbstractNIOConnector.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/nio/AbstractNIOConnector.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/nio/BlockingChannelConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/nio/BlockingChannelConnector.java
index 980a2bfc82b..0195c3fbe02 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/nio/BlockingChannelConnector.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/nio/BlockingChannelConnector.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/nio/InheritedChannelConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/nio/InheritedChannelConnector.java
index fe0a478fd32..3b5bda960a6 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/nio/InheritedChannelConnector.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/nio/InheritedChannelConnector.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/nio/NIOConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/nio/NIOConnector.java
index 5cc75af967b..bc82ca7c82c 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/nio/NIOConnector.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/nio/NIOConnector.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/nio/NetworkTrafficSelectChannelConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/nio/NetworkTrafficSelectChannelConnector.java
index ebb5893a08c..1318ea024b4 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/nio/NetworkTrafficSelectChannelConnector.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/nio/NetworkTrafficSelectChannelConnector.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/nio/SelectChannelConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/nio/SelectChannelConnector.java
index c414f6cbce3..d468bdd3fcb 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/nio/SelectChannelConnector.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/nio/SelectChannelConnector.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSession.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSession.java
index a23f399feba..c4696ee2854 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSession.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSession.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionIdManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionIdManager.java
index 286b469f591..d1ea0af8ed7 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionIdManager.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionIdManager.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java
index 9b72c1dccb0..e185d2894e6 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionIdManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionIdManager.java
index 299a93a43c2..c63f56f4a2f 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionIdManager.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionIdManager.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionManager.java
index f6e380a43aa..638559ba977 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionManager.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionManager.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -24,6 +24,7 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
+import java.net.URI;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map;
@@ -41,7 +42,10 @@ import org.eclipse.jetty.util.log.Logger;
/* ------------------------------------------------------------ */
-/** An in-memory implementation of SessionManager.
+/**
+ * HashSessionManager
+ *
+ * An in-memory implementation of SessionManager.
*
* This manager supports saving sessions to disk, either periodically or at shutdown.
* Sessions can also have their content idle saved to disk to reduce the memory overheads of large idle sessions.
@@ -78,7 +82,7 @@ public class HashSessionManager extends AbstractSessionManager
}
/* ------------------------------------------------------------ */
- /* (non-Javadoc)
+ /**
* @see org.eclipse.jetty.servlet.AbstractSessionManager#doStart()
*/
@Override
@@ -111,7 +115,7 @@ public class HashSessionManager extends AbstractSessionManager
}
/* ------------------------------------------------------------ */
- /* (non-Javadoc)
+ /**
* @see org.eclipse.jetty.servlet.AbstractSessionManager#doStop()
*/
@Override
@@ -253,7 +257,7 @@ public class HashSessionManager extends AbstractSessionManager
* @param seconds the period in seconds at which a check is made for sessions to be invalidated.
*/
public void setScavengePeriod(int seconds)
- {
+ {
if (seconds==0)
seconds=60;
@@ -265,6 +269,7 @@ public class HashSessionManager extends AbstractSessionManager
period=1000;
_scavengePeriodMs=period;
+
if (_timer!=null && (period!=old_period || _task==null))
{
synchronized (this)
@@ -304,25 +309,36 @@ public class HashSessionManager extends AbstractSessionManager
// For each session
long now=System.currentTimeMillis();
+
for (Iterator i=_sessions.values().iterator(); i.hasNext();)
{
HashedSession session=i.next();
- long idleTime=session.getMaxInactiveInterval()*1000L;
+ long idleTime=session.getMaxInactiveInterval()*1000L;
if (idleTime>0&&session.getAccessed()+idleTime0&&session.getAccessed()+_idleSavePeriodMs 0 && session.getAccessed()+_idleSavePeriodMs < now)
{
- session.idle();
+ try
+ {
+ session.idle();
+ }
+ catch (Exception e)
+ {
+ __log.warn("Problem idling session "+ session.getId(), e);
+ }
}
}
- }
- catch (Throwable t)
- {
- __log.warn("Problem scavenging sessions", t);
- }
+ }
finally
{
thread.setContextClassLoader(old_loader);
@@ -421,9 +437,11 @@ public class HashSessionManager extends AbstractSessionManager
}
/* ------------------------------------------------------------ */
- public void setStoreDirectory (File dir)
- {
- _storeDir=dir;
+ public void setStoreDirectory (File dir) throws IOException
+ {
+ // CanonicalFile is used to capture the base store directory in a way that will
+ // work on Windows. Case differences may through off later checks using this directory.
+ _storeDir=dir.getCanonicalFile();
}
/* ------------------------------------------------------------ */
@@ -481,8 +499,9 @@ public class HashSessionManager extends AbstractSessionManager
/* ------------------------------------------------------------ */
protected synchronized HashedSession restoreSession(String idInCuster)
- {
+ {
File file = new File(_storeDir,idInCuster);
+
FileInputStream in = null;
Exception error = null;
try
@@ -507,13 +526,15 @@ public class HashSessionManager extends AbstractSessionManager
if (error != null)
{
- if (isDeleteUnrestorableSessions() && file.exists())
+ if (isDeleteUnrestorableSessions() && file.exists() && file.getParentFile().equals(_storeDir) )
{
file.delete();
__log.warn("Deleting file for unrestorable session "+idInCuster, error);
}
else
+ {
__log.warn("Problem restoring session "+idInCuster, error);
+ }
}
else
file.delete(); //delete successfully restored file
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashedSession.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashedSession.java
index 33119f4f977..173c29617ed 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashedSession.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashedSession.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -100,6 +100,7 @@ public class HashedSession extends AbstractSession
/* ------------------------------------------------------------ */
synchronized void save(boolean reactivate)
+ throws Exception
{
// Only idle the session if not already idled and no previous save/idle has failed
if (!isIdled() && !_saveFailed)
@@ -128,16 +129,13 @@ public class HashedSession extends AbstractSession
catch (Exception e)
{
saveFailed(); // We won't try again for this session
-
- LOG.warn("Problem saving session " + super.getId(), e);
-
if (fos != null)
{
// Must not leave the file open if the saving failed
IO.close(fos);
// No point keeping the file if we didn't save the whole session
file.delete();
- _idled=false; // assume problem was before _values.clear();
+ throw e;
}
}
}
@@ -181,7 +179,7 @@ public class HashedSession extends AbstractSession
access(System.currentTimeMillis());
if (LOG.isDebugEnabled())
- LOG.debug("Deidling " + super.getId());
+ LOG.debug("De-idling " + super.getId());
FileInputStream fis = null;
@@ -203,7 +201,7 @@ public class HashedSession extends AbstractSession
}
catch (Exception e)
{
- LOG.warn("Problem deidling session " + super.getId(), e);
+ LOG.warn("Problem de-idling session " + super.getId(), e);
IO.close(fis);
invalidate();
}
@@ -219,8 +217,10 @@ public class HashedSession extends AbstractSession
* it to an idled state.
*/
public synchronized void idle()
+ throws Exception
{
save(false);
+ _idled = true;
}
/* ------------------------------------------------------------ */
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionIdManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionIdManager.java
index ecc84b22de7..e15a47d6a2f 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionIdManager.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionIdManager.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionManager.java
index d37b4eba0c2..cdb7998585f 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionManager.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionManager.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionHandler.java
index 1034efed974..02e5bd441ca 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionHandler.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/jmx/AbstractSessionManagerMBean.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/jmx/AbstractSessionManagerMBean.java
index 9cd87a88628..b6c3442e160 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/jmx/AbstractSessionManagerMBean.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/jmx/AbstractSessionManagerMBean.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/ServletSSL.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/ServletSSL.java
index eac3a3ed340..06dea112091 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/ServletSSL.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/ServletSSL.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslCertificates.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslCertificates.java
index 4c3966da9aa..0f88b49e9bb 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslCertificates.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslCertificates.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslConnector.java
index 12da3579237..e53d3ce750e 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslConnector.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslConnector.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslSelectChannelConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslSelectChannelConnector.java
index 86279edbb7b..0707d4af0bd 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslSelectChannelConnector.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslSelectChannelConnector.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslSocketConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslSocketConnector.java
index 372c377b924..7b6af9349a8 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslSocketConnector.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslSocketConnector.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/AbstractConnectorTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/AbstractConnectorTest.java
index ca963d413cb..7808f9c7718 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/AbstractConnectorTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/AbstractConnectorTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncRequestReadTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncRequestReadTest.java
index 72d544483bb..9df71674e47 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncRequestReadTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncRequestReadTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncStressTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncStressTest.java
index ea04fc2f44d..ab5a446734f 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncStressTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncStressTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/BlockingChannelCloseTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/BlockingChannelCloseTest.java
index 0aee90336eb..a7d0bcf6067 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/BlockingChannelCloseTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/BlockingChannelCloseTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/BlockingChannelServerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/BlockingChannelServerTest.java
index bc66bfb663d..d4708357cd0 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/BlockingChannelServerTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/BlockingChannelServerTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/BlockingChannelTimeoutTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/BlockingChannelTimeoutTest.java
index 8dab737d476..959f3356620 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/BlockingChannelTimeoutTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/BlockingChannelTimeoutTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/CheckReverseProxyHeadersTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/CheckReverseProxyHeadersTest.java
index c9bfe0bb202..14d0634a098 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/CheckReverseProxyHeadersTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/CheckReverseProxyHeadersTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectorCloseTestBase.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectorCloseTestBase.java
index 2f9938f2871..a37f0510438 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectorCloseTestBase.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectorCloseTestBase.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectorTimeoutTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectorTimeoutTest.java
index 029b44d4071..e5144b55543 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectorTimeoutTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectorTimeoutTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/DumpHandler.java b/jetty-server/src/test/java/org/eclipse/jetty/server/DumpHandler.java
index 315d53327bc..3cf9cf8a448 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/DumpHandler.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/DumpHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/EncodedHttpURITest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/EncodedHttpURITest.java
index be18c50b200..911d89043c9 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/EncodedHttpURITest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/EncodedHttpURITest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java
index 8fbd8dd45f0..f3393515d8f 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestBase.java b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestBase.java
index 81329e98185..4331cbda341 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestBase.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestBase.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestFixture.java b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestFixture.java
index f894ce79439..dd6eb82216c 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestFixture.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestFixture.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpURITest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpURITest.java
index b996bca42a9..5e8cf48c8f0 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpURITest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpURITest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -195,7 +195,8 @@ public class HttpURITest
/* 1*/ {"/path/%69nfo","/path/info", "UTF-8"},
/* 2*/ {"http://host/path/%69nfo","/path/info", "UTF-8"},
/* 3*/ {"http://host/path/%69nf%c2%a4","/path/inf\u00a4", "UTF-8"},
- /* 4*/ {"http://host/path/%E5", "/path/\u00e5", "ISO-8859-1"}
+ /* 4*/ {"http://host/path/%E5", "/path/\u00e5", "ISO-8859-1"},
+ /* 5*/ {"/foo/%u30ED/bar%3Fabc%3D123%26xyz%3D456","/foo/\u30ed/bar?abc=123&xyz=456","UTF-8"}
};
@Test
@@ -207,11 +208,12 @@ public class HttpURITest
{
uri.parse(encoding_tests[t][0]);
assertEquals(""+t,encoding_tests[t][1],uri.getDecodedPath(encoding_tests[t][2]));
-
+
+ if ("UTF-8".equalsIgnoreCase(encoding_tests[t][2]))
+ assertEquals(""+t,encoding_tests[t][1],uri.getDecodedPath());
}
}
-
@Test
public void testNoPercentEncodingOfQueryUsingNonUTF8() throws Exception
{
@@ -314,7 +316,7 @@ public class HttpURITest
@Test
public void testUnicodeErrors() throws UnsupportedEncodingException
{
- String uri="http://server/path?invalid=data%u2021here";
+ String uri="http://server/path?invalid=data%uXXXXhere%u000";
try
{
URLDecoder.decode(uri,"UTF-8");
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpWriterTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpWriterTest.java
index e5820333855..5f133b5fd1f 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpWriterTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpWriterTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/InclusiveByteRangeTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/InclusiveByteRangeTest.java
index 43e46f0b82c..8ff6100efbf 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/InclusiveByteRangeTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/InclusiveByteRangeTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/LocalAsyncContextTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/LocalAsyncContextTest.java
index 01b270bb680..65e993b2bb1 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/LocalAsyncContextTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/LocalAsyncContextTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/NetworkTrafficListenerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/NetworkTrafficListenerTest.java
index 8936794a395..c9ad9061375 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/NetworkTrafficListenerTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/NetworkTrafficListenerTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/RFC2616Test.java b/jetty-server/src/test/java/org/eclipse/jetty/server/RFC2616Test.java
index c6a9f1f633e..e9dad93861e 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/RFC2616Test.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/RFC2616Test.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java
index 408feefa628..3d82e1bbfcc 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ResourceCacheTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ResourceCacheTest.java
index 3d47bdf28c8..23945cb08ea 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/ResourceCacheTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ResourceCacheTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -46,9 +46,9 @@ public class ResourceCacheTest
Resource[] r = rc.getResources();
MimeTypes mime = new MimeTypes();
- ResourceCache rc3 = new ResourceCache(null,r[2],mime,false);
- ResourceCache rc2 = new ResourceCache(rc3,r[1],mime,false);
- ResourceCache rc1 = new ResourceCache(rc2,r[0],mime,false);
+ ResourceCache rc3 = new ResourceCache(null,r[2],mime,false,false);
+ ResourceCache rc2 = new ResourceCache(rc3,r[1],mime,false,false);
+ ResourceCache rc1 = new ResourceCache(rc2,r[0],mime,false,false);
assertEquals("1 - one", getContent(rc1, "1.txt"));
assertEquals("2 - two", getContent(rc1, "2.txt"));
@@ -76,8 +76,8 @@ public class ResourceCacheTest
Resource[] r = rc.getResources();
MimeTypes mime = new MimeTypes();
- ResourceCache rc3 = new ResourceCache(null,r[2],mime,false);
- ResourceCache rc2 = new ResourceCache(rc3,r[1],mime,false)
+ ResourceCache rc3 = new ResourceCache(null,r[2],mime,false,false);
+ ResourceCache rc2 = new ResourceCache(rc3,r[1],mime,false,false)
{
@Override
public boolean isCacheable(Resource resource)
@@ -86,7 +86,7 @@ public class ResourceCacheTest
}
};
- ResourceCache rc1 = new ResourceCache(rc2,r[0],mime,false);
+ ResourceCache rc1 = new ResourceCache(rc2,r[0],mime,false,false);
assertEquals("1 - one", getContent(rc1, "1.txt"));
assertEquals("2 - two", getContent(rc1, "2.txt"));
@@ -126,7 +126,7 @@ public class ResourceCacheTest
directory=Resource.newResource(files[0].getParentFile().getAbsolutePath());
- cache=new ResourceCache(null,directory,new MimeTypes(),false);
+ cache=new ResourceCache(null,directory,new MimeTypes(),false,false);
cache.setMaxCacheSize(95);
cache.setMaxCachedFileSize(85);
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ResponseTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ResponseTest.java
index ece7e2e9649..2e54f2587e9 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/ResponseTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ResponseTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -425,8 +425,13 @@ public class ResponseTest
throws Exception
{
String[][] tests={
- {"/other/location?name=value","http://myhost:8888/other/location;jsessionid=12345?name=value"},
- /* {"/other/location","http://myhost:8888/other/location"},
+ // No cookie
+ {"http://myhost:8888/other/location;jsessionid=12345?name=value","http://myhost:8888/other/location;jsessionid=12345?name=value"},
+ {"/other/location;jsessionid=12345?name=value","http://myhost:8888/other/location;jsessionid=12345?name=value"},
+ {"./location;jsessionid=12345?name=value","http://myhost:8888/path/location;jsessionid=12345?name=value"},
+
+ // From cookie
+ {"/other/location","http://myhost:8888/other/location"},
{"/other/l%20cation","http://myhost:8888/other/l%20cation"},
{"location","http://myhost:8888/path/location"},
{"./location","http://myhost:8888/path/location"},
@@ -434,11 +439,11 @@ public class ResponseTest
{"/other/l%20cation","http://myhost:8888/other/l%20cation"},
{"l%20cation","http://myhost:8888/path/l%20cation"},
{"./l%20cation","http://myhost:8888/path/l%20cation"},
- {"../l%20cation","http://myhost:8888/l%20cation"},*/
+ {"../l%20cation","http://myhost:8888/l%20cation"},
{"../locati%C3%abn","http://myhost:8888/locati%C3%ABn"},
};
- for (int i=1;i0);
+ request.setRequestedSessionIdFromCookie(i>2);
AbstractSessionManager manager=new HashSessionManager();
manager.setSessionIdManager(new HashSessionIdManager());
request.setSessionManager(manager);
@@ -462,7 +467,7 @@ public class ResponseTest
int l=location.indexOf("Location: ");
int e=location.indexOf('\n',l);
location=location.substring(l+10,e).trim();
- assertEquals(tests[i][0],tests[i][1],location);
+ assertEquals("test-"+i,tests[i][1],location);
}
}
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/SelectChannelAsyncContextTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/SelectChannelAsyncContextTest.java
index 9281b301c71..4c1fb0a3cde 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/SelectChannelAsyncContextTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/SelectChannelAsyncContextTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/SelectChannelConnectorCloseTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/SelectChannelConnectorCloseTest.java
index b21fd830f23..b4c473a25d2 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/SelectChannelConnectorCloseTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/SelectChannelConnectorCloseTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/SelectChannelServerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/SelectChannelServerTest.java
index ea057c50405..c075a0289b5 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/SelectChannelServerTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/SelectChannelServerTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/SelectChannelTimeoutTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/SelectChannelTimeoutTest.java
index 8419806862c..4f0af2e4efb 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/SelectChannelTimeoutTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/SelectChannelTimeoutTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ServerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ServerTest.java
index eccf2a532a6..7b558713d4e 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/ServerTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ServerTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/SlowClientWithPipelinedRequestTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/SlowClientWithPipelinedRequestTest.java
index 1af147f09bd..133f8374c38 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/SlowClientWithPipelinedRequestTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/SlowClientWithPipelinedRequestTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/SocketConnectorCloseTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/SocketConnectorCloseTest.java
index ce5a0b97774..ee4b47e636d 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/SocketConnectorCloseTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/SocketConnectorCloseTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/SocketServerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/SocketServerTest.java
index f5717b84a67..948ed2de551 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/SocketServerTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/SocketServerTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/SocketTimeoutTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/SocketTimeoutTest.java
index 96b9561b48c..78cad06cb9e 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/SocketTimeoutTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/SocketTimeoutTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/StressTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/StressTest.java
index f039ce205ee..3feb8831602 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/StressTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/StressTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/SuspendHandler.java b/jetty-server/src/test/java/org/eclipse/jetty/server/SuspendHandler.java
index aafaef02ff3..cc43d6bd3ee 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/SuspendHandler.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/SuspendHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/AbstractConnectHandlerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/AbstractConnectHandlerTest.java
index a597e7b801b..5dc6df077e2 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/AbstractConnectHandlerTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/AbstractConnectHandlerTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ConnectHandlerSSLTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ConnectHandlerSSLTest.java
index 395129b6a80..6b6de89e329 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ConnectHandlerSSLTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ConnectHandlerSSLTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ConnectHandlerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ConnectHandlerTest.java
index d7ecca40583..9b79a1df1e9 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ConnectHandlerTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ConnectHandlerTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ConnectHandlerUnitTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ConnectHandlerUnitTest.java
index ef911dca4c3..b2a6f3ecf57 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ConnectHandlerUnitTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ConnectHandlerUnitTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ContextHandlerCollectionTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ContextHandlerCollectionTest.java
index b554d65896f..da2b4018949 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ContextHandlerCollectionTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ContextHandlerCollectionTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ContextHandlerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ContextHandlerTest.java
index ec77b7aa4fa..43a89956c7a 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ContextHandlerTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ContextHandlerTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/IPAccessHandlerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/IPAccessHandlerTest.java
index 3bcf058d850..ff099de6ed5 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/IPAccessHandlerTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/IPAccessHandlerTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ResourceHandlerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ResourceHandlerTest.java
index 421532e7d16..4afeb2353e8 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ResourceHandlerTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ResourceHandlerTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ScopedHandlerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ScopedHandlerTest.java
index 0855a46b425..bc378c27a0a 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ScopedHandlerTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ScopedHandlerTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ShutdownHandlerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ShutdownHandlerTest.java
index 969070f6742..c9d950ded1e 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ShutdownHandlerTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ShutdownHandlerTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/StatisticsHandlerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/StatisticsHandlerTest.java
index a54c0a6f59c..9b15c970406 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/StatisticsHandlerTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/StatisticsHandlerTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/session/HashSessionManagerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/session/HashSessionManagerTest.java
new file mode 100644
index 00000000000..12825dbf595
--- /dev/null
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/session/HashSessionManagerTest.java
@@ -0,0 +1,93 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
+// ------------------------------------------------------------------------
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// and Apache License v2.0 which accompanies this distribution.
+//
+// The Eclipse Public License is available at
+// http://www.eclipse.org/legal/epl-v10.html
+//
+// The Apache License v2.0 is available at
+// http://www.opensource.org/licenses/apache2.0.php
+//
+// You may elect to redistribute this code under either of these licenses.
+// ========================================================================
+//
+
+package org.eclipse.jetty.server.session;
+
+import java.io.File;
+
+import junit.framework.Assert;
+
+import org.eclipse.jetty.server.SessionManager;
+import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
+import org.eclipse.jetty.util.log.Log;
+import org.eclipse.jetty.util.log.StdErrLog;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class HashSessionManagerTest
+{
+
+ @After
+ public void enableStacks()
+ {
+ enableStacks(true);
+ }
+
+ @Before
+ public void quietStacks()
+ {
+ enableStacks(false);
+ }
+
+ protected void enableStacks(boolean enabled)
+ {
+ StdErrLog log = (StdErrLog)Log.getLogger("org.eclipse.jetty.server.session");
+ log.setHideStacks(!enabled);
+ }
+
+ @Test
+ public void testDangerousSessionIdRemoval() throws Exception
+ {
+ final HashSessionManager manager = new HashSessionManager();
+ manager.setDeleteUnrestorableSessions(true);
+ manager.setLazyLoad(true);
+ File testDir = MavenTestingUtils.getTargetTestingDir("hashes");
+ testDir.mkdirs();
+ manager.setStoreDirectory(testDir);
+
+ MavenTestingUtils.getTargetFile("dangerFile.session").createNewFile();
+
+ Assert.assertTrue("File should exist!", MavenTestingUtils.getTargetFile("dangerFile.session").exists());
+
+ manager.getSession("../../dangerFile.session");
+
+ Assert.assertTrue("File should exist!", MavenTestingUtils.getTargetFile("dangerFile.session").exists());
+
+ }
+
+ @Test
+ public void testValidSessionIdRemoval() throws Exception
+ {
+ final HashSessionManager manager = new HashSessionManager();
+ manager.setDeleteUnrestorableSessions(true);
+ manager.setLazyLoad(true);
+ File testDir = MavenTestingUtils.getTargetTestingDir("hashes");
+ testDir.mkdirs();
+ manager.setStoreDirectory(testDir);
+
+ new File(testDir, "validFile.session").createNewFile();
+
+ Assert.assertTrue("File should exist!", new File(testDir, "validFile.session").exists());
+
+ manager.getSession("validFile.session");
+
+ Assert.assertTrue("File shouldn't exist!", !new File(testDir,"validFile.session").exists());
+
+ }
+}
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/session/SessionCookieTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/session/SessionCookieTest.java
index 6792eff5735..039325875c8 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/session/SessionCookieTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/session/SessionCookieTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/session/SessionHandlerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/session/SessionHandlerTest.java
index 28c57e0e381..b6440280137 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/session/SessionHandlerTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/session/SessionHandlerTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLCloseTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLCloseTest.java
index b7ddf278082..41a221c4c20 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLCloseTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLCloseTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLEngineTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLEngineTest.java
index 6c94fc2806a..c6a8e959232 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLEngineTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLEngineTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLSelectChannelConnectorLoadTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLSelectChannelConnectorLoadTest.java
index 01edc3f3462..7ba13e1daf8 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLSelectChannelConnectorLoadTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLSelectChannelConnectorLoadTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SelectChannelServerSslTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SelectChannelServerSslTest.java
index 096ecca0719..88e27146875 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SelectChannelServerSslTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SelectChannelServerSslTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslRenegotiateTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslRenegotiateTest.java
index 659e996ce6c..14a352fc376 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslRenegotiateTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslRenegotiateTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSelectChannelTimeoutTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSelectChannelTimeoutTest.java
index 190410d4e09..1fef10793ef 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSelectChannelTimeoutTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSelectChannelTimeoutTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSocketServerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSocketServerTest.java
index 0c53417929b..e808ce8ac9a 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSocketServerTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSocketServerTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSocketTimeoutTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSocketTimeoutTest.java
index d83dfe014d2..3ba33c34052 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSocketTimeoutTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslSocketTimeoutTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslUploadTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslUploadTest.java
index f7d18fefaf9..c619bf7cd49 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslUploadTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SslUploadTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/DefaultServlet.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/DefaultServlet.java
index c5b91cacc9d..3c31e08e78d 100644
--- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/DefaultServlet.java
+++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/DefaultServlet.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -58,6 +58,7 @@ import org.eclipse.jetty.server.nio.NIOConnector;
import org.eclipse.jetty.server.ssl.SslConnector;
import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.MultiPartOutputStream;
+import org.eclipse.jetty.util.QuotedStringTokenizer;
import org.eclipse.jetty.util.URIUtil;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
@@ -116,6 +117,8 @@ import org.eclipse.jetty.util.resource.ResourceFactory;
*
* aliases If True, aliases of resources are allowed (eg. symbolic
* links and caps variations). May bypass security constraints.
+ *
+ * etags If True, weak etags will be handled.
*
* maxCacheSize The maximum total size of the cache or 0 for no cache.
* maxCachedFileSize The maximum size of a file to cache
@@ -152,6 +155,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
private boolean _redirectWelcome=false;
private boolean _gzip=true;
private boolean _pathInfoOnly=false;
+ private boolean _etags=false;
private Resource _resourceBase;
private ResourceCache _cache;
@@ -201,7 +205,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
if (!aliases && !FileResource.getCheckAliases())
throw new IllegalStateException("Alias checking disabled");
if (aliases)
- _servletContext.log("Aliases are enabled");
+ _servletContext.log("Aliases are enabled! Security constraints may be bypassed!!!");
_useFileMappedBuffer=getInitBoolean("useFileMappedBuffer",_useFileMappedBuffer);
@@ -262,11 +266,13 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
LOG.debug("Cache {}={}",resourceCache,_cache);
}
+ _etags = getInitBoolean("etags",_etags);
+
try
{
if (_cache==null && max_cached_files>0)
{
- _cache= new ResourceCache(null,this,_mimeTypes,_useFileMappedBuffer);
+ _cache= new ResourceCache(null,this,_mimeTypes,_useFileMappedBuffer,_etags);
if (max_cache_size>0)
_cache.setMaxCacheSize(max_cache_size);
@@ -287,6 +293,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
if (h.getServletInstance()==this)
_defaultHolder=h;
+
if (LOG.isDebugEnabled())
LOG.debug("resource base = "+_resourceBase);
}
@@ -422,44 +429,37 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
String pathInContext=URIUtil.addPaths(servletPath,pathInfo);
boolean endsWithSlash=(pathInfo==null?request.getServletPath():pathInfo).endsWith(URIUtil.SLASH);
- // Can we gzip this request?
- String pathInContextGz=null;
- boolean gzip=false;
- if (!included.booleanValue() && _gzip && reqRanges==null && !endsWithSlash )
- {
- // Tell caches that response may vary by accept-encoding
- response.setHeader(HttpHeaders.VARY,HttpHeaders.ACCEPT_ENCODING);
- // Should we vary this response according to accept-encoding?
- String accept=request.getHeader(HttpHeaders.ACCEPT_ENCODING);
- if (accept!=null && accept.indexOf("gzip")>=0)
- gzip=true;
- }
// Find the resource and content
Resource resource=null;
HttpContent content=null;
-
try
{
- // Try gzipped content first
- if (gzip)
+ // is gzip enabled?
+ String pathInContextGz=null;
+ boolean gzip=false;
+ if (!included.booleanValue() && _gzip && reqRanges==null && !endsWithSlash )
{
+ // Look for a gzip resource
pathInContextGz=pathInContext+".gz";
-
if (_cache==null)
- {
resource=getResource(pathInContextGz);
- }
else
{
content=_cache.lookup(pathInContextGz);
resource=(content==null)?null:content.getResource();
}
- if (resource==null || !resource.exists() || resource.isDirectory())
+ // Does a gzip resource exist?
+ if (resource!=null && resource.exists() && !resource.isDirectory())
{
- gzip=false;
- pathInContextGz=null;
+ // Tell caches that response may vary by accept-encoding
+ response.setHeader(HttpHeaders.VARY,HttpHeaders.ACCEPT_ENCODING);
+
+ // Does the client accept gzip?
+ String accept=request.getHeader(HttpHeaders.ACCEPT_ENCODING);
+ if (accept!=null && accept.indexOf("gzip")>=0)
+ gzip=true;
}
}
@@ -499,7 +499,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
{
// ensure we have content
if (content==null)
- content=new HttpContent.ResourceAsHttpContent(resource,_mimeTypes.getMimeByExtension(resource.toString()),response.getBufferSize());
+ content=new HttpContent.ResourceAsHttpContent(resource,_mimeTypes.getMimeByExtension(resource.toString()),response.getBufferSize(),_etags);
if (included.booleanValue() || passConditionalHeaders(request,response, resource,content))
{
@@ -570,7 +570,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
}
else
{
- content=new HttpContent.ResourceAsHttpContent(resource,_mimeTypes.getMimeByExtension(resource.toString()));
+ content=new HttpContent.ResourceAsHttpContent(resource,_mimeTypes.getMimeByExtension(resource.toString()),_etags);
if (included.booleanValue() || passConditionalHeaders(request,response, resource,content))
sendDirectory(request,response,resource,pathInContext);
}
@@ -672,6 +672,75 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
{
if (!request.getMethod().equals(HttpMethods.HEAD) )
{
+ if (_etags)
+ {
+ String ifm=request.getHeader(HttpHeaders.IF_MATCH);
+ if (ifm!=null)
+ {
+ boolean match=false;
+ if (content!=null && content.getETag()!=null)
+ {
+ QuotedStringTokenizer quoted = new QuotedStringTokenizer(ifm,", ",false,true);
+ while (!match && quoted.hasMoreTokens())
+ {
+ String tag = quoted.nextToken();
+ if (content.getETag().toString().equals(tag))
+ match=true;
+ }
+ }
+
+ if (!match)
+ {
+ Response r = Response.getResponse(response);
+ r.reset(true);
+ r.setStatus(HttpServletResponse.SC_PRECONDITION_FAILED);
+ return false;
+ }
+ }
+
+ String ifnm=request.getHeader(HttpHeaders.IF_NONE_MATCH);
+ if (ifnm!=null && content!=null && content.getETag()!=null)
+ {
+ // Look for GzipFiltered version of etag
+ if (content.getETag().toString().equals(request.getAttribute("o.e.j.s.GzipFilter.ETag")))
+ {
+ Response r = Response.getResponse(response);
+ r.reset(true);
+ r.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
+ r.getHttpFields().put(HttpHeaders.ETAG_BUFFER,ifnm);
+ return false;
+ }
+
+
+ // Handle special case of exact match.
+ if (content.getETag().toString().equals(ifnm))
+ {
+ Response r = Response.getResponse(response);
+ r.reset(true);
+ r.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
+ r.getHttpFields().put(HttpHeaders.ETAG_BUFFER,content.getETag());
+ return false;
+ }
+
+ // Handle list of tags
+ QuotedStringTokenizer quoted = new QuotedStringTokenizer(ifnm,", ",false,true);
+ while (quoted.hasMoreTokens())
+ {
+ String tag = quoted.nextToken();
+ if (content.getETag().toString().equals(tag))
+ {
+ Response r = Response.getResponse(response);
+ r.reset(true);
+ r.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
+ r.getHttpFields().put(HttpHeaders.ETAG_BUFFER,content.getETag());
+ return false;
+ }
+ }
+
+ return true;
+ }
+ }
+
String ifms=request.getHeader(HttpHeaders.IF_MODIFIED_SINCE);
if (ifms!=null)
{
@@ -895,7 +964,9 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
// content-length header
//
writeHeaders(response,content,-1);
- String mimetype=content.getContentType().toString();
+ String mimetype=(content.getContentType()==null?null:content.getContentType().toString());
+ if (mimetype==null)
+ LOG.warn("Unknown mimetype for "+request.getRequestURI());
MultiPartOutputStream multi = new MultiPartOutputStream(out);
response.setStatus(HttpServletResponse.SC_PARTIAL_CONTENT);
@@ -922,7 +993,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
length+=
((i>0)?2:0)+
2+multi.getBoundary().length()+2+
- HttpHeaders.CONTENT_TYPE.length()+2+mimetype.length()+2+
+ (mimetype==null?0:HttpHeaders.CONTENT_TYPE.length()+2+mimetype.length())+2+
HttpHeaders.CONTENT_RANGE.length()+2+header[i].length()+2+
2+
(ibr.getLast(content_length)-ibr.getFirst(content_length))+1;
@@ -969,7 +1040,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
/* ------------------------------------------------------------ */
protected void writeHeaders(HttpServletResponse response,HttpContent content,long count)
throws IOException
- {
+ {
if (content.getContentType()!=null && response.getContentType()==null)
response.setContentType(content.getContentType().toString());
@@ -991,6 +1062,9 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
r.setLongContentLength(count);
writeOptionHeaders(fields);
+
+ if (_etags)
+ fields.put(HttpHeaders.ETAG_BUFFER,content.getETag());
}
else
{
@@ -1007,6 +1081,9 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
}
writeOptionHeaders(response);
+
+ if (_etags)
+ response.setHeader(HttpHeaders.ETAG,content.getETag().toString());
}
}
diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ErrorPageErrorHandler.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ErrorPageErrorHandler.java
index 7f07fb194f6..384c0be5c59 100644
--- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ErrorPageErrorHandler.java
+++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ErrorPageErrorHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/FilterHolder.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/FilterHolder.java
index e5ef8c23011..2afebab93c7 100644
--- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/FilterHolder.java
+++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/FilterHolder.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/FilterMapping.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/FilterMapping.java
index 195e5d6b091..66243667ac5 100644
--- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/FilterMapping.java
+++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/FilterMapping.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Holder.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Holder.java
index 2bef5dfea03..ea3552213d6 100644
--- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Holder.java
+++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Holder.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Invoker.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Invoker.java
index 98ddb5fc228..c5e5a09f48c 100644
--- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Invoker.java
+++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Invoker.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/NoJspServlet.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/NoJspServlet.java
index da6ca853f14..83f6150e2af 100644
--- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/NoJspServlet.java
+++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/NoJspServlet.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletContextHandler.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletContextHandler.java
index 055060ae919..05d0b507ff6 100644
--- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletContextHandler.java
+++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletContextHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java
index dfc1d2ae679..98479505425 100644
--- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java
+++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -37,7 +37,6 @@ import javax.servlet.AsyncContext;
import javax.servlet.DispatcherType;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
-import javax.servlet.RequestDispatcher;
import javax.servlet.Servlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -66,6 +65,7 @@ import org.eclipse.jetty.server.ServletResponseHttpWrapper;
import org.eclipse.jetty.server.UserIdentity;
import org.eclipse.jetty.server.handler.ContextHandler;
import org.eclipse.jetty.server.handler.ScopedHandler;
+import org.eclipse.jetty.servlet.Holder.Source;
import org.eclipse.jetty.util.LazyList;
import org.eclipse.jetty.util.MultiException;
import org.eclipse.jetty.util.MultiMap;
@@ -98,6 +98,8 @@ public class ServletHandler extends ScopedHandler
private ContextHandler.Context _servletContext;
private FilterHolder[] _filters=new FilterHolder[0];
private FilterMapping[] _filterMappings;
+ private int _matchBeforeIndex = -1; //index of last programmatic FilterMapping with isMatchAfter=false
+ private int _matchAfterIndex = -1; //index of 1st programmatic FilterMapping with isMatchAfter=true
private boolean _filterChainsCached=true;
private int _maxFilterChainsCacheSize=512;
private boolean _startWithUnavailable=true;
@@ -487,18 +489,11 @@ public class ServletHandler extends ScopedHandler
}
else if (th instanceof ServletException)
{
- LOG.debug(th);
+ LOG.warn(th);
Throwable cause=((ServletException)th).getRootCause();
if (cause!=null)
th=cause;
}
- else if (th instanceof RuntimeIOException)
- {
- LOG.debug(th);
- Throwable cause=(IOException)((RuntimeIOException)th).getCause();
- if (cause!=null)
- th=cause;
- }
// handle or log exception
if (th instanceof HttpException)
@@ -932,7 +927,9 @@ public class ServletHandler extends ScopedHandler
mapping.setFilterName(holder.getName());
mapping.setPathSpec(pathSpec);
mapping.setDispatcherTypes(dispatches);
- setFilterMappings((FilterMapping[])LazyList.addToArray(getFilterMappings(), mapping, FilterMapping.class));
+ //setFilterMappings((FilterMapping[])LazyList.addToArray(getFilterMappings(), mapping, FilterMapping.class));
+ addFilterMapping(mapping);
+
}
catch (RuntimeException e)
{
@@ -1000,7 +997,8 @@ public class ServletHandler extends ScopedHandler
mapping.setFilterName(holder.getName());
mapping.setPathSpec(pathSpec);
mapping.setDispatches(dispatches);
- setFilterMappings((FilterMapping[])LazyList.addToArray(getFilterMappings(), mapping, FilterMapping.class));
+ //setFilterMappings((FilterMapping[])LazyList.addToArray(getFilterMappings(), mapping, FilterMapping.class));
+ addFilterMapping(mapping);
}
catch (RuntimeException e)
{
@@ -1039,7 +1037,8 @@ public class ServletHandler extends ScopedHandler
if (filter != null)
setFilters((FilterHolder[])LazyList.addToArray(getFilters(), filter, FilterHolder.class));
if (filterMapping != null)
- setFilterMappings((FilterMapping[])LazyList.addToArray(getFilterMappings(), filterMapping, FilterMapping.class));
+ //setFilterMappings((FilterMapping[])LazyList.addToArray(getFilterMappings(), filterMapping, FilterMapping.class));
+ addFilterMapping(filterMapping);
}
/* ------------------------------------------------------------ */
@@ -1059,9 +1058,43 @@ public class ServletHandler extends ScopedHandler
public void addFilterMapping (FilterMapping mapping)
{
if (mapping != null)
- setFilterMappings((FilterMapping[])LazyList.addToArray(getFilterMappings(), mapping, FilterMapping.class));
+ {
+ Source source = (mapping.getFilterHolder()==null?null:mapping.getFilterHolder().getSource());
+ FilterMapping[] mappings =getFilterMappings();
+ if (mappings==null || mappings.length==0)
+ {
+ setFilterMappings(insertFilterMapping(mapping,0,false));
+ if (source != null && source == Source.JAVAX_API)
+ _matchAfterIndex = 0;
+ }
+ else
+ {
+ //there are existing entries. If this is a programmatic filtermapping, it is added at the end of the list.
+ //If this is a normal filtermapping, it is inserted after all the other filtermappings (matchBefores and normals),
+ //but before the first matchAfter filtermapping.
+ if (source != null && Source.JAVAX_API == source)
+ {
+ setFilterMappings(insertFilterMapping(mapping,mappings.length-1, false));
+ if (_matchAfterIndex < 0)
+ _matchAfterIndex = getFilterMappings().length-1;
+ }
+ else
+ {
+ //insert non-programmatic filter mappings before any matchAfters, if any
+ if (_matchAfterIndex < 0)
+ setFilterMappings(insertFilterMapping(mapping,mappings.length-1, false));
+ else
+ {
+ FilterMapping[] new_mappings = insertFilterMapping(mapping, _matchAfterIndex, true);
+ ++_matchAfterIndex;
+ setFilterMappings(new_mappings);
+ }
+ }
+ }
+ }
}
+
/* ------------------------------------------------------------ */
/** Convenience method to add a preconstructed FilterMapping
* @param mapping
@@ -1070,20 +1103,99 @@ public class ServletHandler extends ScopedHandler
{
if (mapping != null)
{
- FilterMapping[] mappings =getFilterMappings();
+ Source source = mapping.getFilterHolder().getSource();
+
+ FilterMapping[] mappings = getFilterMappings();
if (mappings==null || mappings.length==0)
- setFilterMappings(new FilterMapping[] {mapping});
+ {
+ setFilterMappings(insertFilterMapping(mapping, 0, false));
+ if (source != null && Source.JAVAX_API == source)
+ _matchBeforeIndex = 0;
+ }
else
{
+ if (source != null && Source.JAVAX_API == source)
+ {
+ //programmatically defined filter mappings are prepended to mapping list in the order
+ //in which they were defined. In other words, insert this mapping at the tail of the
+ //programmatically added filter mappings, BEFORE the first web.xml defined filter mapping.
- FilterMapping[] new_mappings=new FilterMapping[mappings.length+1];
- System.arraycopy(mappings,0,new_mappings,1,mappings.length);
- new_mappings[0]=mapping;
- setFilterMappings(new_mappings);
+ if (_matchBeforeIndex < 0)
+ {
+ //no programmatically defined prepended filter mappings yet, prepend this one
+ _matchBeforeIndex = 0;
+ FilterMapping[] new_mappings = insertFilterMapping(mapping, 0, true);
+ setFilterMappings(new_mappings);
+ }
+ else
+ {
+ FilterMapping[] new_mappings = insertFilterMapping(mapping,_matchBeforeIndex, false);
+ ++_matchBeforeIndex;
+ setFilterMappings(new_mappings);
+ }
+ }
+ else
+ {
+ //non programmatically defined, just prepend to list
+ FilterMapping[] new_mappings = insertFilterMapping(mapping, 0, true);
+ setFilterMappings(new_mappings);
+ }
+
+ //adjust matchAfterIndex ptr to take account of the mapping we just prepended
+ if (_matchAfterIndex >= 0)
+ ++_matchAfterIndex;
}
}
}
+
+
+
+ /**
+ * Insert a filtermapping in the list
+ * @param mapping the FilterMapping to add
+ * @param pos the position in the existing arry at which to add it
+ * @param before if true, insert before pos, if false insert after it
+ * @return
+ */
+ protected FilterMapping[] insertFilterMapping (FilterMapping mapping, int pos, boolean before)
+ {
+ if (pos < 0)
+ throw new IllegalArgumentException("FilterMapping insertion pos < 0");
+
+ FilterMapping[] mappings = getFilterMappings();
+ if (mappings==null || mappings.length==0)
+ {
+ return new FilterMapping[] {mapping};
+ }
+ FilterMapping[] new_mappings = new FilterMapping[mappings.length+1];
+ if (before)
+ {
+ //copy existing filter mappings up to but not including the pos
+ System.arraycopy(mappings,0,new_mappings,0,pos);
+
+ //add in the new mapping
+ new_mappings[pos] = mapping;
+
+ //copy the old pos mapping and any remaining existing mappings
+ System.arraycopy(mappings,pos,new_mappings,pos+1, mappings.length-pos);
+
+ }
+ else
+ {
+ //copy existing filter mappings up to and including the pos
+ System.arraycopy(mappings,0,new_mappings,0,pos+1);
+ //add in the new mapping after the pos
+ new_mappings[pos+1] = mapping;
+
+ //copy the remaining existing mappings
+ if (mappings.length > pos+1)
+ System.arraycopy(mappings,pos+1,new_mappings,pos+2, mappings.length-(pos+1));
+ }
+ return new_mappings;
+ }
+
+
/* ------------------------------------------------------------ */
protected synchronized void updateNameMappings()
{
diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java
index d3499f62c13..a3654fcb5e6 100644
--- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java
+++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletMapping.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletMapping.java
index f25000910c7..830e7a992a9 100644
--- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletMapping.java
+++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletMapping.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/StatisticsServlet.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/StatisticsServlet.java
index 329db3c99ab..29dc04bf75a 100644
--- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/StatisticsServlet.java
+++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/StatisticsServlet.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -22,6 +22,8 @@ import java.io.IOException;
import java.io.PrintWriter;
import java.lang.management.ManagementFactory;
import java.lang.management.MemoryMXBean;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -89,7 +91,7 @@ public class StatisticsServlet extends HttpServlet
}
if (_restrictToLocalhost)
{
- if (!"127.0.0.1".equals(req.getRemoteAddr()))
+ if (!isLoopbackAddress(req.getRemoteAddr()))
{
resp.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
return;
@@ -111,6 +113,20 @@ public class StatisticsServlet extends HttpServlet
}
+ private boolean isLoopbackAddress(String address)
+ {
+ try
+ {
+ InetAddress addr = InetAddress.getByName(address);
+ return addr.isLoopbackAddress();
+ }
+ catch (UnknownHostException e )
+ {
+ LOG.warn("Warning: attempt to access statistics servlet from " + address, e);
+ return false;
+ }
+ }
+
private void sendXmlResponse(HttpServletResponse response) throws IOException
{
StringBuilder sb = new StringBuilder();
@@ -132,7 +148,7 @@ public class StatisticsServlet extends HttpServlet
sb.append(" ").append(_statsHandler.getDispatchedActive()).append("\n");
sb.append(" ").append(_statsHandler.getDispatchedActiveMax()).append("\n");
sb.append(" ").append(_statsHandler.getDispatchedTimeTotal()).append("\n");
- sb.append(" \n");
+ sb.append(" ").append(_statsHandler.getDispatchedTimeMean()).append("\n");
sb.append(" ").append(_statsHandler.getDispatchedTimeMax()).append("\n");
sb.append(" \n");
@@ -201,7 +217,7 @@ public class StatisticsServlet extends HttpServlet
{
sb.append("Statistics gathering started ").append(connector.getStatsOnMs()).append("ms ago").append("
\n");
sb.append("Total connections: ").append(connector.getConnections()).append("
\n");
- sb.append("Current connections open: ").append(connector.getConnectionsOpen());
+ sb.append("Current connections open: ").append(connector.getConnectionsOpen()).append("
\n");
sb.append("Max concurrent connections open: ").append(connector.getConnectionsOpenMax()).append("
\n");
sb.append("Total connections duration: ").append(connector.getConnectionsDurationTotal()).append("
\n");
sb.append("Mean connection duration: ").append(connector.getConnectionsDurationMean()).append("
\n");
diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/jmx/FilterMappingMBean.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/jmx/FilterMappingMBean.java
index 19b8377c654..f5659bc9db0 100644
--- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/jmx/FilterMappingMBean.java
+++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/jmx/FilterMappingMBean.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/jmx/HolderMBean.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/jmx/HolderMBean.java
index eaeac4c64c9..8d557de3537 100644
--- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/jmx/HolderMBean.java
+++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/jmx/HolderMBean.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/jmx/ServletMappingMBean.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/jmx/ServletMappingMBean.java
index a6af5b79279..cdc675effa6 100644
--- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/jmx/ServletMappingMBean.java
+++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/jmx/ServletMappingMBean.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/listener/ELContextCleaner.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/listener/ELContextCleaner.java
index 5fab6ed07be..521cfecde72 100644
--- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/listener/ELContextCleaner.java
+++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/listener/ELContextCleaner.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/listener/IntrospectorCleaner.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/listener/IntrospectorCleaner.java
index 21e27463a32..b6c19762767 100644
--- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/listener/IntrospectorCleaner.java
+++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/listener/IntrospectorCleaner.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncContextDispatchWithQueryStrings.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncContextDispatchWithQueryStrings.java
index 8addb683710..6c1d33cfe6e 100644
--- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncContextDispatchWithQueryStrings.java
+++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncContextDispatchWithQueryStrings.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncContextTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncContextTest.java
index a3707b39a69..16270142925 100644
--- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncContextTest.java
+++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncContextTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DefaultServletTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DefaultServletTest.java
index fc211a0b23d..843ec1747f2 100644
--- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DefaultServletTest.java
+++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DefaultServletTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -25,6 +25,8 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.util.EnumSet;
import javax.servlet.DispatcherType;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
@@ -34,14 +36,17 @@ import javax.servlet.ServletResponse;
import junit.framework.AssertionFailedError;
+import org.eclipse.jetty.http.HttpFields;
import org.eclipse.jetty.server.LocalConnector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.toolchain.test.FS;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
import org.eclipse.jetty.toolchain.test.OS;
import org.eclipse.jetty.toolchain.test.TestingDir;
+import org.eclipse.jetty.util.DateCache;
import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.StringUtil;
+import org.hamcrest.Matchers;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
@@ -539,8 +544,64 @@ public class DefaultServletTest
assertResponseContains("Content-Range: bytes 70-79/80", response);
assertResponseContains("Content-Length: " + body.length(), response);
assertTrue(body.endsWith(boundary + "--\r\n"));
+
+ //test a range request with a file with no suffix, therefore no mimetype
+ File nofilesuffix = new File(resBase, "nofilesuffix");
+ createFile(nofilesuffix, "01234567890123456789012345678901234567890123456789012345678901234567890123456789");
+ response = connector.getResponses(
+ "GET /context/nofilesuffix HTTP/1.1\r\n" +
+ "Host: localhost\r\n" +
+ "\r\n");
+ assertResponseContains("200 OK", response);
+ assertResponseContains("Accept-Ranges: bytes", response);
+
+ response = connector.getResponses(
+ "GET /context/nofilesuffix HTTP/1.1\r\n" +
+ "Host: localhost\r\n" +
+ "Range: bytes=0-9\r\n" +
+ "\r\n");
+ assertResponseContains("206 Partial", response);
+ assertResponseContains("Content-Length: 10", response);
+ assertTrue(!response.contains("Content-Type:"));
+ assertResponseContains("Content-Range: bytes 0-9/80", response);
+
+ response = connector.getResponses(
+ "GET /context/nofilesuffix HTTP/1.1\r\n" +
+ "Host: localhost\r\n" +
+ "Range: bytes=0-9,20-29,40-49\r\n" +
+ "\r\n");
+ start = response.indexOf("--jetty");
+ body = response.substring(start);
+ boundary = body.substring(0, body.indexOf("\r\n"));
+ assertResponseContains("206 Partial", response);
+ assertResponseContains("Content-Type: multipart/byteranges; boundary=", response);
+ assertResponseContains("Content-Range: bytes 0-9/80", response);
+ assertResponseContains("Content-Range: bytes 20-29/80", response);
+ assertResponseContains("Content-Length: " + body.length(), response);
+ assertTrue(body.endsWith(boundary + "--\r\n"));
+
+ response = connector.getResponses(
+ "GET /context/nofilesuffix HTTP/1.1\r\n" +
+ "Host: localhost\r\n" +
+ "Range: bytes=0-9,20-29,40-49,60-60,70-79\r\n" +
+ "\r\n");
+ start = response.indexOf("--jetty");
+ body = response.substring(start);
+ boundary = body.substring(0, body.indexOf("\r\n"));
+ assertResponseContains("206 Partial", response);
+ assertResponseContains("Content-Type: multipart/byteranges; boundary=", response);
+ assertResponseContains("Content-Range: bytes 0-9/80", response);
+ assertResponseContains("Content-Range: bytes 20-29/80", response);
+ assertResponseContains("Content-Range: bytes 60-60/80", response);
+ assertResponseContains("Content-Range: bytes 70-79/80", response);
+ assertResponseContains("Content-Length: " + body.length(), response);
+ assertTrue(body.endsWith(boundary + "--\r\n"));
+
}
+
+
+
@Test
public void testFiltered() throws Exception
{
@@ -579,6 +640,159 @@ public class DefaultServletTest
assertResponseNotContains("Content-Length: 12", response);
}
+
+ @Test
+ public void testGzip() throws Exception
+ {
+ testdir.ensureEmpty();
+ File resBase = testdir.getFile("docroot");
+ FS.ensureDirExists(resBase);
+ File file0 = new File(resBase, "data0.txt");
+ createFile(file0, "Hello Text 0");
+ File file0gz = new File(resBase, "data0.txt.gz");
+ createFile(file0gz, "fake gzip");
+
+ String resBasePath = resBase.getAbsolutePath();
+
+ ServletHolder defholder = context.addServlet(DefaultServlet.class, "/");
+ defholder.setInitParameter("dirAllowed", "false");
+ defholder.setInitParameter("redirectWelcome", "false");
+ defholder.setInitParameter("welcomeServlets", "false");
+ defholder.setInitParameter("gzip", "true");
+ defholder.setInitParameter("resourceBase", resBasePath);
+
+ String response = connector.getResponses("GET /context/data0.txt HTTP/1.1\r\nHost:localhost:8080\r\n\r\n");
+ assertResponseContains("Content-Length: 12", response);
+ assertResponseContains("Hello Text 0",response);
+ assertResponseContains("Vary: Accept-Encoding",response);
+ assertResponseNotContains("Content-Encoding: gzip",response);
+
+ response = connector.getResponses("GET /context/data0.txt HTTP/1.1\r\nHost:localhost:8080\r\nAccept-Encoding:gzip\r\n\r\n");
+ assertResponseContains("Content-Length: 9", response);
+ assertResponseContains("fake gzip",response);
+ assertResponseContains("Vary: Accept-Encoding",response);
+ assertResponseContains("Content-Encoding: gzip",response);
+
+ }
+
+
+
+ @Test
+ public void testIfModifiedSmall() throws Exception
+ {
+ testIfModified("Hello World");
+ }
+
+ @Test
+ public void testIfModifiedLarge() throws Exception
+ {
+ testIfModified("Now is the time for all good men to come to the aid of the party");
+ }
+
+ public void testIfModified(String content) throws Exception
+ {
+ testdir.ensureEmpty();
+ File resBase = testdir.getFile("docroot");
+ FS.ensureDirExists(resBase);
+ File file = new File(resBase, "file.txt");
+
+ String resBasePath = resBase.getAbsolutePath();
+
+ ServletHolder defholder = context.addServlet(DefaultServlet.class, "/");
+ defholder.setInitParameter("resourceBase", resBasePath);
+ defholder.setInitParameter("maxCacheSize", "4096");
+ defholder.setInitParameter("maxCachedFileSize", "25");
+ defholder.setInitParameter("maxCachedFiles", "100");
+
+ String response = connector.getResponses("GET /context/file.txt HTTP/1.0\r\n\r\n");
+ assertResponseContains("404", response);
+
+ createFile(file, content);
+ response = connector.getResponses("GET /context/file.txt HTTP/1.1\r\nHost:test\r\nConnection:close\r\n\r\n");
+
+ assertResponseContains("200", response);
+ assertResponseContains("Last-Modified", response);
+ String last_modified = getHeaderValue("Last-Modified",response);
+
+ response = connector.getResponses("GET /context/file.txt HTTP/1.1\r\nHost:test\r\nConnection:close\r\nIf-Modified-Since: "+last_modified+"\r\n\r\n");
+ assertResponseContains("304", response);
+
+ response = connector.getResponses("GET /context/file.txt HTTP/1.1\r\nHost:test\r\nConnection:close\r\nIf-Modified-Since: "+HttpFields.formatDate(System.currentTimeMillis()-10000)+"\r\n\r\n");
+ assertResponseContains("200", response);
+
+ response = connector.getResponses("GET /context/file.txt HTTP/1.1\r\nHost:test\r\nConnection:close\r\nIf-Modified-Since: "+HttpFields.formatDate(System.currentTimeMillis()+10000)+"\r\n\r\n");
+ assertResponseContains("304", response);
+
+ response = connector.getResponses("GET /context/file.txt HTTP/1.1\r\nHost:test\r\nConnection:close\r\nIf-Unmodified-Since: "+HttpFields.formatDate(System.currentTimeMillis()+10000)+"\r\n\r\n");
+ assertResponseContains("200", response);
+
+ response = connector.getResponses("GET /context/file.txt HTTP/1.1\r\nHost:test\r\nConnection:close\r\nIf-Unmodified-Since: "+HttpFields.formatDate(System.currentTimeMillis()-10000)+"\r\n\r\n");
+ assertResponseContains("412", response);
+ }
+
+ @Test
+ public void testIfETagSmall() throws Exception
+ {
+ testIfETag("Hello World");
+ }
+
+ @Test
+ public void testIfETagLarge() throws Exception
+ {
+ testIfETag("Now is the time for all good men to come to the aid of the party");
+ }
+
+ public void testIfETag(String content) throws Exception
+ {
+ testdir.ensureEmpty();
+ File resBase = testdir.getFile("docroot");
+ FS.ensureDirExists(resBase);
+ File file = new File(resBase, "file.txt");
+
+ String resBasePath = resBase.getAbsolutePath();
+
+ ServletHolder defholder = context.addServlet(DefaultServlet.class, "/");
+ defholder.setInitParameter("resourceBase", resBasePath);
+ defholder.setInitParameter("maxCacheSize", "4096");
+ defholder.setInitParameter("maxCachedFileSize", "25");
+ defholder.setInitParameter("maxCachedFiles", "100");
+ defholder.setInitParameter("etags", "true");
+
+ String response;
+
+ createFile(file, content);
+ response = connector.getResponses("GET /context/file.txt HTTP/1.1\r\nHost:test\r\nConnection:close\r\n\r\n");
+
+ assertResponseContains("200", response);
+ assertResponseContains("ETag", response);
+ String etag = getHeaderValue("ETag",response);
+
+ response = connector.getResponses("GET /context/file.txt HTTP/1.1\r\nHost:test\r\nConnection:close\r\nIf-None-Match: "+etag+"\r\n\r\n");
+ assertResponseContains("304", response);
+
+ response = connector.getResponses("GET /context/file.txt HTTP/1.1\r\nHost:test\r\nConnection:close\r\nIf-None-Match: wibble,"+etag+",wobble\r\n\r\n");
+ assertResponseContains("304", response);
+
+ response = connector.getResponses("GET /context/file.txt HTTP/1.1\r\nHost:test\r\nConnection:close\r\nIf-None-Match: wibble\r\n\r\n");
+ assertResponseContains("200", response);
+
+ response = connector.getResponses("GET /context/file.txt HTTP/1.1\r\nHost:test\r\nConnection:close\r\nIf-None-Match: wibble, wobble\r\n\r\n");
+ assertResponseContains("200", response);
+
+ response = connector.getResponses("GET /context/file.txt HTTP/1.1\r\nHost:test\r\nConnection:close\r\nIf-Match: "+etag+"\r\n\r\n");
+ assertResponseContains("200", response);
+
+ response = connector.getResponses("GET /context/file.txt HTTP/1.1\r\nHost:test\r\nConnection:close\r\nIf-Match: wibble,"+etag+",wobble\r\n\r\n");
+ assertResponseContains("200", response);
+
+ response = connector.getResponses("GET /context/file.txt HTTP/1.1\r\nHost:test\r\nConnection:close\r\nIf-Match: wibble\r\n\r\n");
+ assertResponseContains("412", response);
+
+ response = connector.getResponses("GET /context/file.txt HTTP/1.1\r\nHost:test\r\nConnection:close\r\nIf-Match: wibble, wobble\r\n\r\n");
+ assertResponseContains("412", response);
+
+ }
+
public static class OutputFilter implements Filter
{
public void init(FilterConfig filterConfig) throws ServletException
@@ -645,18 +859,8 @@ public class DefaultServletTest
private int assertResponseContains(String expected, String response)
{
- int idx = response.indexOf(expected);
- if (idx == (-1))
- {
- // Not found
- StringBuffer err = new StringBuffer();
- err.append("Response does not contain expected string \"").append(expected).append("\"");
- err.append("\n").append(response);
-
- System.err.println(err);
- throw new AssertionFailedError(err.toString());
- }
- return idx;
+ Assert.assertThat(response,Matchers.containsString(expected));
+ return response.indexOf(expected);
}
private void deleteFile(File file) throws IOException
@@ -681,4 +885,13 @@ public class DefaultServletTest
Assert.assertTrue("Deleting: " + file.getName(), file.delete());
}
}
+
+ private String getHeaderValue(String header, String response)
+ {
+ Pattern pattern=Pattern.compile("[\\r\\n]"+header+"\\s*:\\s*(.*?)\\s*[\\r\\n]");
+ Matcher matcher = pattern.matcher(response);
+ if (matcher.find())
+ return matcher.group(1);
+ return null;
+ }
}
diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DispatcherTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DispatcherTest.java
index c14a9da7f50..781d06defe8 100644
--- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DispatcherTest.java
+++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DispatcherTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/HolderTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/HolderTest.java
index a83882ded00..3b1baed7141 100644
--- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/HolderTest.java
+++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/HolderTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/InvokerTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/InvokerTest.java
index 41067f9b5f2..72d472ff191 100644
--- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/InvokerTest.java
+++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/InvokerTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletContextHandlerTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletContextHandlerTest.java
index 4d0940b521d..b951834c956 100644
--- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletContextHandlerTest.java
+++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletContextHandlerTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletHandlerTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletHandlerTest.java
new file mode 100644
index 00000000000..7fdda2ee929
--- /dev/null
+++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ServletHandlerTest.java
@@ -0,0 +1,425 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
+// ------------------------------------------------------------------------
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// and Apache License v2.0 which accompanies this distribution.
+//
+// The Eclipse Public License is available at
+// http://www.eclipse.org/legal/epl-v10.html
+//
+// The Apache License v2.0 is available at
+// http://www.opensource.org/licenses/apache2.0.php
+//
+// You may elect to redistribute this code under either of these licenses.
+// ========================================================================
+//
+
+package org.eclipse.jetty.servlet;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.EnumSet;
+
+import javax.servlet.DispatcherType;
+
+import org.eclipse.jetty.servlet.Holder.Source;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ServletHandlerTest
+{
+ FilterHolder fh1 = new FilterHolder(Holder.Source.DESCRIPTOR);
+ FilterMapping fm1 = new FilterMapping();
+
+ FilterHolder fh2 = new FilterHolder(Holder.Source.DESCRIPTOR);
+ FilterMapping fm2 = new FilterMapping();
+
+ FilterHolder fh3 = new FilterHolder(Holder.Source.JAVAX_API);
+ FilterMapping fm3 = new FilterMapping();
+
+ FilterHolder fh4 = new FilterHolder(Holder.Source.JAVAX_API);
+ FilterMapping fm4 = new FilterMapping();
+
+ FilterHolder fh5 = new FilterHolder(Holder.Source.JAVAX_API);
+ FilterMapping fm5 = new FilterMapping();
+
+
+
+ @Before
+ public void initMappings()
+ {
+ fh1.setName("fh1");
+ fm1.setPathSpec("/*");
+ fm1.setFilterHolder(fh1);
+
+ fh2.setName("fh2");
+ fm2.setPathSpec("/*");
+ fm2.setFilterHolder(fh2);
+
+ fh3.setName("fh3");
+ fm3.setPathSpec("/*");
+ fm3.setFilterHolder(fh3);
+
+ fh4.setName("fh4");
+ fm4.setPathSpec("/*");
+ fm4.setFilterHolder(fh4);
+
+ fh5.setName("fh5");
+ fm5.setPathSpec("/*");
+ fm5.setFilterHolder(fh5);
+ }
+
+ @Test
+ public void testAllNonProgrammaticFilterMappings() throws Exception
+ {
+ ServletHandler handler = new ServletHandler();
+ handler.addFilter(fh1);
+ handler.addFilter(fh2);
+
+ //add some ordinary filter mappings
+ handler.addFilterMapping(fm1);
+ handler.addFilterMapping(fm2);
+
+ FilterMapping[] mappings = handler.getFilterMappings();
+ assertNotNull(mappings);
+ assertTrue(fm1 == mappings[0]);
+ assertTrue(fm2 == mappings[1]);
+
+ //add another ordinary mapping
+ FilterHolder of1 = new FilterHolder(Source.DESCRIPTOR);
+ FilterMapping ofm1 = new FilterMapping();
+ ofm1.setFilterHolder(of1);
+ ofm1.setPathSpec("/*");
+ handler.addFilter(of1);
+ handler.addFilterMapping(ofm1);
+
+ mappings = handler.getFilterMappings();
+ assertNotNull(mappings);
+ assertTrue(fm1 == mappings[0]);
+ assertTrue(fm2 == mappings[1]);
+ assertTrue(ofm1 == mappings[2]);
+ }
+
+
+
+ @Test
+ public void testAllBeforeFilterMappings() throws Exception
+ {
+ ServletHandler handler = new ServletHandler();
+
+ //do equivalent of FilterRegistration.addMappingForUrlPatterns(isMatchAfter=false)
+ handler.addFilter(fh4);
+ handler.prependFilterMapping(fm4);
+
+ FilterMapping[] mappings = handler.getFilterMappings();
+ assertNotNull(mappings);
+ assertEquals(1, mappings.length);
+
+ //add another with isMatchAfter=false
+ handler.addFilter(fh5);
+ handler.prependFilterMapping(fm5);
+
+ mappings = handler.getFilterMappings();
+ assertNotNull(mappings);
+ assertEquals(2, mappings.length);
+
+ assertTrue(fm4 == mappings[0]);
+ assertTrue(fm5 == mappings[1]);
+ }
+
+ @Test
+ public void testAllAfterFilterMappings() throws Exception
+ {
+ ServletHandler handler = new ServletHandler();
+ //do equivalent of FilterRegistration.addMappingForUrlPatterns(isMatchAfter=true)
+ handler.addFilter(fh4);
+ handler.addFilterMapping(fm4);
+ FilterMapping[] mappings = handler.getFilterMappings();
+ assertEquals(1, mappings.length);
+ assertTrue(fm4 == mappings[0]);
+
+ //do equivalent of FilterRegistration.addMappingForUrlPatterns(isMatchAfter=true)
+ handler.addFilter(fh5);
+ handler.addFilterMapping(fm5);
+ mappings = handler.getFilterMappings();
+ assertEquals(2, mappings.length);
+ assertTrue(fm4 == mappings[0]);
+ assertTrue(fm5 == mappings[1]);
+ }
+
+
+ @Test
+ public void testMatchAfterAndBefore() throws Exception
+ {
+ ServletHandler handler = new ServletHandler();
+
+ //add a programmatic one, isMatchAfter=true
+ handler.addFilter(fh3);
+ handler.addFilterMapping(fm3);
+ FilterMapping[] mappings = handler.getFilterMappings();
+ assertNotNull(mappings);
+ assertEquals(1, mappings.length);
+ assertTrue(fm3 == mappings[0]);
+
+ //add a programmatic one, isMatchAfter=false
+ handler.addFilter(fh4);
+ handler.prependFilterMapping(fm4);
+ mappings = handler.getFilterMappings();
+ assertNotNull(mappings);
+ assertEquals(2, mappings.length);
+ assertTrue(fm4 == mappings[0]);
+ assertTrue(fm3 == mappings[1]);
+ }
+
+
+ @Test
+ public void testMatchBeforeAndAfter() throws Exception
+ {
+ ServletHandler handler = new ServletHandler();
+
+ //add a programmatic one, isMatchAfter=false
+ handler.addFilter(fh3);
+ handler.prependFilterMapping(fm3);
+ FilterMapping[] mappings = handler.getFilterMappings();
+ assertNotNull(mappings);
+ assertEquals(1, mappings.length);
+ assertTrue(fm3 == mappings[0]);
+
+ //add a programmatic one, isMatchAfter=true
+ handler.addFilter(fh4);
+ handler.addFilterMapping(fm4);
+ mappings = handler.getFilterMappings();
+ assertNotNull(mappings);
+ assertEquals(2, mappings.length);
+ assertTrue(fm3 == mappings[0]);
+ assertTrue(fm4 == mappings[1]);
+ }
+
+
+ @Test
+ public void testExistingFilterMappings() throws Exception
+ {
+ ServletHandler handler = new ServletHandler();
+ handler.addFilter(fh1);
+ handler.addFilter(fh2);
+
+ //add some ordinary filter mappings first
+ handler.addFilterMapping(fm1);
+ handler.addFilterMapping(fm2);
+
+ FilterMapping[] mappings = handler.getFilterMappings();
+ assertNotNull(mappings);
+ assertTrue(fm1 == mappings[0]);
+ assertTrue(fm2 == mappings[1]);
+
+ //do equivalent of FilterRegistration.addMappingForUrlPatterns(isMatchAfter=false)
+ handler.addFilter(fh4);
+ handler.prependFilterMapping(fm4);
+ mappings = handler.getFilterMappings();
+ assertEquals(3, mappings.length);
+ assertTrue(fm4 == mappings[0]);
+
+ //do equivalent of FilterRegistration.addMappingForUrlPatterns(isMatchAfter=true)
+ handler.addFilter(fh5);
+ handler.addFilterMapping(fm5);
+ mappings = handler.getFilterMappings();
+ assertEquals(4, mappings.length);
+ assertTrue(fm5 == mappings[mappings.length-1]);
+ }
+
+ @Test
+ public void testFilterMappingsMix() throws Exception
+ {
+ ServletHandler handler = new ServletHandler();
+
+ //add a non-programmatic one to begin with
+ handler.addFilter(fh1);
+ handler.addFilterMapping(fm1);
+ FilterMapping[] mappings = handler.getFilterMappings();
+ assertNotNull(mappings);
+ assertTrue(fm1 == mappings[0]);
+
+ //add a programmatic one, isMatchAfter=false
+ handler.addFilter(fh4);
+ handler.prependFilterMapping(fm4);
+ mappings = handler.getFilterMappings();
+ assertNotNull(mappings);
+ assertEquals(2, mappings.length);
+ assertTrue(fm4 == mappings[0]);
+ assertTrue(fm1 == mappings[1]);
+
+ //add a programmatic one, isMatchAfter=true
+ handler.addFilter(fh3);
+ handler.addFilterMapping(fm3);
+ mappings = handler.getFilterMappings();
+ assertNotNull(mappings);
+ assertEquals(3, mappings.length);
+ assertTrue(fm4 == mappings[0]);
+ assertTrue(fm1 == mappings[1]);
+ assertTrue(fm3 == mappings[2]);
+
+ //add a programmatic one, isMatchAfter=false
+ handler.addFilter(fh5);
+ handler.prependFilterMapping(fm5);
+ mappings = handler.getFilterMappings();
+ assertNotNull(mappings);
+ assertEquals(4, mappings.length);
+ assertTrue(fm4 == mappings[0]);//isMatchAfter = false;
+ assertTrue(fm5 == mappings[1]);//isMatchAfter = false;
+ assertTrue(fm1 == mappings[2]);//ordinary
+ assertTrue(fm3 == mappings[3]);//isMatchAfter = true;
+
+ //add a non-programmatic one
+ FilterHolder f = new FilterHolder(Source.EMBEDDED);
+ f.setName("non-programmatic");
+ FilterMapping fm = new FilterMapping();
+ fm.setFilterHolder(f);
+ fm.setPathSpec("/*");
+ handler.addFilter(f);
+ handler.addFilterMapping(fm);
+ mappings = handler.getFilterMappings();
+ assertNotNull(mappings);
+ assertEquals(5, mappings.length);
+ assertTrue(fm4 == mappings[0]); //isMatchAfter = false;
+ assertTrue(fm5 == mappings[1]); //isMatchAfter = false;
+ assertTrue(fm1 == mappings[2]); //ordinary
+ assertTrue(fm == mappings[3]); //ordinary
+ assertTrue(fm3 == mappings[4]); //isMatchAfter = true;
+
+ //add a programmatic one, isMatchAfter=true
+ FilterHolder pf = new FilterHolder(Source.JAVAX_API);
+ pf.setName("programmaticA");
+ FilterMapping pfm = new FilterMapping();
+ pfm.setFilterHolder(pf);
+ pfm.setPathSpec("/*");
+ handler.addFilter(pf);
+ handler.addFilterMapping(pfm);
+ mappings = handler.getFilterMappings();
+ assertNotNull(mappings);
+ assertEquals(6, mappings.length);
+ assertTrue(fm4 == mappings[0]); //isMatchAfter = false;
+ assertTrue(fm5 == mappings[1]); //isMatchAfter = false;
+ assertTrue(fm1 == mappings[2]); //ordinary
+ assertTrue(fm == mappings[3]); //ordinary
+ assertTrue(fm3 == mappings[4]); //isMatchAfter = true;
+ assertTrue(pfm == mappings[5]); //isMatchAfter = true;
+
+ //add a programmatic one, isMatchAfter=false
+ FilterHolder pf2 = new FilterHolder(Source.JAVAX_API);
+ pf2.setName("programmaticB");
+ FilterMapping pfm2 = new FilterMapping();
+ pfm2.setFilterHolder(pf2);
+ pfm2.setPathSpec("/*");
+ handler.addFilter(pf2);
+ handler.prependFilterMapping(pfm2);
+ mappings = handler.getFilterMappings();
+ assertNotNull(mappings);
+ assertEquals(7, mappings.length);
+ assertTrue(fm4 == mappings[0]); //isMatchAfter = false;
+ assertTrue(fm5 == mappings[1]); //isMatchAfter = false;
+ assertTrue(pfm2 == mappings[2]);//isMatchAfter = false;
+ assertTrue(fm1 == mappings[3]); //ordinary
+ assertTrue(fm == mappings[4]); //ordinary
+ assertTrue(fm3 == mappings[5]); //isMatchAfter = true;
+ assertTrue(pfm == mappings[6]); //isMatchAfter = true;
+ }
+
+ @Test
+ public void testAddFilterWithMappingAPI() throws Exception
+ {
+ ServletHandler handler = new ServletHandler();
+
+ //add a non-programmatic one to begin with
+ handler.addFilterWithMapping(fh1, "/*", EnumSet.allOf(DispatcherType.class));
+ FilterMapping[] mappings = handler.getFilterMappings();
+ assertNotNull(mappings);
+ assertTrue(fh1 == mappings[0].getFilterHolder());
+
+ //add a programmatic one, isMatchAfter=false
+ fh4.setServletHandler(handler);
+ handler.addFilter(fh4);
+ fh4.getRegistration().addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), false, "/*");
+ mappings = handler.getFilterMappings();
+ assertNotNull(mappings);
+ assertEquals(2, mappings.length);
+ assertTrue(fh4 == mappings[0].getFilterHolder());
+ assertTrue(fh1 == mappings[1].getFilterHolder());
+
+ //add a programmatic one, isMatchAfter=true
+ fh3.setServletHandler(handler);
+ handler.addFilter(fh3);
+ fh3.getRegistration().addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, "/*");
+ mappings = handler.getFilterMappings();
+ assertNotNull(mappings);
+ assertEquals(3, mappings.length);
+ assertTrue(fh4 == mappings[0].getFilterHolder());
+ assertTrue(fh1 == mappings[1].getFilterHolder());
+ assertTrue(fh3 == mappings[2].getFilterHolder());
+
+ //add a programmatic one, isMatchAfter=false
+ fh5.setServletHandler(handler);
+ handler.addFilter(fh5);
+ fh5.getRegistration().addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), false, "/*");
+ mappings = handler.getFilterMappings();
+ assertNotNull(mappings);
+ assertEquals(4, mappings.length);
+ assertTrue(fh4 == mappings[0].getFilterHolder());//isMatchAfter = false;
+ assertTrue(fh5 == mappings[1].getFilterHolder());//isMatchAfter = false;
+ assertTrue(fh1 == mappings[2].getFilterHolder());//ordinary
+ assertTrue(fh3 == mappings[3].getFilterHolder());//isMatchAfter = true;
+
+ //add a non-programmatic one
+ FilterHolder f = new FilterHolder(Source.EMBEDDED);
+ f.setName("non-programmatic");
+ handler.addFilterWithMapping(f, "/*", EnumSet.allOf(DispatcherType.class));
+ mappings = handler.getFilterMappings();
+ assertNotNull(mappings);
+ assertEquals(5, mappings.length);
+ assertTrue(fh4 == mappings[0].getFilterHolder()); //isMatchAfter = false;
+ assertTrue(fh5 == mappings[1].getFilterHolder()); //isMatchAfter = false;
+ assertTrue(fh1 == mappings[2].getFilterHolder()); //ordinary
+ assertTrue(f == mappings[3].getFilterHolder()); //ordinary
+ assertTrue(fh3 == mappings[4].getFilterHolder()); //isMatchAfter = true;
+
+ //add a programmatic one, isMatchAfter=true
+ FilterHolder pf = new FilterHolder(Source.JAVAX_API);
+ pf.setServletHandler(handler);
+ pf.setName("programmaticA");
+ handler.addFilter(pf);
+ pf.getRegistration().addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, "/*");
+ mappings = handler.getFilterMappings();
+ assertNotNull(mappings);
+ assertEquals(6, mappings.length);
+ assertTrue(fh4 == mappings[0].getFilterHolder()); //isMatchAfter = false;
+ assertTrue(fh5 == mappings[1].getFilterHolder()); //isMatchAfter = false;
+ assertTrue(fh1 == mappings[2].getFilterHolder()); //ordinary
+ assertTrue(f == mappings[3].getFilterHolder()); //ordinary
+ assertTrue(fh3 == mappings[4].getFilterHolder()); //isMatchAfter = true;
+ assertTrue(pf == mappings[5].getFilterHolder()); //isMatchAfter = true;
+
+ //add a programmatic one, isMatchAfter=false
+ FilterHolder pf2 = new FilterHolder(Source.JAVAX_API);
+ pf2.setServletHandler(handler);
+ pf2.setName("programmaticB");
+ handler.addFilter(pf2);
+ pf2.getRegistration().addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), false, "/*");
+ mappings = handler.getFilterMappings();
+
+ assertNotNull(mappings);
+ assertEquals(7, mappings.length);
+ assertTrue(fh4 == mappings[0].getFilterHolder()); //isMatchAfter = false;
+ assertTrue(fh5 == mappings[1].getFilterHolder()); //isMatchAfter = false;
+ assertTrue(pf2 == mappings[2].getFilterHolder());//isMatchAfter = false;
+ assertTrue(fh1 == mappings[3].getFilterHolder()); //ordinary
+ assertTrue(f == mappings[4].getFilterHolder()); //ordinary
+ assertTrue(fh3 == mappings[5].getFilterHolder()); //isMatchAfter = true;
+ assertTrue(pf == mappings[6].getFilterHolder()); //isMatchAfter = true;
+ }
+
+
+
+}
diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/StatisticsServletTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/StatisticsServletTest.java
index fddd6e5bc62..5148e06c693 100644
--- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/StatisticsServletTest.java
+++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/StatisticsServletTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/BalancerServlet.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/BalancerServlet.java
index 5caee134259..f848d076868 100644
--- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/BalancerServlet.java
+++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/BalancerServlet.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CGI.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CGI.java
index 4c625088b7b..c7b2b4f1fb7 100644
--- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CGI.java
+++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CGI.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CloseableDoSFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CloseableDoSFilter.java
index 3ebdfe00161..9aea5aa0eb4 100644
--- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CloseableDoSFilter.java
+++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CloseableDoSFilter.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/ConcatServlet.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/ConcatServlet.java
index 28869221218..31547aeaf58 100644
--- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/ConcatServlet.java
+++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/ConcatServlet.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CrossOriginFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CrossOriginFilter.java
index db094b80952..d2ab1013310 100644
--- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CrossOriginFilter.java
+++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CrossOriginFilter.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java
index 1a7b25ed4f9..be3517d6efd 100644
--- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java
+++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java
index 27c930b2045..7452641d5ff 100644
--- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java
+++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -30,11 +30,14 @@ import java.util.zip.GZIPOutputStream;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
+import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
+import javax.servlet.ServletResponseWrapper;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletResponseWrapper;
import org.eclipse.jetty.continuation.Continuation;
import org.eclipse.jetty.continuation.ContinuationListener;
@@ -42,6 +45,7 @@ import org.eclipse.jetty.continuation.ContinuationSupport;
import org.eclipse.jetty.http.HttpMethods;
import org.eclipse.jetty.http.gzip.CompressedResponseWrapper;
import org.eclipse.jetty.http.gzip.AbstractCompressedStream;
+import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
@@ -100,15 +104,24 @@ import org.eclipse.jetty.util.log.Logger;
* instead.
*
* excludePathPatterns Same as excludePath, but accepts regex patterns for more complex matching.
+ *
+ * vary Set to the value of the Vary header sent with responses that could be compressed. By default it is
+ * set to 'Vary: Accept-Encoding, User-Agent' since IE6 is excluded by default from the excludedAgents.
+ * If user-agents are not to be excluded, then this can be set to 'Vary: Accept-Encoding'. Note also
+ * that shared caches may cache copies of a resource that is varied by User-Agent - one per variation of
+ * the User-Agent, unless the cache does some normalization of the UA string.
*
*/
public class GzipFilter extends UserAgentFilter
{
private static final Logger LOG = Log.getLogger(GzipFilter.class);
public final static String GZIP="gzip";
+ public final static String ETAG_GZIP="--gzip\"";
public final static String DEFLATE="deflate";
-
+ public final static String ETAG_DEFLATE="--deflate\"";
+ public final static String ETAG="o.e.j.s.GzipFilter.ETag";
+ protected ServletContext _context;
protected Set _mimeTypes;
protected int _bufferSize=8192;
protected int _minGzipSize=256;
@@ -118,6 +131,7 @@ public class GzipFilter extends UserAgentFilter
protected Set _excludedAgentPatterns;
protected Set _excludedPaths;
protected Set _excludedPathPatterns;
+ protected String _vary="Accept-Encoding, User-Agent";
private static final int STATE_SEPARATOR = 0;
private static final int STATE_Q = 1;
@@ -134,6 +148,8 @@ public class GzipFilter extends UserAgentFilter
{
super.init(filterConfig);
+ _context=filterConfig.getServletContext();
+
String tmp=filterConfig.getInitParameter("bufferSize");
if (tmp!=null)
_bufferSize=Integer.parseInt(tmp);
@@ -193,6 +209,10 @@ public class GzipFilter extends UserAgentFilter
while (tok.hasMoreTokens())
_excludedPathPatterns.add(Pattern.compile(tok.nextToken()));
}
+
+ tmp=filterConfig.getInitParameter("vary");
+ if (tmp!=null)
+ _vary=tmp;
}
/* ------------------------------------------------------------ */
@@ -214,54 +234,66 @@ public class GzipFilter extends UserAgentFilter
{
HttpServletRequest request=(HttpServletRequest)req;
HttpServletResponse response=(HttpServletResponse)res;
-
- // Inform caches that responses may vary according to Accept-Encoding
- response.setHeader("Vary","Accept-Encoding");
- // Should we vary this response according to Accept-Encoding
- String compressionType = selectCompression(request.getHeader("accept-encoding"));
- if (compressionType!=null && !response.containsHeader("Content-Encoding") && !HttpMethods.HEAD.equalsIgnoreCase(request.getMethod()))
- {
- String ua = getUserAgent(request);
- if (isExcludedAgent(ua))
- {
- super.doFilter(request,response,chain);
- return;
- }
- String requestURI = request.getRequestURI();
- if (isExcludedPath(requestURI))
- {
- super.doFilter(request,response,chain);
- return;
- }
-
- CompressedResponseWrapper wrappedResponse = createWrappedResponse(request,response,compressionType);
-
- boolean exceptional=true;
- try
- {
- super.doFilter(request,wrappedResponse,chain);
- exceptional=false;
- }
- finally
- {
- Continuation continuation = ContinuationSupport.getContinuation(request);
- if (continuation.isSuspended() && continuation.isResponseWrapped())
- {
- continuation.addContinuationListener(new ContinuationListenerWaitingForWrappedResponseToFinish(wrappedResponse));
- }
- else if (exceptional && !response.isCommitted())
- {
- wrappedResponse.resetBuffer();
- wrappedResponse.noCompression();
- }
- else
- wrappedResponse.finish();
- }
- }
- else
+ // If not a GET or an Excluded URI - no Vary because no matter what client, this URI is always excluded
+ String requestURI = request.getRequestURI();
+ if (!HttpMethods.GET.equalsIgnoreCase(request.getMethod()) || isExcludedPath(requestURI))
{
super.doFilter(request,response,chain);
+ return;
+ }
+
+ // Exclude non compressible mime-types known from URI extension. - no Vary because no matter what client, this URI is always excluded
+ if (_mimeTypes!=null && _mimeTypes.size()>0)
+ {
+ String mimeType = _context.getMimeType(request.getRequestURI());
+
+ if (mimeType!=null && !_mimeTypes.contains(mimeType))
+ {
+ // handle normally without setting vary header
+ super.doFilter(request,response,chain);
+ return;
+ }
+ }
+
+ // Excluded User-Agents
+ String ua = getUserAgent(request);
+ boolean ua_excluded=ua!=null&&isExcludedAgent(ua);
+
+ // Acceptable compression type
+ String compressionType = ua_excluded?null:selectCompression(request.getHeader("accept-encoding"));
+
+ // Special handling for etags
+ String etag = request.getHeader("If-None-Match");
+ if (etag!=null)
+ {
+ int dd=etag.indexOf("--");
+ if (dd>0)
+ request.setAttribute(ETAG,etag.substring(0,dd)+(etag.endsWith("\"")?"\"":""));
+ }
+
+ CompressedResponseWrapper wrappedResponse = createWrappedResponse(request,response,compressionType);
+
+ boolean exceptional=true;
+ try
+ {
+ super.doFilter(request,wrappedResponse,chain);
+ exceptional=false;
+ }
+ finally
+ {
+ Continuation continuation = ContinuationSupport.getContinuation(request);
+ if (continuation.isSuspended() && continuation.isResponseWrapped())
+ {
+ continuation.addContinuationListener(new ContinuationListenerWaitingForWrappedResponseToFinish(wrappedResponse));
+ }
+ else if (exceptional && !response.isCommitted())
+ {
+ wrappedResponse.resetBuffer();
+ wrappedResponse.noCompression();
+ }
+ else
+ wrappedResponse.finish();
}
}
@@ -357,14 +389,32 @@ public class GzipFilter extends UserAgentFilter
protected CompressedResponseWrapper createWrappedResponse(HttpServletRequest request, HttpServletResponse response, final String compressionType)
{
CompressedResponseWrapper wrappedResponse = null;
- if (compressionType.equals(GZIP))
+ if (compressionType==null)
{
wrappedResponse = new CompressedResponseWrapper(request,response)
{
@Override
- protected AbstractCompressedStream newCompressedStream(HttpServletRequest request,HttpServletResponse response,long contentLength,int bufferSize, int minCompressSize) throws IOException
+ protected AbstractCompressedStream newCompressedStream(HttpServletRequest request,HttpServletResponse response) throws IOException
{
- return new AbstractCompressedStream(compressionType,request,response,contentLength,bufferSize,minCompressSize)
+ return new AbstractCompressedStream(null,request,this,_vary)
+ {
+ @Override
+ protected DeflaterOutputStream createStream() throws IOException
+ {
+ return null;
+ }
+ };
+ }
+ };
+ }
+ else if (compressionType.equals(GZIP))
+ {
+ wrappedResponse = new CompressedResponseWrapper(request,response)
+ {
+ @Override
+ protected AbstractCompressedStream newCompressedStream(HttpServletRequest request,HttpServletResponse response) throws IOException
+ {
+ return new AbstractCompressedStream(compressionType,request,this,_vary)
{
@Override
protected DeflaterOutputStream createStream() throws IOException
@@ -380,9 +430,9 @@ public class GzipFilter extends UserAgentFilter
wrappedResponse = new CompressedResponseWrapper(request,response)
{
@Override
- protected AbstractCompressedStream newCompressedStream(HttpServletRequest request,HttpServletResponse response,long contentLength,int bufferSize, int minCompressSize) throws IOException
+ protected AbstractCompressedStream newCompressedStream(HttpServletRequest request,HttpServletResponse response) throws IOException
{
- return new AbstractCompressedStream(compressionType,request,response,contentLength,bufferSize,minCompressSize)
+ return new AbstractCompressedStream(compressionType,request,this,_vary)
{
@Override
protected DeflaterOutputStream createStream() throws IOException
@@ -392,7 +442,7 @@ public class GzipFilter extends UserAgentFilter
};
}
};
- }
+ }
else
{
throw new IllegalStateException(compressionType + " not supported");
@@ -408,8 +458,8 @@ public class GzipFilter extends UserAgentFilter
wrappedResponse.setMinCompressSize(_minGzipSize);
}
- private class ContinuationListenerWaitingForWrappedResponseToFinish implements ContinuationListener{
-
+ private class ContinuationListenerWaitingForWrappedResponseToFinish implements ContinuationListener
+ {
private CompressedResponseWrapper wrappedResponse;
public ContinuationListenerWaitingForWrappedResponseToFinish(CompressedResponseWrapper wrappedResponse)
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/IncludableGzipFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/IncludableGzipFilter.java
index c589d5c4419..5ba2be0022f 100644
--- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/IncludableGzipFilter.java
+++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/IncludableGzipFilter.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -70,14 +70,41 @@ public class IncludableGzipFilter extends GzipFilter
protected CompressedResponseWrapper createWrappedResponse(HttpServletRequest request, HttpServletResponse response, final String compressionType)
{
CompressedResponseWrapper wrappedResponse = null;
- if (compressionType.equals(GZIP))
+ if (compressionType==null)
{
wrappedResponse = new IncludableResponseWrapper(request,response)
{
@Override
- protected AbstractCompressedStream newCompressedStream(HttpServletRequest request,HttpServletResponse response,long contentLength,int bufferSize, int minCompressSize) throws IOException
+ protected AbstractCompressedStream newCompressedStream(HttpServletRequest request,HttpServletResponse response) throws IOException
{
- return new AbstractCompressedStream(compressionType,request,response,contentLength,bufferSize,minCompressSize)
+ return new AbstractCompressedStream(null,request,this,_vary)
+ {
+ @Override
+ protected DeflaterOutputStream createStream() throws IOException
+ {
+ return null;
+ }
+
+ @Override
+ protected void setHeader(String name, String value)
+ {
+ super.setHeader(name, value);
+ HttpServletResponse response = (HttpServletResponse)getResponse();
+ if (!response.containsHeader(name))
+ response.setHeader("org.eclipse.jetty.server.include." + name, value);
+ }
+ };
+ }
+ };
+ }
+ else if (compressionType.equals(GZIP))
+ {
+ wrappedResponse = new IncludableResponseWrapper(request,response)
+ {
+ @Override
+ protected AbstractCompressedStream newCompressedStream(HttpServletRequest request,HttpServletResponse response) throws IOException
+ {
+ return new AbstractCompressedStream(compressionType,request,this,_vary)
{
@Override
protected DeflaterOutputStream createStream() throws IOException
@@ -102,9 +129,9 @@ public class IncludableGzipFilter extends GzipFilter
wrappedResponse = new IncludableResponseWrapper(request,response)
{
@Override
- protected AbstractCompressedStream newCompressedStream(HttpServletRequest request,HttpServletResponse response,long contentLength,int bufferSize, int minCompressSize) throws IOException
+ protected AbstractCompressedStream newCompressedStream(HttpServletRequest request,HttpServletResponse response) throws IOException
{
- return new AbstractCompressedStream(compressionType,request,response,contentLength,bufferSize,minCompressSize)
+ return new AbstractCompressedStream(compressionType,request,this,_vary)
{
@Override
protected DeflaterOutputStream createStream() throws IOException
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/MultiPartFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/MultiPartFilter.java
index d466de34644..976fc5aa6d8 100644
--- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/MultiPartFilter.java
+++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/MultiPartFilter.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -56,7 +56,8 @@ import org.eclipse.jetty.util.MultiMap;
import org.eclipse.jetty.util.MultiPartInputStream;
import org.eclipse.jetty.util.QuotedStringTokenizer;
import org.eclipse.jetty.util.StringUtil;
-import org.eclipse.jetty.util.TypeUtil;
+import org.eclipse.jetty.util.log.Log;
+import org.eclipse.jetty.util.log.Logger;
/* ------------------------------------------------------------ */
/**
@@ -84,6 +85,7 @@ import org.eclipse.jetty.util.TypeUtil;
*/
public class MultiPartFilter implements Filter
{
+ private static final Logger LOG = Log.getLogger(MultiPartFilter.class);
public final static String CONTENT_TYPE_SUFFIX=".org.eclipse.jetty.servlet.contentType";
private final static String MULTIPART = "org.eclipse.jetty.servlet.MultiPartFile.multiPartInputStream";
private File tempdir;
@@ -132,7 +134,7 @@ public class MultiPartFilter implements Filter
chain.doFilter(request,response);
return;
}
-
+
InputStream in = new BufferedInputStream(request.getInputStream());
String content_type=srequest.getContentType();
@@ -215,12 +217,7 @@ public class MultiPartFilter implements Filter
request.removeAttribute(MULTIPART);
}
- /* ------------------------------------------------------------ */
- private String value(String nameEqualsValue)
- {
- return nameEqualsValue.substring(nameEqualsValue.indexOf('=')+1).trim();
- }
-
+
/* ------------------------------------------------------------------------------- */
/**
* @see javax.servlet.Filter#destroy()
@@ -291,11 +288,12 @@ public class MultiPartFilter implements Filter
@Override
public Map getParameterMap()
{
- Map cmap = new HashMap();
+ Map cmap = new HashMap();
for ( Object key : _params.keySet() )
{
- cmap.put((String)key,getParameter((String)key));
+ String[] a = LazyList.toStringArray(getParameter((String)key));
+ cmap.put((String)key,a);
}
return Collections.unmodifiableMap(cmap);
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/ProxyServlet.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/ProxyServlet.java
index 46fc4823a59..6bdbae7be25 100644
--- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/ProxyServlet.java
+++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/ProxyServlet.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -527,7 +527,7 @@ public class ProxyServlet implements Servlet
if (ex instanceof EofException)
{
_log.ignore(ex);
- return;
+ //return;
}
handleOnException(ex,request,response);
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/PutFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/PutFilter.java
index 1804b195005..6279c56367a 100644
--- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/PutFilter.java
+++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/PutFilter.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/QoSFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/QoSFilter.java
index baf7d818efa..103bfbc7828 100644
--- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/QoSFilter.java
+++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/QoSFilter.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/UserAgentFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/UserAgentFilter.java
index dfdbc02b318..4ccfecb289a 100644
--- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/UserAgentFilter.java
+++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/UserAgentFilter.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/WelcomeFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/WelcomeFilter.java
index 062bc3dc149..4e8c8bb112d 100644
--- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/WelcomeFilter.java
+++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/WelcomeFilter.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/AbstractBalancerServletTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/AbstractBalancerServletTest.java
index 0791a423225..4c010a4f939 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/AbstractBalancerServletTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/AbstractBalancerServletTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/AbstractDoSFilterTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/AbstractDoSFilterTest.java
index 483cd590346..5dc0b1bc5a7 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/AbstractDoSFilterTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/AbstractDoSFilterTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/AsyncProxyServer.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/AsyncProxyServer.java
index 30ea8865aea..cc07c6119c0 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/AsyncProxyServer.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/AsyncProxyServer.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/BalancerServletTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/BalancerServletTest.java
index 03e83567fb8..a492e994132 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/BalancerServletTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/BalancerServletTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/CloseableDoSFilterTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/CloseableDoSFilterTest.java
index 4203e6a91d7..4d38d7255f0 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/CloseableDoSFilterTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/CloseableDoSFilterTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/CrossOriginFilterTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/CrossOriginFilterTest.java
index faad9b61467..8d96e836bf1 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/CrossOriginFilterTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/CrossOriginFilterTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/DoSFilterTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/DoSFilterTest.java
index 9bfb3acadb5..2542d95b0cf 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/DoSFilterTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/DoSFilterTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipFilterContentLengthTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipFilterContentLengthTest.java
index c259b74741a..7878e74fc81 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipFilterContentLengthTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipFilterContentLengthTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipFilterDefaultNoRecompressTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipFilterDefaultNoRecompressTest.java
index 9cadebba236..0eee233bad7 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipFilterDefaultNoRecompressTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipFilterDefaultNoRecompressTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipFilterDefaultTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipFilterDefaultTest.java
index 04bbe5cc0e7..b9dc78d8226 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipFilterDefaultTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipFilterDefaultTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -27,11 +27,14 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import junit.framework.Assert;
+
import org.eclipse.jetty.http.HttpStatus;
import org.eclipse.jetty.http.gzip.CompressedResponseWrapper;
import org.eclipse.jetty.servlet.DefaultServlet;
import org.eclipse.jetty.servlet.FilterHolder;
import org.eclipse.jetty.servlets.gzip.GzipTester;
+import org.eclipse.jetty.testing.HttpTester;
import org.eclipse.jetty.toolchain.test.TestingDir;
import org.junit.Rule;
import org.junit.Test;
@@ -115,7 +118,8 @@ public class GzipFilterDefaultTest
try
{
tester.start();
- tester.assertIsResponseGzipCompressed("file.txt");
+ HttpTester http = tester.assertIsResponseGzipCompressed("file.txt");
+ Assert.assertEquals("Accept-Encoding",http.getHeader("Vary"));
}
finally
{
@@ -138,7 +142,8 @@ public class GzipFilterDefaultTest
try
{
tester.start();
- tester.assertIsResponseGzipCompressed("file.txt");
+ HttpTester http = tester.assertIsResponseGzipCompressed("file.txt");
+ Assert.assertEquals("Accept-Encoding",http.getHeader("Vary"));
}
finally
{
@@ -161,7 +166,8 @@ public class GzipFilterDefaultTest
try
{
tester.start();
- tester.assertIsResponseGzipCompressed("file.txt");
+ HttpTester http = tester.assertIsResponseGzipCompressed("file.txt");
+ Assert.assertEquals("Accept-Encoding",http.getHeader("Vary"));
}
finally
{
@@ -184,7 +190,8 @@ public class GzipFilterDefaultTest
try
{
tester.start();
- tester.assertIsResponseGzipCompressed("file.txt");
+ HttpTester http = tester.assertIsResponseGzipCompressed("file.txt");
+ Assert.assertEquals("Accept-Encoding",http.getHeader("Vary"));
}
finally
{
@@ -206,7 +213,8 @@ public class GzipFilterDefaultTest
try
{
tester.start();
- tester.assertIsResponseNotGzipCompressed("file.txt", filesize, HttpStatus.OK_200);
+ HttpTester http = tester.assertIsResponseNotGzipCompressed("file.txt", filesize, HttpStatus.OK_200);
+ Assert.assertEquals("Accept-Encoding",http.getHeader("Vary"));
}
finally
{
@@ -219,7 +227,6 @@ public class GzipFilterDefaultTest
{
GzipTester tester = new GzipTester(testingdir, compressionType);
- // Test content that is smaller than the buffer.
int filesize = CompressedResponseWrapper.DEFAULT_BUFFER_SIZE * 4;
tester.prepareServerFile("file.mp3",filesize);
@@ -229,7 +236,8 @@ public class GzipFilterDefaultTest
try
{
tester.start();
- tester.assertIsResponseNotGzipCompressed("file.mp3", filesize, HttpStatus.OK_200);
+ HttpTester http = tester.assertIsResponseNotGzipCompressed("file.mp3", filesize, HttpStatus.OK_200);
+ Assert.assertNull(http.getHeader("Vary"));
}
finally
{
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipWithPipeliningTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipWithPipeliningTest.java
index 4ce84495e98..19dd9949f3b 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipWithPipeliningTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipWithPipeliningTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/IncludableGzipFilterMinSizeTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/IncludableGzipFilterMinSizeTest.java
index fba8bb21265..d985b41842f 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/IncludableGzipFilterMinSizeTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/IncludableGzipFilterMinSizeTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -99,7 +99,7 @@ public class IncludableGzipFilterMinSizeTest
tester.setGzipFilterClass(IncludableGzipFilter.class);
FilterHolder holder = tester.setContentServlet(testServlet);
- holder.setInitParameter("mimeTypes","application/soap+xml,text/javascript");
+ holder.setInitParameter("mimeTypes","application/soap+xml,text/javascript,application/x-javascript");
holder.setInitParameter("minGzipSize", "2048");
holder.setInitParameter("uncheckedPrintWriter","true");
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/IncludableGzipFilterTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/IncludableGzipFilterTest.java
index 7a073043b8b..26c2c7fa1b0 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/IncludableGzipFilterTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/IncludableGzipFilterTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/MultipartFilterTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/MultipartFilterTest.java
index 38e2c8bbdca..8f873a5cc38 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/MultipartFilterTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/MultipartFilterTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -18,18 +18,19 @@
package org.eclipse.jetty.servlets;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.*;
+import static org.hamcrest.Matchers.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
+import java.io.PrintWriter;
import java.net.Socket;
import java.net.URL;
import java.util.EnumSet;
import java.util.Enumeration;
+import java.util.Map;
import javax.servlet.DispatcherType;
import javax.servlet.ServletException;
@@ -42,6 +43,7 @@ import org.eclipse.jetty.servlet.FilterMapping;
import org.eclipse.jetty.testing.HttpTester;
import org.eclipse.jetty.testing.ServletTester;
import org.eclipse.jetty.util.IO;
+import org.eclipse.jetty.util.QuotedStringTokenizer;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -51,7 +53,22 @@ public class MultipartFilterTest
private File _dir;
private ServletTester tester;
-
+
+ public static class BoundaryServlet extends TestServlet
+ {
+ @Override
+ protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
+ {
+ assertNotNull(req.getParameter("fileName"));
+ assertEquals(getServletContext().getAttribute("fileName"), req.getParameter("fileName"));
+ assertNotNull(req.getParameter("desc"));
+ assertEquals(getServletContext().getAttribute("desc"), req.getParameter("desc"));
+ assertNotNull(req.getParameter("title"));
+ assertEquals(getServletContext().getAttribute("title"), req.getParameter("title"));
+ super.doPost(req, resp);
+ }
+ }
+
public static class TestServlet extends DumpServlet
{
@@ -187,7 +204,116 @@ public class MultipartFilterTest
assertEquals(HttpServletResponse.SC_OK,response.getStatus());
assertTrue(response.getContent().indexOf("brown cow")>=0);
}
+
+ @Test
+ public void testBadlyEncodedFilename() throws Exception
+ {
+ // generated and parsed test
+ HttpTester request = new HttpTester();
+ HttpTester response = new HttpTester();
+ // test GET
+ request.setMethod("POST");
+ request.setVersion("HTTP/1.0");
+ request.setHeader("Host","tester");
+ request.setURI("/context/dump");
+
+ String boundary="XyXyXy";
+ request.setHeader("Content-Type","multipart/form-data; boundary="+boundary);
+
+
+ String content = "--" + boundary + "\r\n"+
+ "Content-Disposition: form-data; name=\"fileup\"; filename=\"Taken on Aug 22 \\ 2012.jpg\"\r\n"+
+ "Content-Type: application/octet-stream\r\n\r\n"+
+ "How now brown cow."+
+ "\r\n--" + boundary + "--\r\n\r\n";
+
+ request.setContent(content);
+
+ response.parse(tester.getResponses(request.generate()));
+
+ //System.out.printf("Content: [%s]%n", response.getContent());
+
+ assertThat(response.getMethod(), nullValue());
+ assertThat(response.getStatus(), is(HttpServletResponse.SC_OK));
+
+ assertThat(response.getContent(), containsString("Filename [Taken on Aug 22 \\ 2012.jpg]"));
+ assertThat(response.getContent(), containsString("How now brown cow."));
+ }
+
+ @Test
+ public void testBadlyEncodedMSFilename() throws Exception
+ {
+ // generated and parsed test
+ HttpTester request = new HttpTester();
+ HttpTester response = new HttpTester();
+
+ // test GET
+ request.setMethod("POST");
+ request.setVersion("HTTP/1.0");
+ request.setHeader("Host","tester");
+ request.setURI("/context/dump");
+
+ String boundary="XyXyXy";
+ request.setHeader("Content-Type","multipart/form-data; boundary="+boundary);
+
+
+ String content = "--" + boundary + "\r\n"+
+ "Content-Disposition: form-data; name=\"fileup\"; filename=\"c:\\this\\really\\is\\some\\path\\to\\a\\file.txt\"\r\n"+
+ "Content-Type: application/octet-stream\r\n\r\n"+
+ "How now brown cow."+
+ "\r\n--" + boundary + "--\r\n\r\n";
+
+ request.setContent(content);
+
+ response.parse(tester.getResponses(request.generate()));
+
+ //System.out.printf("Content: [%s]%n", response.getContent());
+
+ assertThat(response.getMethod(), nullValue());
+ assertThat(response.getStatus(), is(HttpServletResponse.SC_OK));
+
+ assertThat(response.getContent(), containsString("Filename [c:\\this\\really\\is\\some\\path\\to\\a\\file.txt]"));
+ assertThat(response.getContent(), containsString("How now brown cow."));
+ }
+
+ @Test
+ public void testCorrectlyEncodedMSFilename() throws Exception
+ {
+ // generated and parsed test
+ HttpTester request = new HttpTester();
+ HttpTester response = new HttpTester();
+
+ // test GET
+ request.setMethod("POST");
+ request.setVersion("HTTP/1.0");
+ request.setHeader("Host","tester");
+ request.setURI("/context/dump");
+
+ String boundary="XyXyXy";
+ request.setHeader("Content-Type","multipart/form-data; boundary="+boundary);
+
+
+ String content = "--" + boundary + "\r\n"+
+ "Content-Disposition: form-data; name=\"fileup\"; filename=\"c:\\\\this\\\\really\\\\is\\\\some\\\\path\\\\to\\\\a\\\\file.txt\"\r\n"+
+ "Content-Type: application/octet-stream\r\n\r\n"+
+ "How now brown cow."+
+ "\r\n--" + boundary + "--\r\n\r\n";
+
+ request.setContent(content);
+
+ response.parse(tester.getResponses(request.generate()));
+
+ //System.out.printf("Content: [%s]%n", response.getContent());
+
+ assertThat(response.getMethod(), nullValue());
+ assertThat(response.getStatus(), is(HttpServletResponse.SC_OK));
+
+ assertThat(response.getContent(), containsString("Filename [c:\\this\\really\\is\\some\\path\\to\\a\\file.txt]"));
+ assertThat(response.getContent(), containsString("How now brown cow."));
+ }
+
+
/*
* Test multipart with parts encoded in base64 (RFC1521 section 5)
*/
@@ -258,6 +384,346 @@ public class MultipartFilterTest
assertEquals(HttpServletResponse.SC_OK,response.getStatus());
assertTrue(response.getContent().indexOf("brown cow")>=0);
}
+
+
+ @Test
+ public void testNoBoundary() throws Exception
+ {
+ // generated and parsed test
+ HttpTester request = new HttpTester();
+ HttpTester response = new HttpTester();
+ tester.addServlet(BoundaryServlet.class,"/testb");
+ tester.setAttribute("fileName", "abc");
+ tester.setAttribute("desc", "123");
+ tester.setAttribute("title", "ttt");
+ request.setMethod("POST");
+ request.setVersion("HTTP/1.0");
+ request.setHeader("Host","tester");
+ request.setURI("/context/testb");
+
+ request.setHeader("Content-Type","multipart/form-data");
+
+ String content = "--\r\n"+
+ "Content-Disposition: form-data; name=\"fileName\"\r\n"+
+ "Content-Type: text/plain; charset=US-ASCII\r\n"+
+ "Content-Transfer-Encoding: 8bit\r\n"+
+ "\r\n"+
+ "abc\r\n"+
+ "--\r\n"+
+ "Content-Disposition: form-data; name=\"desc\"\r\n"+
+ "Content-Type: text/plain; charset=US-ASCII\r\n"+
+ "Content-Transfer-Encoding: 8bit\r\n"+
+ "\r\n"+
+ "123\r\n"+
+ "--\r\n"+
+ "Content-Disposition: form-data; name=\"title\"\r\n"+
+ "Content-Type: text/plain; charset=US-ASCII\r\n"+
+ "Content-Transfer-Encoding: 8bit\r\n"+
+ "\r\n"+
+ "ttt\r\n"+
+ "--\r\n"+
+ "Content-Disposition: form-data; name=\"fileup\"; filename=\"test.upload\"\r\n"+
+ "Content-Type: application/octet-stream\r\n"+
+ "Content-Transfer-Encoding: binary\r\n"+
+ "\r\n"+
+ "000\r\n"+
+ "----\r\n";
+ request.setContent(content);
+
+ response.parse(tester.getResponses(request.generate()));
+ assertTrue(response.getMethod()==null);
+ assertEquals(HttpServletResponse.SC_OK,response.getStatus());
+ }
+
+
+ @Test
+ public void testLFOnlyRequest() throws Exception
+ {
+ String boundary="XyXyXy";
+ // generated and parsed test
+ HttpTester request = new HttpTester();
+ HttpTester response = new HttpTester();
+ tester.addServlet(BoundaryServlet.class,"/testb");
+ tester.setAttribute("fileName", "abc");
+ tester.setAttribute("desc", "123");
+ tester.setAttribute("title", "ttt");
+ request.setMethod("POST");
+ request.setVersion("HTTP/1.0");
+ request.setHeader("Host","tester");
+ request.setURI("/context/testb");
+ request.setHeader("Content-Type","multipart/form-data; boundary="+boundary);
+
+ String content = "--XyXyXy\n"+
+ "Content-Disposition: form-data; name=\"fileName\"\n"+
+ "Content-Type: text/plain; charset=US-ASCII\n"+
+ "Content-Transfer-Encoding: 8bit\n"+
+ "\n"+
+ "abc\n"+
+ "--XyXyXy\n"+
+ "Content-Disposition: form-data; name=\"desc\"\n"+
+ "Content-Type: text/plain; charset=US-ASCII\n"+
+ "Content-Transfer-Encoding: 8bit\n"+
+ "\n"+
+ "123\n"+
+ "--XyXyXy\n"+
+ "Content-Disposition: form-data; name=\"title\"\n"+
+ "Content-Type: text/plain; charset=US-ASCII\n"+
+ "Content-Transfer-Encoding: 8bit\n"+
+ "\n"+
+ "ttt\n"+
+ "--XyXyXy\n"+
+ "Content-Disposition: form-data; name=\"fileup\"; filename=\"test.upload\"\n"+
+ "Content-Type: application/octet-stream\n"+
+ "Content-Transfer-Encoding: binary\n"+
+ "\n"+
+ "000\n"+
+ "--XyXyXy--\n";
+ request.setContent(content);
+
+ response.parse(tester.getResponses(request.generate()));
+ assertTrue(response.getMethod()==null);
+ assertEquals(HttpServletResponse.SC_OK,response.getStatus());
+ }
+
+
+ @Test
+ public void testCROnlyRequest() throws Exception
+ {
+ String boundary="XyXyXy";
+ // generated and parsed test
+ HttpTester request = new HttpTester();
+ HttpTester response = new HttpTester();
+ tester.addServlet(BoundaryServlet.class,"/testb");
+ tester.setAttribute("fileName", "abc");
+ tester.setAttribute("desc", "123");
+ tester.setAttribute("title", "ttt");
+ request.setMethod("POST");
+ request.setVersion("HTTP/1.0");
+ request.setHeader("Host","tester");
+ request.setURI("/context/testb");
+ request.setHeader("Content-Type","multipart/form-data; boundary="+boundary);
+
+ String content = "--XyXyXy\r"+
+ "Content-Disposition: form-data; name=\"fileName\"\r"+
+ "Content-Type: text/plain; charset=US-ASCII\r"+
+ "Content-Transfer-Encoding: 8bit\r"+
+ "\r"+
+ "abc\r"+
+ "--XyXyXy\r"+
+ "Content-Disposition: form-data; name=\"desc\"\r"+
+ "Content-Type: text/plain; charset=US-ASCII\r"+
+ "Content-Transfer-Encoding: 8bit\r"+
+ "\r"+
+ "123\r"+
+ "--XyXyXy\r"+
+ "Content-Disposition: form-data; name=\"title\"\r"+
+ "Content-Type: text/plain; charset=US-ASCII\r"+
+ "Content-Transfer-Encoding: 8bit\r"+
+ "\r"+
+ "ttt\r"+
+ "--XyXyXy\r"+
+ "Content-Disposition: form-data; name=\"fileup\"; filename=\"test.upload\"\r"+
+ "Content-Type: application/octet-stream\r"+
+ "Content-Transfer-Encoding: binary\r"+
+ "\r"+
+ "000\r"+
+ "--XyXyXy--\r";
+ request.setContent(content);
+
+ response.parse(tester.getResponses(request.generate()));
+ assertTrue(response.getMethod()==null);
+ assertEquals(HttpServletResponse.SC_OK,response.getStatus());
+ }
+
+
+ @Test
+ public void testCROnlyWithEmbeddedLFRequest() throws Exception
+ {
+ String boundary="XyXyXy";
+ // generated and parsed test
+ HttpTester request = new HttpTester();
+ HttpTester response = new HttpTester();
+ tester.addServlet(BoundaryServlet.class,"/testb");
+ tester.setAttribute("fileName", "\nabc\n");
+ tester.setAttribute("desc", "\n123\n");
+ tester.setAttribute("title", "\nttt\n");
+ request.setMethod("POST");
+ request.setVersion("HTTP/1.0");
+ request.setHeader("Host","tester");
+ request.setURI("/context/testb");
+ request.setHeader("Content-Type","multipart/form-data; boundary="+boundary);
+
+ String content = "--XyXyXy\r"+
+ "Content-Disposition: form-data; name=\"fileName\"\r"+
+ "Content-Type: text/plain; charset=US-ASCII\r"+
+ "Content-Transfer-Encoding: 8bit\r"+
+ "\r"+
+ "\nabc\n"+
+ "\r"+
+ "--XyXyXy\r"+
+ "Content-Disposition: form-data; name=\"desc\"\r"+
+ "Content-Type: text/plain; charset=US-ASCII\r"+
+ "Content-Transfer-Encoding: 8bit\r"+
+ "\r"+
+ "\n123\n"+
+ "\r"+
+ "--XyXyXy\r"+
+ "Content-Disposition: form-data; name=\"title\"\r"+
+ "Content-Type: text/plain; charset=US-ASCII\r"+
+ "Content-Transfer-Encoding: 8bit\r"+
+ "\r"+
+ "\nttt\n"+
+ "\r"+
+ "--XyXyXy\r"+
+ "Content-Disposition: form-data; name=\"fileup\"; filename=\"test.upload\"\r"+
+ "Content-Type: application/octet-stream\r"+
+ "Content-Transfer-Encoding: binary\r"+
+ "\r"+
+ "000\r"+
+ "--XyXyXy--\r";
+ request.setContent(content);
+
+ response.parse(tester.getResponses(request.generate()));
+ assertTrue(response.getMethod()==null);
+ assertEquals(HttpServletResponse.SC_OK,response.getStatus());
+ }
+
+
+ @Test
+ public void testNoBody()
+ throws Exception
+ {
+ String boundary="XyXyXy";
+ // generated and parsed test
+ HttpTester request = new HttpTester();
+ HttpTester response = new HttpTester();
+ request.setMethod("POST");
+ request.setVersion("HTTP/1.0");
+ request.setHeader("Host","tester");
+ request.setURI("/context/dump");
+ request.setHeader("Content-Type","multipart/form-data; boundary="+boundary);
+
+ response.parse(tester.getResponses(request.generate()));
+ assertTrue(response.getMethod()==null);
+ assertEquals(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, response.getStatus());
+ assertTrue(response.getReason().startsWith("Missing content"));
+ }
+
+ @Test
+ public void testWhitespaceBodyWithCRLF()
+ throws Exception
+ {
+ String whitespace = " \n\n\n\r\n\r\n\r\n\r\n";
+
+ String boundary="XyXyXy";
+ // generated and parsed test
+ HttpTester request = new HttpTester();
+ HttpTester response = new HttpTester();
+ request.setMethod("POST");
+ request.setVersion("HTTP/1.0");
+ request.setHeader("Host","tester");
+ request.setURI("/context/dump");
+ request.setHeader("Content-Type","multipart/form-data; boundary="+boundary);
+ request.setContent(whitespace);
+
+ response.parse(tester.getResponses(request.generate()));
+ assertTrue(response.getMethod()==null);
+ assertEquals(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, response.getStatus());
+ assertTrue(response.getReason().startsWith("Missing initial"));
+ }
+
+
+ @Test
+ public void testWhitespaceBody()
+ throws Exception
+ {
+ String whitespace = " ";
+
+ String boundary="XyXyXy";
+ // generated and parsed test
+ HttpTester request = new HttpTester();
+ HttpTester response = new HttpTester();
+ request.setMethod("POST");
+ request.setVersion("HTTP/1.0");
+ request.setHeader("Host","tester");
+ request.setURI("/context/dump");
+ request.setHeader("Content-Type","multipart/form-data; boundary="+boundary);
+ request.setContent(whitespace);
+
+ response.parse(tester.getResponses(request.generate()));
+ assertTrue(response.getMethod()==null);
+ assertEquals(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, response.getStatus());
+ assertTrue(response.getReason().startsWith("Missing initial"));
+ }
+
+ @Test
+ public void testLeadingWhitespaceBodyWithCRLF()
+ throws Exception
+ {
+ String boundary = "AaB03x";
+
+ String body = " \n\n\n\r\n\r\n\r\n\r\n"+
+ "--AaB03x\r\n"+
+ "content-disposition: form-data; name=\"field1\"\r\n"+
+ "\r\n"+
+ "Joe Blow\r\n"+
+ "--AaB03x\r\n"+
+ "Content-Disposition: form-data; name=\"fileup\"; filename=\"test.upload\"\r\n"+
+ "Content-Type: application/octet-stream\r\n"+
+ "\r\n" +
+ "aaaa,bbbbb"+"\r\n" +
+ "--AaB03x--\r\n";
+
+ // generated and parsed test
+ HttpTester request = new HttpTester();
+ HttpTester response = new HttpTester();
+ request.setMethod("POST");
+ request.setVersion("HTTP/1.0");
+ request.setHeader("Host","tester");
+ request.setURI("/context/dump");
+ request.setHeader("Content-Type","multipart/form-data; boundary="+boundary);
+ request.setContent(body);
+
+ response.parse(tester.getResponses(request.generate()));
+ assertTrue(response.getMethod()==null);
+ assertEquals(HttpServletResponse.SC_OK, response.getStatus());
+ assertTrue(response.getContent().contains("aaaa,bbbbb"));
+ }
+
+ @Test
+ public void testLeadingWhitespaceBodyWithoutCRLF()
+ throws Exception
+ {
+ String boundary = "AaB03x";
+
+ String body = " "+
+ "--AaB03x\r\n"+
+ "content-disposition: form-data; name=\"field1\"\r\n"+
+ "\r\n"+
+ "Joe Blow\r\n"+
+ "--AaB03x\r\n"+
+ "Content-Disposition: form-data; name=\"fileup\"; filename=\"test.upload\"\r\n"+
+ "Content-Type: application/octet-stream\r\n"+
+ "\r\n" +
+ "aaaa,bbbbb"+"\r\n" +
+ "--AaB03x--\r\n";
+
+ // generated and parsed test
+ HttpTester request = new HttpTester();
+ HttpTester response = new HttpTester();
+ request.setMethod("POST");
+ request.setVersion("HTTP/1.0");
+ request.setHeader("Host","tester");
+ request.setURI("/context/dump");
+ request.setHeader("Content-Type","multipart/form-data; boundary="+boundary);
+ request.setContent(body);
+
+ response.parse(tester.getResponses(request.generate()));
+ assertTrue(response.getMethod()==null);
+ assertEquals(HttpServletResponse.SC_OK, response.getStatus());
+ assertTrue(response.getContent().contains("aaaa,bbbbb"));
+ }
+
/*
* see the testParameterMap test
@@ -265,14 +731,13 @@ public class MultipartFilterTest
*/
public static class TestServletParameterMap extends DumpServlet
{
-
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
- assertEquals("How now brown cow.", req.getParameterMap().get("strupContent-Type:"));
+ String[] content = req.getParameterMap().get("\"strup\"Content-Type: application/octet-stream");
+ assertThat (content[0], containsString("How now brown cow."));
super.doPost(req, resp);
- }
-
+ }
}
/**
@@ -328,8 +793,17 @@ public class MultipartFilterTest
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
- resp.getWriter().println((IO.toString(new FileInputStream((File)req.getAttribute("fileup")))));
+ FileInputStream in = null;
+ try {
+ File file = (File)req.getAttribute("fileup");
+ in = new FileInputStream(file);
+
+ PrintWriter out = resp.getWriter();
+ out.printf("Filename [%s]\r\n", req.getParameter("fileup"));
+ out.println(IO.toString(in));
+ } finally {
+ IO.close(in);
+ }
}
-
}
}
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/PipelineHelper.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/PipelineHelper.java
index 36f2c93b1ca..558b139bf1d 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/PipelineHelper.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/PipelineHelper.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/ProxyServletTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/ProxyServletTest.java
index 84af2b5e779..fd1ccd3fe4b 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/ProxyServletTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/ProxyServletTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -18,19 +18,6 @@
package org.eclipse.jetty.servlets;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.net.MalformedURLException;
-import java.util.Arrays;
-import java.util.concurrent.TimeUnit;
-import javax.servlet.ServletException;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import junit.framework.Assert;
import org.eclipse.jetty.client.ContentExchange;
import org.eclipse.jetty.client.HttpClient;
@@ -45,11 +32,24 @@ import org.eclipse.jetty.server.nio.SelectChannelConnector;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
+import org.hamcrest.core.Is;
+import org.hamcrest.core.IsEqual;
import org.junit.After;
import org.junit.Test;
-import static org.junit.Assert.*;
-import static org.hamcrest.Matchers.*;
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.net.MalformedURLException;
+import java.util.Arrays;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import static org.hamcrest.Matchers.equalTo;
+import static org.junit.Assert.assertThat;
public class ProxyServletTest
{
@@ -190,4 +190,53 @@ public class ProxyServletTest
long rate = file.length() / 1024 * 1000 / millis;
System.out.printf("download rate = %d KiB/s%n", rate);
}
+
+ @Test
+ public void testLessContentThanContentLength() throws Exception {
+ init(new HttpServlet() {
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+ byte[] message = "tooshort".getBytes("ascii");
+ resp.setContentType("text/plain;charset=ascii");
+ resp.setHeader("Content-Length", Long.toString(message.length+1));
+ resp.getOutputStream().write(message);
+ }
+ });
+
+ final AtomicBoolean excepted = new AtomicBoolean(false);
+
+ ContentExchange exchange = new ContentExchange(true)
+ {
+ @Override
+ protected void onResponseContent(Buffer content) throws IOException
+ {
+ try
+ {
+ // Slow down the reader
+ TimeUnit.MILLISECONDS.sleep(10);
+ super.onResponseContent(content);
+ }
+ catch (InterruptedException x)
+ {
+ throw (IOException)new IOException().initCause(x);
+ }
+ }
+
+ @Override
+ protected void onException(Throwable x)
+ {
+ excepted.set(true);
+ super.onException(x);
+ }
+
+
+ };
+
+ String url = "http://localhost:" + _connector.getLocalPort() + "/proxy/test";
+ exchange.setURL(url);
+
+ _client.send(exchange);
+ exchange.waitForDone();
+ assertThat(excepted.get(),equalTo(true));
+ }
}
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/PutFilterTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/PutFilterTest.java
index d4a08b069da..438e30718a9 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/PutFilterTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/PutFilterTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/QoSFilterTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/QoSFilterTest.java
index 9997eaeaec9..5a7fa26ff7e 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/QoSFilterTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/QoSFilterTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/TransparentProxyTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/TransparentProxyTest.java
new file mode 100644
index 00000000000..10467ebdde3
--- /dev/null
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/TransparentProxyTest.java
@@ -0,0 +1,140 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
+// ------------------------------------------------------------------------
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// and Apache License v2.0 which accompanies this distribution.
+//
+// The Eclipse Public License is available at
+// http://www.eclipse.org/legal/epl-v10.html
+//
+// The Apache License v2.0 is available at
+// http://www.opensource.org/licenses/apache2.0.php
+//
+// You may elect to redistribute this code under either of these licenses.
+// ========================================================================
+//
+
+
+package org.eclipse.jetty.servlets;
+
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.nio.SelectChannelConnector;
+import org.eclipse.jetty.servlet.ServletContextHandler;
+import org.eclipse.jetty.servlet.ServletHolder;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+
+/**
+ * TransparentProxyTest
+ *
+ *
+ */
+public class TransparentProxyTest
+{
+
+
+ protected Server server;
+ protected Server proxyServer;
+
+ public static class ServletA extends HttpServlet {
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+ resp.setContentType("text/plain");
+ resp.getWriter().println("ok");
+ }
+ }
+
+ @Before
+ public void setUp () throws Exception
+ {
+ //set up the target server
+ server = new Server();
+ SelectChannelConnector connector = new SelectChannelConnector();
+ connector.setPort(8080);
+ server.addConnector(connector);
+ ServletContextHandler handler = new ServletContextHandler(server, "/");
+ handler.addServlet(ServletA.class, "/a");
+ server.setHandler(handler);
+ server.start();
+
+
+ //set up the server that proxies to the target server
+ proxyServer = new Server();
+ SelectChannelConnector proxyConnector = new SelectChannelConnector();
+ proxyConnector.setPort(8081);
+ proxyServer.addConnector(proxyConnector);
+ ServletContextHandler proxyHandler = new ServletContextHandler(proxyServer, "/");
+ proxyHandler.addServlet(new ServletHolder(new ProxyServlet.Transparent("/", "http", "127.0.0.1", 8080, "/")), "/");
+ proxyServer.setHandler(proxyHandler);
+ proxyServer.start();
+
+ }
+
+
+ @After
+ public void tearDown() throws Exception
+ {
+ server.stop();
+ proxyServer.stop();
+ }
+
+
+ @Test
+ public void testDirectNoContentType() throws Exception
+ {
+ // Direct request without Content-Type set works
+ URL url = new URL("http://localhost:8080/a");
+ HttpURLConnection con = (HttpURLConnection) url.openConnection();
+ assertEquals(200, con.getResponseCode());
+ }
+
+
+ @Test
+ public void testDirectWithContentType() throws Exception
+ {
+ // Direct request with Content-Type works
+ URL url = new URL("http://localhost:8080/a");
+ HttpURLConnection con = (HttpURLConnection) url.openConnection();
+ con.addRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
+ assertEquals(200, con.getResponseCode());
+ }
+
+ @Test
+ public void testProxiedWithoutContentType() throws Exception
+ {
+ // Proxied request without Content-Type set works
+ URL url = new URL("http://localhost:8081/a");
+ HttpURLConnection con = (HttpURLConnection) url.openConnection();
+ assertEquals(200, con.getResponseCode());
+ System.err.println (con.getContentType());
+ }
+
+ @Test
+ public void testProxiedWithContentType() throws Exception
+ {
+ // Proxied request with Content-Type set fails
+
+ URL url = new URL("http://localhost:8081/a");
+ HttpURLConnection con = (HttpURLConnection) url.openConnection();
+ con.addRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
+ assertEquals(200, con.getResponseCode());
+ System.err.println(con.getContentType());
+
+ }
+}
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/GzipTester.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/GzipTester.java
index 77f47766af4..216ef495876 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/GzipTester.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/GzipTester.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -75,12 +75,12 @@ public class GzipTester
// DOES NOT WORK IN WINDOWS - this.testdir.ensureEmpty();
}
- public void assertIsResponseGzipCompressed(String filename) throws Exception
+ public HttpTester assertIsResponseGzipCompressed(String filename) throws Exception
{
- assertIsResponseGzipCompressed(filename,filename);
+ return assertIsResponseGzipCompressed(filename,filename);
}
- public void assertIsResponseGzipCompressed(String requestedFilename, String serverFilename) throws Exception
+ public HttpTester assertIsResponseGzipCompressed(String requestedFilename, String serverFilename) throws Exception
{
System.err.printf("[GzipTester] requesting /context/%s%n",requestedFilename);
HttpTester request = new HttpTester();
@@ -141,6 +141,8 @@ public class GzipTester
IO.close(in);
IO.close(bais);
}
+
+ return response;
}
/**
@@ -245,7 +247,7 @@ public class GzipTester
* passing -1 will disable the Content-Length assertion)
* @throws Exception
*/
- public void assertIsResponseNotGzipCompressed(String filename, int expectedFilesize, int status) throws Exception
+ public HttpTester assertIsResponseNotGzipCompressed(String filename, int expectedFilesize, int status) throws Exception
{
String uri = "/context/"+filename;
HttpTester response = executeRequest(uri);
@@ -260,6 +262,8 @@ public class GzipTester
String actual = readResponse(response);
Assert.assertEquals("Expected response equals actual response",expectedResponse,actual);
}
+
+ return response;
}
@@ -304,13 +308,13 @@ public class GzipTester
{
Assert.assertThat("Response.method",response.getMethod(),nullValue());
Assert.assertThat("Response.status",response.getStatus(),is(status));
+ Assert.assertThat("Response.header[Content-Encoding]",response.getHeader("Content-Encoding"),not(containsString(compressionType)));
if (expectedFilesize != (-1))
{
Assert.assertThat("Response.header[Content-Length]",response.getHeader("Content-Length"),notNullValue());
int serverLength = Integer.parseInt(response.getHeader("Content-Length"));
Assert.assertThat("Response.header[Content-Length]",serverLength,is(expectedFilesize));
}
- Assert.assertThat("Response.header[Content-Encoding]",response.getHeader("Content-Encoding"),not(containsString(compressionType)));
}
private HttpTester executeRequest(String uri) throws IOException, Exception
@@ -463,6 +467,7 @@ public class GzipTester
ServletHolder servletHolder = servletTester.addServlet(servletClass,"/");
servletHolder.setInitParameter("baseDir",testdir.getDir().getAbsolutePath());
FilterHolder holder = servletTester.addFilter(gzipFilterClass,"/*",EnumSet.allOf(DispatcherType.class));
+ holder.setInitParameter("vary","Accept-Encoding");
return holder;
}
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/Hex.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/Hex.java
index b905d67dc26..542373db48e 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/Hex.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/Hex.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/NoOpOutputStream.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/NoOpOutputStream.java
index d94a87213d9..ab573e5c0e2 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/NoOpOutputStream.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/NoOpOutputStream.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestDirContentServlet.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestDirContentServlet.java
index fbde3b07e54..5029311d5f9 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestDirContentServlet.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestDirContentServlet.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestMinGzipSizeServlet.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestMinGzipSizeServlet.java
index 8ff63773231..6883f9ab53d 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestMinGzipSizeServlet.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestMinGzipSizeServlet.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletLengthStreamTypeWrite.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletLengthStreamTypeWrite.java
index e75f5f7ccbd..72fa2620ae7 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletLengthStreamTypeWrite.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletLengthStreamTypeWrite.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletLengthTypeStreamWrite.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletLengthTypeStreamWrite.java
index 39349302a1a..84a6ce3a6a8 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletLengthTypeStreamWrite.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletLengthTypeStreamWrite.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletStreamLengthTypeWrite.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletStreamLengthTypeWrite.java
index eac7e924874..a5046881e6f 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletStreamLengthTypeWrite.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletStreamLengthTypeWrite.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletStreamTypeLengthWrite.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletStreamTypeLengthWrite.java
index 8be41937c57..7b412d0cf3f 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletStreamTypeLengthWrite.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletStreamTypeLengthWrite.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletTypeLengthStreamWrite.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletTypeLengthStreamWrite.java
index 9d9c3dfd1d2..1ae34f0ed54 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletTypeLengthStreamWrite.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletTypeLengthStreamWrite.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletTypeStreamLengthWrite.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletTypeStreamLengthWrite.java
index 2966200d931..0d1def6f9bf 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletTypeStreamLengthWrite.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletTypeStreamLengthWrite.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestStaticMimeTypeServlet.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestStaticMimeTypeServlet.java
index 06e9f297ae5..701088adf3b 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestStaticMimeTypeServlet.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestStaticMimeTypeServlet.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/ByteBufferPool.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/ByteBufferPool.java
index 327d297bd46..8ca6e6f7320 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/ByteBufferPool.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/ByteBufferPool.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/CompressionDictionary.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/CompressionDictionary.java
index d041544706e..0b2df67a490 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/CompressionDictionary.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/CompressionDictionary.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/CompressionFactory.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/CompressionFactory.java
index c79a6c55aba..d507234945a 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/CompressionFactory.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/CompressionFactory.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/Controller.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/Controller.java
index 75007210751..98eea37d9d2 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/Controller.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/Controller.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/FlowControlStrategy.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/FlowControlStrategy.java
index 7861702eab8..f8c0341d6b0 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/FlowControlStrategy.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/FlowControlStrategy.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/ISession.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/ISession.java
index 6a86784aac8..15efa55a808 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/ISession.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/ISession.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/IStream.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/IStream.java
index a56e32faef1..1754ba95ad5 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/IStream.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/IStream.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/IdleListener.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/IdleListener.java
index 112b0e2717b..6f6d9fbdd20 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/IdleListener.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/IdleListener.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/Promise.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/Promise.java
index 43a867fb542..7674ba36954 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/Promise.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/Promise.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/PushSynInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/PushSynInfo.java
index 1b80ae713c8..fc44bdcb241 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/PushSynInfo.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/PushSynInfo.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/SPDYv3FlowControlStrategy.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/SPDYv3FlowControlStrategy.java
index f3f399cceeb..08057fc4c26 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/SPDYv3FlowControlStrategy.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/SPDYv3FlowControlStrategy.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/SessionException.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/SessionException.java
index 05a5e62e854..4f0a74064ea 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/SessionException.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/SessionException.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardByteBufferPool.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardByteBufferPool.java
index 7d2f2eab899..28cfa9248a7 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardByteBufferPool.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardByteBufferPool.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardCompressionFactory.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardCompressionFactory.java
index 1acb39af8e8..87bc8016aa6 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardCompressionFactory.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardCompressionFactory.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java
index 527a2714ae1..81f7f107e9e 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardStream.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardStream.java
index ea87c9c7401..82f8e8d7b45 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardStream.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardStream.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StreamException.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StreamException.java
index c9fabe41313..7d594f37c39 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StreamException.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StreamException.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/ByteBufferDataInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/ByteBufferDataInfo.java
index 52ec2b8fbd8..efcab5122fd 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/ByteBufferDataInfo.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/ByteBufferDataInfo.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/BytesDataInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/BytesDataInfo.java
index d418c503bac..12f5af71348 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/BytesDataInfo.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/BytesDataInfo.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/DataInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/DataInfo.java
index 7519c93a406..54a13d4114a 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/DataInfo.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/DataInfo.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/GoAwayInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/GoAwayInfo.java
index a1ef223793d..f2df4555cb7 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/GoAwayInfo.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/GoAwayInfo.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Handler.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Handler.java
index a5f8d78ef6a..ab7e5ccccf8 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Handler.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Handler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Headers.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Headers.java
index f5d434e1339..54a563f35fe 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Headers.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Headers.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/HeadersInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/HeadersInfo.java
index d452296dac6..cdd462c1430 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/HeadersInfo.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/HeadersInfo.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/PingInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/PingInfo.java
index 88eed82b44d..4232bf7a877 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/PingInfo.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/PingInfo.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/ReplyInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/ReplyInfo.java
index 2bbd2ea9cab..507edd883fc 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/ReplyInfo.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/ReplyInfo.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/RstInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/RstInfo.java
index ff4e96436e5..e26da9319a6 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/RstInfo.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/RstInfo.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SPDY.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SPDY.java
index e5193fc3bdc..dc0ee1e64e0 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SPDY.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SPDY.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SPDYException.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SPDYException.java
index ce294b89039..72137fc3190 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SPDYException.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SPDYException.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Session.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Session.java
index 1c7e39e56a3..1c485473834 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Session.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Session.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SessionFrameListener.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SessionFrameListener.java
index dc7ab7f8357..480f0a44613 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SessionFrameListener.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SessionFrameListener.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SessionStatus.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SessionStatus.java
index 31fe2043b9c..fc52f2e40e0 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SessionStatus.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SessionStatus.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Settings.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Settings.java
index 06ef32d15cf..010267ed698 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Settings.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Settings.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SettingsInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SettingsInfo.java
index dc3b7ec577b..144faa98e4f 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SettingsInfo.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SettingsInfo.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Stream.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Stream.java
index 9e0c4a9a916..6d4eeb6e9fe 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Stream.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/Stream.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StreamFrameListener.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StreamFrameListener.java
index c9ecb4eece5..6a91fc77f67 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StreamFrameListener.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StreamFrameListener.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StreamStatus.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StreamStatus.java
index c889ca402b2..bf20482d65b 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StreamStatus.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StreamStatus.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StringDataInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StringDataInfo.java
index 6f0825c0a6d..ca785f86f16 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StringDataInfo.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/StringDataInfo.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SynInfo.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SynInfo.java
index 22b622ebcb4..51a743bf143 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SynInfo.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/SynInfo.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/server/ServerSessionFrameListener.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/server/ServerSessionFrameListener.java
index 791c08de6c6..073b014f04e 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/server/ServerSessionFrameListener.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/api/server/ServerSessionFrameListener.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/ControlFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/ControlFrame.java
index 4f950c9f267..29ee3982caf 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/ControlFrame.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/ControlFrame.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/ControlFrameType.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/ControlFrameType.java
index 32770500fda..0a25fd5b954 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/ControlFrameType.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/ControlFrameType.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/CredentialFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/CredentialFrame.java
index 24e6a4cddc8..33aeb87b57a 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/CredentialFrame.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/CredentialFrame.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/DataFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/DataFrame.java
index b0879ec59ad..e1f6d6f7202 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/DataFrame.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/DataFrame.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/GoAwayFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/GoAwayFrame.java
index e7af9bfa83d..d084621e894 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/GoAwayFrame.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/GoAwayFrame.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/HeadersFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/HeadersFrame.java
index 80bd3c0434a..25e0085f858 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/HeadersFrame.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/HeadersFrame.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/NoOpFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/NoOpFrame.java
index a51af0d96bb..9899a64cc48 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/NoOpFrame.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/NoOpFrame.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/PingFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/PingFrame.java
index 7d93fd23540..8223ef627cb 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/PingFrame.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/PingFrame.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/RstStreamFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/RstStreamFrame.java
index f14ede3ff96..bbf5d5647d0 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/RstStreamFrame.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/RstStreamFrame.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SettingsFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SettingsFrame.java
index 470396ca5f4..de013dbe6f3 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SettingsFrame.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SettingsFrame.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SynReplyFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SynReplyFrame.java
index edc139f5eef..bcb63073b68 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SynReplyFrame.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SynReplyFrame.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SynStreamFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SynStreamFrame.java
index ae06d951875..6bf4bfbc029 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SynStreamFrame.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/SynStreamFrame.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/WindowUpdateFrame.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/WindowUpdateFrame.java
index 278a5f3dd81..c7d54070c8a 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/WindowUpdateFrame.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/frames/WindowUpdateFrame.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/ControlFrameGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/ControlFrameGenerator.java
index 49355bb4cb3..735bdeb44ba 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/ControlFrameGenerator.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/ControlFrameGenerator.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/CredentialGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/CredentialGenerator.java
index 6ae2869e7e9..00701b78d1a 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/CredentialGenerator.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/CredentialGenerator.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/DataFrameGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/DataFrameGenerator.java
index b0722374e2d..e4c9a57f732 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/DataFrameGenerator.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/DataFrameGenerator.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/Generator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/Generator.java
index a32746abd1b..93891732063 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/Generator.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/Generator.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/GoAwayGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/GoAwayGenerator.java
index 63a47006325..3423b27d06d 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/GoAwayGenerator.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/GoAwayGenerator.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/HeadersBlockGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/HeadersBlockGenerator.java
index c273ba35057..3b502c12c1f 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/HeadersBlockGenerator.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/HeadersBlockGenerator.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/HeadersGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/HeadersGenerator.java
index 2db25a7bbe2..b6fe6309b39 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/HeadersGenerator.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/HeadersGenerator.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/NoOpGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/NoOpGenerator.java
index d249741038d..264c07b865d 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/NoOpGenerator.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/NoOpGenerator.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/PingGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/PingGenerator.java
index 28f93f6f928..2bab2382268 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/PingGenerator.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/PingGenerator.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/RstStreamGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/RstStreamGenerator.java
index 2fc02c146c4..857ca2293c7 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/RstStreamGenerator.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/RstStreamGenerator.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SettingsGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SettingsGenerator.java
index 01288de29a8..fcf7c618965 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SettingsGenerator.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SettingsGenerator.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SynReplyGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SynReplyGenerator.java
index ce6d9f3750f..fff994dd246 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SynReplyGenerator.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SynReplyGenerator.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SynStreamGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SynStreamGenerator.java
index 5a20c3c8301..4294f462608 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SynStreamGenerator.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/SynStreamGenerator.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/WindowUpdateGenerator.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/WindowUpdateGenerator.java
index d7c57cb9bed..354d7db5463 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/WindowUpdateGenerator.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/generator/WindowUpdateGenerator.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/ControlFrameBodyParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/ControlFrameBodyParser.java
index ca333822e60..b6b4aaf40a8 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/ControlFrameBodyParser.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/ControlFrameBodyParser.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/ControlFrameParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/ControlFrameParser.java
index 235a0c46e1c..a253a19eb0c 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/ControlFrameParser.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/ControlFrameParser.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/CredentialBodyParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/CredentialBodyParser.java
index c773b12dbe5..5ed9510a7aa 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/CredentialBodyParser.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/CredentialBodyParser.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/DataFrameParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/DataFrameParser.java
index 5c74af1e61b..b3b20c5494f 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/DataFrameParser.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/DataFrameParser.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/GoAwayBodyParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/GoAwayBodyParser.java
index be4289b76eb..ab1973de132 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/GoAwayBodyParser.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/GoAwayBodyParser.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/HeadersBlockParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/HeadersBlockParser.java
index ba77a48d1f7..1b2613b490d 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/HeadersBlockParser.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/HeadersBlockParser.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/HeadersBodyParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/HeadersBodyParser.java
index 5335579640d..f52f7a4ee6f 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/HeadersBodyParser.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/HeadersBodyParser.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/NoOpBodyParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/NoOpBodyParser.java
index 3dd36493d4d..f9c4687a568 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/NoOpBodyParser.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/NoOpBodyParser.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/Parser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/Parser.java
index 5cf87a113f2..2bc95ac03fa 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/Parser.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/Parser.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/PingBodyParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/PingBodyParser.java
index 73f55430a8e..bf99460c0c0 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/PingBodyParser.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/PingBodyParser.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/RstStreamBodyParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/RstStreamBodyParser.java
index aab7219cf5a..2e59c269902 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/RstStreamBodyParser.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/RstStreamBodyParser.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/SettingsBodyParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/SettingsBodyParser.java
index 2eee23fc778..8bfbe9a0349 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/SettingsBodyParser.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/SettingsBodyParser.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/SynReplyBodyParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/SynReplyBodyParser.java
index 4d94e3d3fb1..d9fc53bbc4b 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/SynReplyBodyParser.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/SynReplyBodyParser.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/SynStreamBodyParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/SynStreamBodyParser.java
index 58dccf28424..67cbca5ae5b 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/SynStreamBodyParser.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/SynStreamBodyParser.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/UnknownControlFrameBodyParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/UnknownControlFrameBodyParser.java
index 660e3647a63..c1eaf2d0b25 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/UnknownControlFrameBodyParser.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/UnknownControlFrameBodyParser.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/WindowUpdateBodyParser.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/WindowUpdateBodyParser.java
index f672a9f1d3e..5b956093f4f 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/WindowUpdateBodyParser.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/parser/WindowUpdateBodyParser.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/AsyncTimeoutTest.java b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/AsyncTimeoutTest.java
index e61a6d999a4..255bcff4639 100644
--- a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/AsyncTimeoutTest.java
+++ b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/AsyncTimeoutTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/StandardSessionTest.java b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/StandardSessionTest.java
index 09c31e7c35b..eb434ed5e09 100644
--- a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/StandardSessionTest.java
+++ b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/StandardSessionTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/StandardStreamTest.java b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/StandardStreamTest.java
index 19215bd14a0..b2cff9e22a4 100644
--- a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/StandardStreamTest.java
+++ b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/StandardStreamTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/api/ClientUsageTest.java b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/api/ClientUsageTest.java
index bdd49c98685..a2acd646009 100644
--- a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/api/ClientUsageTest.java
+++ b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/api/ClientUsageTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/api/ServerUsageTest.java b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/api/ServerUsageTest.java
index 8e01fdb4953..5e387586fd3 100644
--- a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/api/ServerUsageTest.java
+++ b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/api/ServerUsageTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/CredentialGenerateParseTest.java b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/CredentialGenerateParseTest.java
index afb1fbb0500..8e336ba87c6 100644
--- a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/CredentialGenerateParseTest.java
+++ b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/CredentialGenerateParseTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/DataGenerateParseTest.java b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/DataGenerateParseTest.java
index 3cdee0334f2..d7661e9f1a4 100644
--- a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/DataGenerateParseTest.java
+++ b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/DataGenerateParseTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/GoAwayGenerateParseTest.java b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/GoAwayGenerateParseTest.java
index 1bd85909dc7..a7d13522396 100644
--- a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/GoAwayGenerateParseTest.java
+++ b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/GoAwayGenerateParseTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/HeadersGenerateParseTest.java b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/HeadersGenerateParseTest.java
index 8ebc1e4209c..9543f7462f9 100644
--- a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/HeadersGenerateParseTest.java
+++ b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/HeadersGenerateParseTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/NoOpGenerateParseTest.java b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/NoOpGenerateParseTest.java
index aefdd682a95..f6885b5b154 100644
--- a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/NoOpGenerateParseTest.java
+++ b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/NoOpGenerateParseTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/PingGenerateParseTest.java b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/PingGenerateParseTest.java
index 5a7a8c3aafa..61cf0c214fb 100644
--- a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/PingGenerateParseTest.java
+++ b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/PingGenerateParseTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/RstStreamGenerateParseTest.java b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/RstStreamGenerateParseTest.java
index 0d7b126b511..a5ca3cc814e 100644
--- a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/RstStreamGenerateParseTest.java
+++ b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/RstStreamGenerateParseTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/SettingsGenerateParseTest.java b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/SettingsGenerateParseTest.java
index de8985f6abb..340db2a9fa8 100644
--- a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/SettingsGenerateParseTest.java
+++ b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/SettingsGenerateParseTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/SynReplyGenerateParseTest.java b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/SynReplyGenerateParseTest.java
index 92416fda6b8..3b2178cf870 100644
--- a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/SynReplyGenerateParseTest.java
+++ b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/SynReplyGenerateParseTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/SynStreamGenerateParseTest.java b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/SynStreamGenerateParseTest.java
index caa4817fdd6..84bb377e608 100644
--- a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/SynStreamGenerateParseTest.java
+++ b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/SynStreamGenerateParseTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/TestSPDYParserListener.java b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/TestSPDYParserListener.java
index deee74fa5b1..2271e14f076 100644
--- a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/TestSPDYParserListener.java
+++ b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/TestSPDYParserListener.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/WindowUpdateGenerateParseTest.java b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/WindowUpdateGenerateParseTest.java
index 331df5be7f3..bba25412881 100644
--- a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/WindowUpdateGenerateParseTest.java
+++ b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/frames/WindowUpdateGenerateParseTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/parser/LiveChromiumRequestParserTest.java b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/parser/LiveChromiumRequestParserTest.java
index 9232ba61d59..acc56baed0a 100644
--- a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/parser/LiveChromiumRequestParserTest.java
+++ b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/parser/LiveChromiumRequestParserTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/parser/ParseVersusCacheBenchmarkTest.java b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/parser/ParseVersusCacheBenchmarkTest.java
index fbd94006222..7787b2e5125 100644
--- a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/parser/ParseVersusCacheBenchmarkTest.java
+++ b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/parser/ParseVersusCacheBenchmarkTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/parser/UnknownControlFrameTest.java b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/parser/UnknownControlFrameTest.java
index 0bac21d9e22..08c57712598 100644
--- a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/parser/UnknownControlFrameTest.java
+++ b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/parser/UnknownControlFrameTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/AbstractHTTPSPDYServerConnector.java b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/AbstractHTTPSPDYServerConnector.java
index 0032b6a3989..9f7fb1e5fff 100644
--- a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/AbstractHTTPSPDYServerConnector.java
+++ b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/AbstractHTTPSPDYServerConnector.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/HTTPSPDYHeader.java b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/HTTPSPDYHeader.java
index 94d118edc3a..eab15c63442 100644
--- a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/HTTPSPDYHeader.java
+++ b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/HTTPSPDYHeader.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/HTTPSPDYServerConnector.java b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/HTTPSPDYServerConnector.java
index b15a2c7d444..ca8af33e929 100644
--- a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/HTTPSPDYServerConnector.java
+++ b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/HTTPSPDYServerConnector.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/PushStrategy.java b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/PushStrategy.java
index 4eadfd4d8c5..c7f26077e06 100644
--- a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/PushStrategy.java
+++ b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/PushStrategy.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/ReferrerPushStrategy.java b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/ReferrerPushStrategy.java
index 5fc60853108..8710950a88f 100644
--- a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/ReferrerPushStrategy.java
+++ b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/ReferrerPushStrategy.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/ServerHTTPAsyncConnectionFactory.java b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/ServerHTTPAsyncConnectionFactory.java
index 8ddce870be4..0a93ec51d84 100644
--- a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/ServerHTTPAsyncConnectionFactory.java
+++ b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/ServerHTTPAsyncConnectionFactory.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/ServerHTTPSPDYAsyncConnection.java b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/ServerHTTPSPDYAsyncConnection.java
index 9eb4f2b8a9d..0282ae5947c 100644
--- a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/ServerHTTPSPDYAsyncConnection.java
+++ b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/ServerHTTPSPDYAsyncConnection.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/ServerHTTPSPDYAsyncConnectionFactory.java b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/ServerHTTPSPDYAsyncConnectionFactory.java
index 7ff50b229f1..a5b1aab9600 100644
--- a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/ServerHTTPSPDYAsyncConnectionFactory.java
+++ b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/http/ServerHTTPSPDYAsyncConnectionFactory.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/HTTPSPDYProxyConnector.java b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/HTTPSPDYProxyConnector.java
index 01548594338..fd6dc9add58 100644
--- a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/HTTPSPDYProxyConnector.java
+++ b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/HTTPSPDYProxyConnector.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/ProxyEngine.java b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/ProxyEngine.java
index 0e71ec39d64..5acc3b10935 100644
--- a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/ProxyEngine.java
+++ b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/ProxyEngine.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/ProxyEngineSelector.java b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/ProxyEngineSelector.java
index 7dd0887e509..54e4f2b45d8 100644
--- a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/ProxyEngineSelector.java
+++ b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/ProxyEngineSelector.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/ProxyHTTPAsyncConnectionFactory.java b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/ProxyHTTPAsyncConnectionFactory.java
index b8d2c4db01d..2f307bb6191 100644
--- a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/ProxyHTTPAsyncConnectionFactory.java
+++ b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/ProxyHTTPAsyncConnectionFactory.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/ProxyHTTPSPDYAsyncConnection.java b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/ProxyHTTPSPDYAsyncConnection.java
index 4274ac64e30..3600020de80 100644
--- a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/ProxyHTTPSPDYAsyncConnection.java
+++ b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/ProxyHTTPSPDYAsyncConnection.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/SPDYProxyEngine.java b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/SPDYProxyEngine.java
index d4548b2ae81..3c3e2b49bd1 100644
--- a/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/SPDYProxyEngine.java
+++ b/jetty-spdy/spdy-jetty-http/src/main/java/org/eclipse/jetty/spdy/proxy/SPDYProxyEngine.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/AbstractHTTPSPDYTest.java b/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/AbstractHTTPSPDYTest.java
index fb255530273..382d4794a2d 100644
--- a/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/AbstractHTTPSPDYTest.java
+++ b/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/AbstractHTTPSPDYTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ConcurrentStreamsTest.java b/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ConcurrentStreamsTest.java
index 732663d3e7b..7e0d2b601d3 100644
--- a/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ConcurrentStreamsTest.java
+++ b/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ConcurrentStreamsTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ProtocolNegotiationTest.java b/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ProtocolNegotiationTest.java
index b6edb910ba1..a4695712a1c 100644
--- a/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ProtocolNegotiationTest.java
+++ b/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ProtocolNegotiationTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/PushStrategyBenchmarkTest.java b/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/PushStrategyBenchmarkTest.java
index 0aee9b136cc..3fa12954cca 100644
--- a/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/PushStrategyBenchmarkTest.java
+++ b/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/PushStrategyBenchmarkTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ReferrerPushStrategyUnitTest.java b/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ReferrerPushStrategyUnitTest.java
index ed7dcf040ce..0524b565ede 100644
--- a/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ReferrerPushStrategyUnitTest.java
+++ b/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ReferrerPushStrategyUnitTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ReferrerPushStrategyV2Test.java b/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ReferrerPushStrategyV2Test.java
index 0cf18c2d063..9df2d0f1f38 100644
--- a/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ReferrerPushStrategyV2Test.java
+++ b/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ReferrerPushStrategyV2Test.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ReferrerPushStrategyV3Test.java b/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ReferrerPushStrategyV3Test.java
index c4d6ddb655f..0ee0945eb44 100644
--- a/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ReferrerPushStrategyV3Test.java
+++ b/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ReferrerPushStrategyV3Test.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/SSLExternalServerTest.java b/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/SSLExternalServerTest.java
index eff932ea34c..2a02eabfe8a 100644
--- a/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/SSLExternalServerTest.java
+++ b/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/SSLExternalServerTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ServerHTTPSPDYv2Test.java b/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ServerHTTPSPDYv2Test.java
index aeb7825292b..700e9b15903 100644
--- a/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ServerHTTPSPDYv2Test.java
+++ b/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ServerHTTPSPDYv2Test.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ServerHTTPSPDYv3Test.java b/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ServerHTTPSPDYv3Test.java
index f5585a05fa3..72409154515 100644
--- a/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ServerHTTPSPDYv3Test.java
+++ b/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/http/ServerHTTPSPDYv3Test.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/proxy/ProxyHTTPSPDYv2Test.java b/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/proxy/ProxyHTTPSPDYv2Test.java
index 29d88d626ac..8180b08e444 100644
--- a/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/proxy/ProxyHTTPSPDYv2Test.java
+++ b/jetty-spdy/spdy-jetty-http/src/test/java/org/eclipse/jetty/spdy/proxy/ProxyHTTPSPDYv2Test.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/AsyncConnectionFactory.java b/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/AsyncConnectionFactory.java
index 1e3c695971a..31c800cea37 100644
--- a/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/AsyncConnectionFactory.java
+++ b/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/AsyncConnectionFactory.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/EmptyAsyncConnection.java b/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/EmptyAsyncConnection.java
index 24893ea240f..0e7ceb92bb6 100644
--- a/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/EmptyAsyncConnection.java
+++ b/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/EmptyAsyncConnection.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/EmptyAsyncEndPoint.java b/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/EmptyAsyncEndPoint.java
index acefc2a5e4f..85da2e7277b 100644
--- a/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/EmptyAsyncEndPoint.java
+++ b/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/EmptyAsyncEndPoint.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/FlowControlStrategyFactory.java b/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/FlowControlStrategyFactory.java
index 65574e1f3e9..e1b3fef99bd 100644
--- a/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/FlowControlStrategyFactory.java
+++ b/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/FlowControlStrategyFactory.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/SPDYAsyncConnection.java b/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/SPDYAsyncConnection.java
index ce61e409c24..59a3424feb6 100644
--- a/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/SPDYAsyncConnection.java
+++ b/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/SPDYAsyncConnection.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/SPDYClient.java b/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/SPDYClient.java
index 06fd0d64df6..457538cf032 100644
--- a/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/SPDYClient.java
+++ b/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/SPDYClient.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/SPDYServerConnector.java b/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/SPDYServerConnector.java
index 0e8cf89e8ce..e99ccaacf15 100644
--- a/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/SPDYServerConnector.java
+++ b/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/SPDYServerConnector.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/ServerSPDYAsyncConnectionFactory.java b/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/ServerSPDYAsyncConnectionFactory.java
index cf2d1f055ef..17c48aa63e6 100644
--- a/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/ServerSPDYAsyncConnectionFactory.java
+++ b/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/ServerSPDYAsyncConnectionFactory.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/AbstractTest.java b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/AbstractTest.java
index afd23e07866..51ae9238ba3 100644
--- a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/AbstractTest.java
+++ b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/AbstractTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/ClosedStreamTest.java b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/ClosedStreamTest.java
index bbbd940ec74..4afe92cbaa7 100644
--- a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/ClosedStreamTest.java
+++ b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/ClosedStreamTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/FlowControlTest.java b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/FlowControlTest.java
index 39b1c6842a3..b3e97d14c58 100644
--- a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/FlowControlTest.java
+++ b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/FlowControlTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/GoAwayTest.java b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/GoAwayTest.java
index a2503fe12a8..9bfcccc8109 100644
--- a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/GoAwayTest.java
+++ b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/GoAwayTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/HeadersTest.java b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/HeadersTest.java
index 9f874c0daec..927098209e4 100644
--- a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/HeadersTest.java
+++ b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/HeadersTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/IdleTimeoutTest.java b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/IdleTimeoutTest.java
index 746f09878f4..a9ea4709bd1 100644
--- a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/IdleTimeoutTest.java
+++ b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/IdleTimeoutTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/PingTest.java b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/PingTest.java
index 6a69feb7e19..38a0fe20c52 100644
--- a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/PingTest.java
+++ b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/PingTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/ProtocolViolationsTest.java b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/ProtocolViolationsTest.java
index d04eb3c39f5..8716bc6e605 100644
--- a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/ProtocolViolationsTest.java
+++ b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/ProtocolViolationsTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/PushStreamTest.java b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/PushStreamTest.java
index 6c6595a76af..b5b5cd60836 100644
--- a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/PushStreamTest.java
+++ b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/PushStreamTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/ResetStreamTest.java b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/ResetStreamTest.java
index f47e4232540..56d836d9f43 100644
--- a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/ResetStreamTest.java
+++ b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/ResetStreamTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SPDYClientFactoryTest.java b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SPDYClientFactoryTest.java
index e324601c561..5de76de6b93 100644
--- a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SPDYClientFactoryTest.java
+++ b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SPDYClientFactoryTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SPDYServerConnectorTest.java b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SPDYServerConnectorTest.java
index 02f3d65b0b7..d3190fbb387 100644
--- a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SPDYServerConnectorTest.java
+++ b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SPDYServerConnectorTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SSLEngineLeakTest.java b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SSLEngineLeakTest.java
index 85c01c9195d..0f26dab9a07 100644
--- a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SSLEngineLeakTest.java
+++ b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SSLEngineLeakTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SSLSynReplyTest.java b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SSLSynReplyTest.java
index 88457b81787..82283571b84 100644
--- a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SSLSynReplyTest.java
+++ b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SSLSynReplyTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SettingsTest.java b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SettingsTest.java
index f244b2f5cfc..bbff130923a 100644
--- a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SettingsTest.java
+++ b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SettingsTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SynDataReplyDataLoadTest.java b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SynDataReplyDataLoadTest.java
index 9c32c76b35b..d83d970ea44 100644
--- a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SynDataReplyDataLoadTest.java
+++ b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SynDataReplyDataLoadTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SynReplyTest.java b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SynReplyTest.java
index c79118392c0..093d325908a 100644
--- a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SynReplyTest.java
+++ b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/SynReplyTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/UnsupportedVersionTest.java b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/UnsupportedVersionTest.java
index a9c350d1add..64c68ec9a67 100644
--- a/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/UnsupportedVersionTest.java
+++ b/jetty-spdy/spdy-jetty/src/test/java/org/eclipse/jetty/spdy/UnsupportedVersionTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Classpath.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Classpath.java
index 7f339a5ac27..48e32c94932 100644
--- a/jetty-start/src/main/java/org/eclipse/jetty/start/Classpath.java
+++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Classpath.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/CommandLineBuilder.java b/jetty-start/src/main/java/org/eclipse/jetty/start/CommandLineBuilder.java
index 7a7c91c728e..16242ff5aa8 100644
--- a/jetty-start/src/main/java/org/eclipse/jetty/start/CommandLineBuilder.java
+++ b/jetty-start/src/main/java/org/eclipse/jetty/start/CommandLineBuilder.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Config.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Config.java
index f6249ccaf61..9ed3b1b4b13 100644
--- a/jetty-start/src/main/java/org/eclipse/jetty/start/Config.java
+++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Config.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/FilenameComparator.java b/jetty-start/src/main/java/org/eclipse/jetty/start/FilenameComparator.java
index 028f66955f5..266716ff84a 100644
--- a/jetty-start/src/main/java/org/eclipse/jetty/start/FilenameComparator.java
+++ b/jetty-start/src/main/java/org/eclipse/jetty/start/FilenameComparator.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/JarVersion.java b/jetty-start/src/main/java/org/eclipse/jetty/start/JarVersion.java
index f8f0ae59e18..858a2c09e04 100644
--- a/jetty-start/src/main/java/org/eclipse/jetty/start/JarVersion.java
+++ b/jetty-start/src/main/java/org/eclipse/jetty/start/JarVersion.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java
index 8323e53852f..7a16aaecd6b 100644
--- a/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java
+++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -53,12 +53,13 @@ import java.util.Set;
/*-------------------------------------------*/
/**
*
- * Main start class. This class is intended to be the main class listed in the MANIFEST.MF of the start.jar archive. It allows an application to be started with
- * the command "java -jar start.jar".
+ * Main start class. This class is intended to be the main class listed in the MANIFEST.MF of the start.jar archive. It
+ * allows an application to be started with the command "java -jar start.jar".
*
- *
+ *
*
- * The behaviour of Main is controlled by the parsing of the {@link Config} "org/eclipse/start/start.config" file obtained as a resource or file.
+ * The behaviour of Main is controlled by the parsing of the {@link Config} "org/eclipse/start/start.config" file
+ * obtained as a resource or file.
*
*/
public class Main
@@ -91,7 +92,7 @@ public class Main
Main main = new Main();
List arguments = main.expandCommandLine(args);
List xmls = main.processCommandLine(arguments);
- if (xmls!=null)
+ if (xmls != null)
main.start(xmls);
}
catch (Throwable e)
@@ -143,7 +144,7 @@ public class Main
List parseStartIniFiles()
{
- List ini_args=new ArrayList();
+ List ini_args = new ArrayList();
File start_ini = new File(_jettyHome,"start.ini");
if (start_ini.exists())
ini_args.addAll(loadStartIni(start_ini));
@@ -179,14 +180,14 @@ public class Main
_showUsage = true;
continue;
}
-
+
if ("--stop".equals(arg))
{
int port = Integer.parseInt(Config.getProperty("STOP.PORT","-1"));
String key = Config.getProperty("STOP.KEY",null);
- int timeout = Integer.parseInt(Config.getProperty("STOP.WAIT", "0"));
+ int timeout = Integer.parseInt(Config.getProperty("STOP.WAIT","0"));
stop(port,key,timeout);
- return null;
+ return null;
}
if ("--version".equals(arg) || "-v".equals(arg) || "--info".equals(arg))
@@ -226,7 +227,7 @@ public class Main
if (!startDir.exists() || !startDir.canWrite())
startDir = new File(".");
- File startLog = new File(startDir, START_LOG_ROLLOVER_DATEFORMAT.format(new Date()));
+ File startLog = new File(startDir,START_LOG_ROLLOVER_DATEFORMAT.format(new Date()));
if (!startLog.exists() && !startLog.createNewFile())
{
@@ -246,7 +247,7 @@ public class Main
PrintStream logger = new PrintStream(new FileOutputStream(startLog,false));
System.setOut(logger);
System.setErr(logger);
- System.out.println("Establishing "+ START_LOG_FILENAME + " on " + new Date());
+ System.out.println("Establishing " + START_LOG_FILENAME + " on " + new Date());
continue;
}
@@ -492,11 +493,6 @@ public class Main
/* ------------------------------------------------------------ */
public void start(List xmls) throws IOException, InterruptedException
{
- // Setup Start / Stop Monitoring
- int port = Integer.parseInt(Config.getProperty("STOP.PORT","-1"));
- String key = Config.getProperty("STOP.KEY",null);
- Monitor monitor = new Monitor(port,key);
-
// Load potential Config (start.config)
List configuredXmls = loadConfig(xmls);
@@ -581,9 +577,8 @@ public class Main
copyInThread(process.getErrorStream(),System.err);
copyInThread(process.getInputStream(),System.out);
copyInThread(System.in,process.getOutputStream());
- monitor.setProcess(process);
process.waitFor();
-
+ System.exit(0); // exit JVM when child process ends.
return;
}
@@ -688,11 +683,18 @@ public class Main
cmd.addArg(x);
}
cmd.addRawArg("-Djetty.home=" + _jettyHome);
+
+ // Special Stop/Shutdown properties
+ ensureSystemPropertySet("STOP.PORT");
+ ensureSystemPropertySet("STOP.KEY");
+
+ // System Properties
for (String p : _sysProps)
{
String v = System.getProperty(p);
cmd.addEqualsArg("-D" + p,v);
}
+
cmd.addArg("-cp");
cmd.addRawArg(classpath.toString());
cmd.addRawArg(_config.getMainClassname());
@@ -715,6 +717,34 @@ public class Main
return cmd;
}
+ /**
+ * Ensure that the System Properties are set (if defined as a System property, or start.config property, or
+ * start.ini property)
+ *
+ * @param key
+ * the key to be sure of
+ */
+ private void ensureSystemPropertySet(String key)
+ {
+ if (_sysProps.contains(key))
+ {
+ return; // done
+ }
+
+ Properties props = Config.getProperties();
+ if (props.containsKey(key))
+ {
+ String val = props.getProperty(key,null);
+ if (val == null)
+ {
+ return; // no value to set
+ }
+ // setup system property
+ _sysProps.add(key);
+ System.setProperty(key,val);
+ }
+ }
+
private String findJavaBin()
{
File javaHome = new File(System.getProperty("java.home"));
@@ -927,10 +957,10 @@ public class Main
/**
* Load Configuration.
- *
- * No specific configuration is real until a {@link Config#getCombinedClasspath(java.util.Collection)} is used to execute the {@link Class} specified by
- * {@link Config#getMainClassname()} is executed.
- *
+ *
+ * No specific configuration is real until a {@link Config#getCombinedClasspath(java.util.Collection)} is used to
+ * execute the {@link Class} specified by {@link Config#getMainClassname()} is executed.
+ *
* @param xmls
* the command line specified xml configuration options.
* @return the list of xml configurations arriving via command line and start.config choices.
@@ -1007,11 +1037,10 @@ public class Main
*/
public void stop(int port, String key)
{
- stop (port,key, 0);
+ stop(port,key,0);
}
-
- public void stop (int port, String key, int timeout)
+ public void stop(int port, String key, int timeout)
{
int _port = port;
String _key = key;
@@ -1031,7 +1060,7 @@ public class Main
Socket s = new Socket(InetAddress.getByName("127.0.0.1"),_port);
if (timeout > 0)
- s.setSoTimeout(timeout*1000);
+ s.setSoTimeout(timeout * 1000);
try
{
OutputStream out = s.getOutputStream();
@@ -1040,11 +1069,15 @@ public class Main
if (timeout > 0)
{
- System.err.println("Waiting"+(timeout > 0 ? (" "+timeout+"sec") : "")+" for jetty to stop");
+ System.err.printf("Waiting %,d seconds for jetty to stop%n",timeout);
LineNumberReader lin = new LineNumberReader(new InputStreamReader(s.getInputStream()));
- String response=lin.readLine();
- if ("Stopped".equals(response))
- System.err.println("Stopped");
+ String response;
+ while ((response = lin.readLine()) != null)
+ {
+ Config.debug("Received \"" + response + "\"");
+ if ("Stopped".equals(response))
+ System.err.println("Server reports itself as Stopped");
+ }
}
}
finally
diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Monitor.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Monitor.java
deleted file mode 100644
index ff29f11df94..00000000000
--- a/jetty-start/src/main/java/org/eclipse/jetty/start/Monitor.java
+++ /dev/null
@@ -1,158 +0,0 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.opensource.org/licenses/apache2.0.php
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-//
-
-package org.eclipse.jetty.start;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.LineNumberReader;
-import java.net.InetAddress;
-import java.net.ServerSocket;
-import java.net.Socket;
-
-/*-------------------------------------------*/
-/** Monitor thread.
- * This thread listens on the port specified by the STOP.PORT system parameter
- * (defaults to -1 for not listening) for request authenticated with the key given by the STOP.KEY
- * system parameter (defaults to "eclipse") for admin requests.
- *
- * If the stop port is set to zero, then a random port is assigned and the port number
- * is printed to stdout.
- *
- * Commands "stop" and * "status" are currently supported.
- *
- */
-public class Monitor extends Thread
-{
- private Process _process;
- private final int _port;
- private final String _key;
-
- ServerSocket _socket;
-
- public Monitor(int port,String key)
- {
- try
- {
- if(port<0)
- return;
- setDaemon(true);
- setName("StopMonitor");
- _socket=new ServerSocket(port,1,InetAddress.getByName("127.0.0.1"));
- if (port==0)
- {
- port=_socket.getLocalPort();
- System.out.println(port);
- }
-
- if (key==null)
- {
- key=Long.toString((long)(Long.MAX_VALUE*Math.random()+this.hashCode()+System.currentTimeMillis()),36);
- System.out.println("STOP.KEY="+key);
- }
- }
- catch(Exception e)
- {
- Config.debug(e);
- System.err.println("Error binding monitor port "+port+": "+e.toString());
- }
- finally
- {
- _port=port;
- _key=key;
- }
-
- if (_socket!=null)
- this.start();
- else
- System.err.println("WARN: Not listening on monitor port: "+_port);
- }
-
- public Process getProcess()
- {
- return _process;
- }
-
- public void setProcess(Process process)
- {
- _process = process;
- }
-
- @Override
- public void run()
- {
- while (true)
- {
- Socket socket=null;
- try{
- socket=_socket.accept();
-
- LineNumberReader lin=
- new LineNumberReader(new InputStreamReader(socket.getInputStream()));
- String key=lin.readLine();
- if (!_key.equals(key))
- {
- System.err.println("Ignoring command with incorrect key");
- continue;
- }
-
- String cmd=lin.readLine();
- Config.debug("command=" + cmd);
- if ("stop".equals(cmd))
- {
- if (_process!=null)
- {
- //if we have a child process, wait for it to finish before we stop
- try
- {
- _process.destroy();
- _process.waitFor();
-
- }
- catch (InterruptedException e)
- {
- System.err.println("Interrupted waiting for child to terminate");
- }
- }
- socket.getOutputStream().write("Stopped\r\n".getBytes());
- try {socket.close();}catch(Exception e){e.printStackTrace();}
- try {_socket.close();}catch(Exception e){e.printStackTrace();}
- System.exit(0);
- }
- else if ("status".equals(cmd))
- {
- socket.getOutputStream().write("OK\r\n".getBytes());
- socket.getOutputStream().flush();
- }
- }
- catch(Exception e)
- {
- Config.debug(e);
- System.err.println(e.toString());
- }
- finally
- {
- if (socket!=null)
- {
- try{socket.close();}catch(Exception e){}
- }
- socket=null;
- }
- }
- }
-
-}
diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Version.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Version.java
index c8eeccc2f03..49d823c93ac 100644
--- a/jetty-start/src/main/java/org/eclipse/jetty/start/Version.java
+++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Version.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-start/src/main/resources/org/eclipse/jetty/start/start.config b/jetty-start/src/main/resources/org/eclipse/jetty/start/start.config
index 23bb426162f..bf3c920f310 100644
--- a/jetty-start/src/main/resources/org/eclipse/jetty/start/start.config
+++ b/jetty-start/src/main/resources/org/eclipse/jetty/start/start.config
@@ -128,8 +128,8 @@ $(jetty.home)/lib/jetty-plus-${version}.jar
$(jetty.home)/lib/jndi/** exists $(jetty.home)/lib/jndi
[All,annotations]
-$(jetty.home)/lib/jetty-annotations-$(version).jar ! available org.eclipse.jetty.annotations.AnnotationFinder
-$(jetty.home)/lib/annotations/** exists $(jetty.home)/lib/jndi
+$(jetty.home)/lib/jetty-annotations-$(version).jar ! available org.eclipse.jetty.annotations.AnnotationParser
+$(jetty.home)/lib/annotations/** exists $(jetty.home)/lib/annotations
[All,setuid]
$(jetty.home)/lib/jetty-setuid-$(version).jar ! available org.eclipse.jetty.setuid.SetUID
diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/CommandLineBuilderTest.java b/jetty-start/src/test/java/org/eclipse/jetty/start/CommandLineBuilderTest.java
index fd4b2800148..967e3691fd1 100644
--- a/jetty-start/src/test/java/org/eclipse/jetty/start/CommandLineBuilderTest.java
+++ b/jetty-start/src/test/java/org/eclipse/jetty/start/CommandLineBuilderTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/ConfigTest.java b/jetty-start/src/test/java/org/eclipse/jetty/start/ConfigTest.java
index 9948452c183..59bbeaa74d8 100644
--- a/jetty-start/src/test/java/org/eclipse/jetty/start/ConfigTest.java
+++ b/jetty-start/src/test/java/org/eclipse/jetty/start/ConfigTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/MainTest.java b/jetty-start/src/test/java/org/eclipse/jetty/start/MainTest.java
index a713f7f60a7..983d8394a00 100644
--- a/jetty-start/src/test/java/org/eclipse/jetty/start/MainTest.java
+++ b/jetty-start/src/test/java/org/eclipse/jetty/start/MainTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/VersionTest.java b/jetty-start/src/test/java/org/eclipse/jetty/start/VersionTest.java
index ed0e7c665d4..ccea186bfeb 100644
--- a/jetty-start/src/test/java/org/eclipse/jetty/start/VersionTest.java
+++ b/jetty-start/src/test/java/org/eclipse/jetty/start/VersionTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ArrayQueue.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ArrayQueue.java
index a6519191579..e8efbaf627e 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/ArrayQueue.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ArrayQueue.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/Atomics.java b/jetty-util/src/main/java/org/eclipse/jetty/util/Atomics.java
index 50d040ae115..618c6641fd8 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/Atomics.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/Atomics.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/Attributes.java b/jetty-util/src/main/java/org/eclipse/jetty/util/Attributes.java
index 04d88edc981..e107d1ebe74 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/Attributes.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/Attributes.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/AttributesMap.java b/jetty-util/src/main/java/org/eclipse/jetty/util/AttributesMap.java
index 0370bf2e5ec..1a443337869 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/AttributesMap.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/AttributesMap.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/B64Code.java b/jetty-util/src/main/java/org/eclipse/jetty/util/B64Code.java
index d34deacf634..78dd63c709b 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/B64Code.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/B64Code.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -19,6 +19,7 @@
package org.eclipse.jetty.util;
import java.io.ByteArrayOutputStream;
+import java.io.IOException;
import java.io.UnsupportedEncodingException;
@@ -33,8 +34,8 @@ import java.io.UnsupportedEncodingException;
public class B64Code
{
// ------------------------------------------------------------------
- static final char pad='=';
- static final char[] rfc1421alphabet=
+ static final char __pad='=';
+ static final char[] __rfc1421alphabet=
{
'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',
'Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f',
@@ -42,16 +43,16 @@ public class B64Code
'w','x','y','z','0','1','2','3','4','5','6','7','8','9','+','/'
};
- static final byte[] rfc1421nibbles;
+ static final byte[] __rfc1421nibbles;
static
{
- rfc1421nibbles=new byte[256];
+ __rfc1421nibbles=new byte[256];
for (int i=0;i<256;i++)
- rfc1421nibbles[i]=-1;
+ __rfc1421nibbles[i]=-1;
for (byte b=0;b<64;b++)
- rfc1421nibbles[(byte)rfc1421alphabet[b]]=b;
- rfc1421nibbles[(byte)pad]=0;
+ __rfc1421nibbles[(byte)__rfc1421alphabet[b]]=b;
+ __rfc1421nibbles[(byte)__pad]=0;
}
// ------------------------------------------------------------------
@@ -104,7 +105,54 @@ public class B64Code
*/
static public char[] encode(byte[] b)
{
- return encode(b,false);
+ if (b==null)
+ return null;
+
+ int bLen=b.length;
+ int cLen=((bLen+2)/3)*4;
+ char c[]=new char[cLen];
+ int ci=0;
+ int bi=0;
+ byte b0, b1, b2;
+ int stop=(bLen/3)*3;
+ while (bi>>2)&0x3f];
+ c[ci++]=__rfc1421alphabet[(b0<<4)&0x3f|(b1>>>4)&0x0f];
+ c[ci++]=__rfc1421alphabet[(b1<<2)&0x3f|(b2>>>6)&0x03];
+ c[ci++]=__rfc1421alphabet[b2&077];
+ }
+
+ if (bLen!=bi)
+ {
+ switch (bLen%3)
+ {
+ case 2:
+ b0=b[bi++];
+ b1=b[bi++];
+ c[ci++]=__rfc1421alphabet[(b0>>>2)&0x3f];
+ c[ci++]=__rfc1421alphabet[(b0<<4)&0x3f|(b1>>>4)&0x0f];
+ c[ci++]=__rfc1421alphabet[(b1<<2)&0x3f];
+ c[ci++]=__pad;
+ break;
+
+ case 1:
+ b0=b[bi++];
+ c[ci++]=__rfc1421alphabet[(b0>>>2)&0x3f];
+ c[ci++]=__rfc1421alphabet[(b0<<4)&0x3f];
+ c[ci++]=__pad;
+ c[ci++]=__pad;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ return c;
}
// ------------------------------------------------------------------
@@ -120,11 +168,12 @@ public class B64Code
{
if (b==null)
return null;
+ if (!rfc2045)
+ return encode(b);
int bLen=b.length;
int cLen=((bLen+2)/3)*4;
- if (rfc2045)
- cLen+=2+2*cLen/76;
+ cLen+=2+2*(cLen/76);
char c[]=new char[cLen];
int ci=0;
int bi=0;
@@ -136,12 +185,12 @@ public class B64Code
b0=b[bi++];
b1=b[bi++];
b2=b[bi++];
- c[ci++]=rfc1421alphabet[(b0>>>2)&0x3f];
- c[ci++]=rfc1421alphabet[(b0<<4)&0x3f|(b1>>>4)&0x0f];
- c[ci++]=rfc1421alphabet[(b1<<2)&0x3f|(b2>>>6)&0x03];
- c[ci++]=rfc1421alphabet[b2&077];
+ c[ci++]=__rfc1421alphabet[(b0>>>2)&0x3f];
+ c[ci++]=__rfc1421alphabet[(b0<<4)&0x3f|(b1>>>4)&0x0f];
+ c[ci++]=__rfc1421alphabet[(b1<<2)&0x3f|(b2>>>6)&0x03];
+ c[ci++]=__rfc1421alphabet[b2&077];
l+=4;
- if (rfc2045 && l%76==0)
+ if (l%76==0)
{
c[ci++]=13;
c[ci++]=10;
@@ -155,18 +204,18 @@ public class B64Code
case 2:
b0=b[bi++];
b1=b[bi++];
- c[ci++]=rfc1421alphabet[(b0>>>2)&0x3f];
- c[ci++]=rfc1421alphabet[(b0<<4)&0x3f|(b1>>>4)&0x0f];
- c[ci++]=rfc1421alphabet[(b1<<2)&0x3f];
- c[ci++]=pad;
+ c[ci++]=__rfc1421alphabet[(b0>>>2)&0x3f];
+ c[ci++]=__rfc1421alphabet[(b0<<4)&0x3f|(b1>>>4)&0x0f];
+ c[ci++]=__rfc1421alphabet[(b1<<2)&0x3f];
+ c[ci++]=__pad;
break;
case 1:
b0=b[bi++];
- c[ci++]=rfc1421alphabet[(b0>>>2)&0x3f];
- c[ci++]=rfc1421alphabet[(b0<<4)&0x3f];
- c[ci++]=pad;
- c[ci++]=pad;
+ c[ci++]=__rfc1421alphabet[(b0>>>2)&0x3f];
+ c[ci++]=__rfc1421alphabet[(b0<<4)&0x3f];
+ c[ci++]=__pad;
+ c[ci++]=__pad;
break;
default:
@@ -174,11 +223,8 @@ public class B64Code
}
}
- if (rfc2045)
- {
- c[ci++]=13;
- c[ci++]=10;
- }
+ c[ci++]=13;
+ c[ci++]=10;
return c;
}
@@ -226,7 +272,7 @@ public class B64Code
throw new IllegalArgumentException("Input block size is not 4");
int li=bLen-1;
- while (li>=0 && b[li]==(byte)pad)
+ while (li>=0 && b[li]==(byte)__pad)
li--;
if (li<0)
@@ -243,10 +289,10 @@ public class B64Code
{
while (ri>>4);
@@ -270,8 +316,8 @@ public class B64Code
break;
case 1:
- b0=rfc1421nibbles[b[bi++]];
- b1=rfc1421nibbles[b[bi++]];
+ b0=__rfc1421nibbles[b[bi++]];
+ b1=__rfc1421nibbles[b[bi++]];
if (b0<0 || b1<0)
throw new IllegalArgumentException("Not B64 encoded");
r[ri++]=(byte)(b0<<2|b1>>>4);
@@ -314,17 +360,17 @@ public class B64Code
{
char c=encoded.charAt(ci++);
- if (c==pad)
+ if (c==__pad)
break;
if (Character.isWhitespace(c))
continue;
- byte nibble=rfc1421nibbles[c];
+ byte nibble=__rfc1421nibbles[c];
if (nibble<0)
throw new IllegalArgumentException("Not B64 encoded");
- nibbles[s++]=rfc1421nibbles[c];
+ nibbles[s++]=__rfc1421nibbles[c];
switch(s)
{
@@ -346,4 +392,36 @@ public class B64Code
return bout.toByteArray();
}
+
+ /* ------------------------------------------------------------ */
+ public static void encode(int value,Appendable buf) throws IOException
+ {
+ buf.append(__rfc1421alphabet[0x3f&((0xFC000000&value)>>26)]);
+ buf.append(__rfc1421alphabet[0x3f&((0x03F00000&value)>>20)]);
+ buf.append(__rfc1421alphabet[0x3f&((0x000FC000&value)>>14)]);
+ buf.append(__rfc1421alphabet[0x3f&((0x00003F00&value)>>8)]);
+ buf.append(__rfc1421alphabet[0x3f&((0x000000FC&value)>>2)]);
+ buf.append(__rfc1421alphabet[0x3f&((0x00000003&value)<<4)]);
+ buf.append('=');
+ }
+
+ /* ------------------------------------------------------------ */
+ public static void encode(long lvalue,Appendable buf) throws IOException
+ {
+ int value=(int)(0xFFFFFFFC&(lvalue>>32));
+ buf.append(__rfc1421alphabet[0x3f&((0xFC000000&value)>>26)]);
+ buf.append(__rfc1421alphabet[0x3f&((0x03F00000&value)>>20)]);
+ buf.append(__rfc1421alphabet[0x3f&((0x000FC000&value)>>14)]);
+ buf.append(__rfc1421alphabet[0x3f&((0x00003F00&value)>>8)]);
+ buf.append(__rfc1421alphabet[0x3f&((0x000000FC&value)>>2)]);
+
+ buf.append(__rfc1421alphabet[0x3f&((0x00000003&value)<<4) + (0xf&(int)(lvalue>>28))]);
+
+ value=0x0FFFFFFF&(int)lvalue;
+ buf.append(__rfc1421alphabet[0x3f&((0x0FC00000&value)>>22)]);
+ buf.append(__rfc1421alphabet[0x3f&((0x003F0000&value)>>16)]);
+ buf.append(__rfc1421alphabet[0x3f&((0x0000FC00&value)>>10)]);
+ buf.append(__rfc1421alphabet[0x3f&((0x000003F0&value)>>4)]);
+ buf.append(__rfc1421alphabet[0x3f&((0x0000000F&value)<<2)]);
+ }
}
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/BlockingArrayQueue.java b/jetty-util/src/main/java/org/eclipse/jetty/util/BlockingArrayQueue.java
index bc436770572..db62ac7f816 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/BlockingArrayQueue.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/BlockingArrayQueue.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ByteArrayISO8859Writer.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ByteArrayISO8859Writer.java
index ec7d653b31d..3787a801c79 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/ByteArrayISO8859Writer.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ByteArrayISO8859Writer.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ByteArrayOutputStream2.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ByteArrayOutputStream2.java
index b370bfddbd4..397095b9407 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/ByteArrayOutputStream2.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ByteArrayOutputStream2.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ConcurrentHashSet.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ConcurrentHashSet.java
index 1e243283b31..16b8667540e 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/ConcurrentHashSet.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ConcurrentHashSet.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/DateCache.java b/jetty-util/src/main/java/org/eclipse/jetty/util/DateCache.java
index 2486d870e53..1b78d2d38f8 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/DateCache.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/DateCache.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/HostMap.java b/jetty-util/src/main/java/org/eclipse/jetty/util/HostMap.java
index c2fadb40d12..293b4874e0f 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/HostMap.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/HostMap.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/IO.java b/jetty-util/src/main/java/org/eclipse/jetty/util/IO.java
index 1373b4a6898..f0a3d9ed1c9 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/IO.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/IO.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/IPAddressMap.java b/jetty-util/src/main/java/org/eclipse/jetty/util/IPAddressMap.java
index bfa5f630124..222867b6793 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/IPAddressMap.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/IPAddressMap.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/IntrospectionUtil.java b/jetty-util/src/main/java/org/eclipse/jetty/util/IntrospectionUtil.java
index bae14793b7e..d69b15a4d74 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/IntrospectionUtil.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/IntrospectionUtil.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/LazyList.java b/jetty-util/src/main/java/org/eclipse/jetty/util/LazyList.java
index 977acdb093f..b91eaff38fe 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/LazyList.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/LazyList.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/Loader.java b/jetty-util/src/main/java/org/eclipse/jetty/util/Loader.java
index 2c25bfc4510..d75600b86fc 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/Loader.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/Loader.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -47,7 +47,6 @@ public class Loader
{
/* ------------------------------------------------------------ */
public static URL getResource(Class> loadClass,String name, boolean checkParents)
- throws ClassNotFoundException
{
URL url =null;
ClassLoader loader=Thread.currentThread().getContextClassLoader();
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/MultiException.java b/jetty-util/src/main/java/org/eclipse/jetty/util/MultiException.java
index ff0b7f4dd7d..c06d4fdfbc8 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/MultiException.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/MultiException.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/MultiMap.java b/jetty-util/src/main/java/org/eclipse/jetty/util/MultiMap.java
index 9220d8151d5..c8bc47ee84d 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/MultiMap.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/MultiMap.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/MultiPartInputStream.java b/jetty-util/src/main/java/org/eclipse/jetty/util/MultiPartInputStream.java
index 86c02b4cb74..56539a61275 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/MultiPartInputStream.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/MultiPartInputStream.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -45,6 +45,9 @@ import javax.servlet.MultipartConfigElement;
import javax.servlet.ServletException;
import javax.servlet.http.Part;
+import org.eclipse.jetty.util.log.Log;
+import org.eclipse.jetty.util.log.Logger;
+
/**
@@ -54,6 +57,8 @@ import javax.servlet.http.Part;
*/
public class MultiPartInputStream
{
+ private static final Logger LOG = Log.getLogger(MultiPartInputStream.class);
+
public static final MultipartConfigElement __DEFAULT_MULTIPART_CONFIG = new MultipartConfigElement(System.getProperty("java.io.tmpdir"));
protected InputStream _in;
protected MultipartConfigElement _config;
@@ -332,7 +337,7 @@ public class MultiPartInputStream
*/
public MultiPartInputStream (InputStream in, String contentType, MultipartConfigElement config, File contextTmpDir)
{
- _in = new BufferedInputStream(in);
+ _in = new ReadLineInputStream(in);
_contentType = contentType;
_config = config;
_contextTmpDir = contextTmpDir;
@@ -467,17 +472,35 @@ public class MultiPartInputStream
if (!_tmpDir.exists())
_tmpDir.mkdirs();
- String boundary="--"+QuotedStringTokenizer.unquote(value(_contentType.substring(_contentType.indexOf("boundary=")), true).trim());
+ String contentTypeBoundary = "";
+ if (_contentType.indexOf("boundary=") >= 0)
+ contentTypeBoundary = QuotedStringTokenizer.unquote(value(_contentType.substring(_contentType.indexOf("boundary=")), true).trim());
+
+ String boundary="--"+contentTypeBoundary;
byte[] byteBoundary=(boundary+"--").getBytes(StringUtil.__ISO_8859_1);
// Get first boundary
- byte[] bytes=TypeUtil.readLine(_in);
- String line=bytes==null?null:new String(bytes,"UTF-8");
- if(line==null || !line.equals(boundary))
+ String line=((ReadLineInputStream)_in).readLine();
+
+ if (line == null)
+ throw new IOException("Missing content for multipart request");
+
+ boolean badFormatLogged = false;
+ line=line.trim();
+ while (line != null && !line.equals(boundary))
{
- throw new IOException("Missing initial multi part boundary");
+ if (!badFormatLogged)
+ {
+ LOG.warn("Badly formatted multipart request");
+ badFormatLogged = true;
+ }
+ line=((ReadLineInputStream)_in).readLine();
+ line=(line==null?line:line.trim());
}
+ if (line == null)
+ throw new IOException("Missing initial multi part boundary");
+
// Read each part
boolean lastPart=false;
String contentDisposition=null;
@@ -488,19 +511,19 @@ public class MultiPartInputStream
MultiMap headers = new MultiMap();
while(true)
{
- bytes=TypeUtil.readLine(_in);
- if(bytes==null)
+ line=((ReadLineInputStream)_in).readLine();
+
+ //No more input
+ if(line==null)
break outer;
// If blank line, end of part headers
- if(bytes.length==0)
+ if("".equals(line))
break;
- total += bytes.length;
+ total += line.length();
if (_config.getMaxRequestSize() > 0 && total > _config.getMaxRequestSize())
throw new IllegalStateException ("Request exceeds maxRequestSize ("+_config.getMaxRequestSize()+")");
-
- line=new String(bytes,"UTF-8");
//get content-disposition and content-type
int c=line.indexOf(':',0);
@@ -526,7 +549,7 @@ public class MultiPartInputStream
throw new IOException("Missing content-disposition");
}
- QuotedStringTokenizer tok=new QuotedStringTokenizer(contentDisposition,";");
+ QuotedStringTokenizer tok=new QuotedStringTokenizer(contentDisposition,";", false, true);
String name=null;
String filename=null;
while(tok.hasMoreTokens())
@@ -538,7 +561,7 @@ public class MultiPartInputStream
else if(tl.startsWith("name="))
name=value(t, true);
else if(tl.startsWith("filename="))
- filename=value(t, false);
+ filename=filenameValue(t);
}
// Check disposition
@@ -601,7 +624,7 @@ public class MultiPartInputStream
boolean cr=false;
boolean lf=false;
- // loop for all lines`
+ // loop for all lines
while(true)
{
int b=0;
@@ -616,7 +639,14 @@ public class MultiPartInputStream
if(c==13||c==10)
{
if(c==13)
- state=_in.read();
+ {
+ _in.mark(1);
+ int tmp=_in.read();
+ if (tmp!=10)
+ _in.reset();
+ else
+ state=tmp;
+ }
break;
}
// look for boundary
@@ -699,6 +729,7 @@ public class MultiPartInputStream
/* ------------------------------------------------------------ */
private String value(String nameEqualsValue, boolean splitAfterSpace)
{
+ /*
String value=nameEqualsValue.substring(nameEqualsValue.indexOf('=')+1).trim();
int i=value.indexOf(';');
if(i>0)
@@ -714,6 +745,38 @@ public class MultiPartInputStream
value=value.substring(0,i);
}
return value;
+ */
+ int idx = nameEqualsValue.indexOf('=');
+ String value = nameEqualsValue.substring(idx+1).trim();
+ return QuotedStringTokenizer.unquoteOnly(value);
+ }
+
+
+ /* ------------------------------------------------------------ */
+ private String filenameValue(String nameEqualsValue)
+ {
+ int idx = nameEqualsValue.indexOf('=');
+ String value = nameEqualsValue.substring(idx+1).trim();
+
+ if (value.matches(".??[a-z,A-Z]\\:\\\\[^\\\\].*"))
+ {
+ //incorrectly escaped IE filenames that have the whole path
+ //we just strip any leading & trailing quotes and leave it as is
+ char first=value.charAt(0);
+ if (first=='"' || first=='\'')
+ value=value.substring(1);
+ char last=value.charAt(value.length()-1);
+ if (last=='"' || last=='\'')
+ value = value.substring(0,value.length()-1);
+
+ return value;
+ }
+ else
+ //unquote the string, but allow any backslashes that don't
+ //form a valid escape sequence to remain as many browsers
+ //even on *nix systems will not escape a filename containing
+ //backslashes
+ return QuotedStringTokenizer.unquoteOnly(value, true);
}
private static class Base64InputStream extends InputStream
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/MultiPartOutputStream.java b/jetty-util/src/main/java/org/eclipse/jetty/util/MultiPartOutputStream.java
index 17f3c8f202e..27d85dfc479 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/MultiPartOutputStream.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/MultiPartOutputStream.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -98,7 +98,8 @@ public class MultiPartOutputStream extends FilterOutputStream
out.write(__DASHDASH);
out.write(boundaryBytes);
out.write(__CRLF);
- out.write(("Content-Type: "+contentType).getBytes(StringUtil.__ISO_8859_1));
+ if (contentType != null)
+ out.write(("Content-Type: "+contentType).getBytes(StringUtil.__ISO_8859_1));
out.write(__CRLF);
out.write(__CRLF);
}
@@ -115,7 +116,8 @@ public class MultiPartOutputStream extends FilterOutputStream
out.write(__DASHDASH);
out.write(boundaryBytes);
out.write(__CRLF);
- out.write(("Content-Type: "+contentType).getBytes(StringUtil.__ISO_8859_1));
+ if (contentType != null)
+ out.write(("Content-Type: "+contentType).getBytes(StringUtil.__ISO_8859_1));
out.write(__CRLF);
for (int i=0;headers!=null && im)
+ return new String(buf,m,pos-m,StringUtil.__UTF8_CHARSET);
+
+ return null;
+ }
+
+ if (b=='\r')
+ {
+ int p=pos;
+
+ // if we have seen CRLF before, hungrily consume LF
+ if (_seenCRLF && pos0)
+ {
+ _skipLF=false;
+ if (_seenCRLF)
+ {
+ int b = super.read();
+ if (b==-1)
+ return -1;
+
+ if (b!='\n')
+ {
+ buf[off]=(byte)(0xff&b);
+ return 1+super.read(buf,off+1,len-1);
+ }
+ }
+ }
+
+ return super.read(buf,off,len);
+ }
+
+
+}
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/RolloverFileOutputStream.java b/jetty-util/src/main/java/org/eclipse/jetty/util/RolloverFileOutputStream.java
index fffada8bd33..48c173dbfbc 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/RolloverFileOutputStream.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/RolloverFileOutputStream.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/Scanner.java b/jetty-util/src/main/java/org/eclipse/jetty/util/Scanner.java
index a6d146e8c93..23d8c3b3807 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/Scanner.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/Scanner.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/StringMap.java b/jetty-util/src/main/java/org/eclipse/jetty/util/StringMap.java
index 242c0d1c619..8d8b26f1b2e 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/StringMap.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/StringMap.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/StringUtil.java b/jetty-util/src/main/java/org/eclipse/jetty/util/StringUtil.java
index ce8b477ad23..4e6e9108727 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/StringUtil.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/StringUtil.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/TypeUtil.java b/jetty-util/src/main/java/org/eclipse/jetty/util/TypeUtil.java
index 6246bc104b1..6a466a8be82 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/TypeUtil.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/TypeUtil.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -278,13 +278,7 @@ public class TypeUtil
{
char c=s.charAt(offset+i);
- int digit=c-'0';
- if (digit<0 || digit>=base || digit>=10)
- {
- digit=10+c-'A';
- if (digit<10 || digit>=base)
- digit=10+c-'a';
- }
+ int digit=convertHexDigit((int)c);
if (digit<0 || digit>=base)
throw new NumberFormatException(s.substring(offset,offset+length));
value=value*base+digit;
@@ -358,15 +352,28 @@ public class TypeUtil
/* ------------------------------------------------------------ */
/**
- * @param b An ASCII encoded character 0-9 a-f A-F
+ * @param c An ASCII encoded character 0-9 a-f A-F
* @return The byte value of the character 0-16.
*/
- public static byte convertHexDigit( byte b )
+ public static byte convertHexDigit( byte c )
{
- if ((b >= '0') && (b <= '9')) return (byte)(b - '0');
- if ((b >= 'a') && (b <= 'f')) return (byte)(b - 'a' + 10);
- if ((b >= 'A') && (b <= 'F')) return (byte)(b - 'A' + 10);
- throw new IllegalArgumentException("!hex:"+Integer.toHexString(0xff&b));
+ byte b = (byte)((c & 0x1f) + ((c >> 6) * 0x19) - 0x10);
+ if (b<0 || b>15)
+ throw new IllegalArgumentException("!hex "+c);
+ return b;
+ }
+
+ /* ------------------------------------------------------------ */
+ /**
+ * @param c An ASCII encoded character 0-9 a-f A-F
+ * @return The byte value of the character 0-16.
+ */
+ public static int convertHexDigit( int c )
+ {
+ int d= ((c & 0x1f) + ((c >> 6) * 0x19) - 0x10);
+ if (d<0 || d>15)
+ throw new NumberFormatException("!hex "+c);
+ return d;
}
/* ------------------------------------------------------------ */
@@ -374,15 +381,10 @@ public class TypeUtil
{
try
{
- int bi=0xff&b;
- int c='0'+(bi/16)%16;
- if (c>'9')
- c= 'A'+(c-'0'-10);
- buf.append((char)c);
- c='0'+bi%16;
- if (c>'9')
- c= 'A'+(c-'0'-10);
- buf.append((char)c);
+ int d=0xf&((0xF0&b)>>4);
+ buf.append((char)((d>9?('A'-10):'0')+d));
+ d=0xf&b;
+ buf.append((char)((d>9?('A'-10):'0')+d));
}
catch(IOException e)
{
@@ -390,6 +392,37 @@ public class TypeUtil
}
}
+ /* ------------------------------------------------------------ */
+ public static void toHex(int value,Appendable buf) throws IOException
+ {
+ int d=0xf&((0xF0000000&value)>>28);
+ buf.append((char)((d>9?('A'-10):'0')+d));
+ d=0xf&((0x0F000000&value)>>24);
+ buf.append((char)((d>9?('A'-10):'0')+d));
+ d=0xf&((0x00F00000&value)>>20);
+ buf.append((char)((d>9?('A'-10):'0')+d));
+ d=0xf&((0x000F0000&value)>>16);
+ buf.append((char)((d>9?('A'-10):'0')+d));
+ d=0xf&((0x0000F000&value)>>12);
+ buf.append((char)((d>9?('A'-10):'0')+d));
+ d=0xf&((0x00000F00&value)>>8);
+ buf.append((char)((d>9?('A'-10):'0')+d));
+ d=0xf&((0x000000F0&value)>>4);
+ buf.append((char)((d>9?('A'-10):'0')+d));
+ d=0xf&value;
+ buf.append((char)((d>9?('A'-10):'0')+d));
+
+ Integer.toString(0,36);
+ }
+
+
+ /* ------------------------------------------------------------ */
+ public static void toHex(long value,Appendable buf) throws IOException
+ {
+ toHex((int)(value>>32),buf);
+ toHex((int)value,buf);
+ }
+
/* ------------------------------------------------------------ */
public static String toHexString(byte b)
{
@@ -454,6 +487,9 @@ public class TypeUtil
/* ------------------------------------------------------------ */
+ /**
+ * @deprecated
+ */
public static byte[] readLine(InputStream in) throws IOException
{
byte[] buf = new byte[256];
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/URIUtil.java b/jetty-util/src/main/java/org/eclipse/jetty/util/URIUtil.java
index 524295e29f0..834e8769115 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/URIUtil.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/URIUtil.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java b/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java
index 05bd29686a7..6824efcdd34 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -18,6 +18,8 @@
package org.eclipse.jetty.util;
+import static org.eclipse.jetty.util.TypeUtil.convertHexDigit;
+
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -224,10 +226,7 @@ public class UrlEncoded extends MultiMap implements Cloneable
key = null;
value=null;
if (maxKeys>0 && map.size()>maxKeys)
- {
- LOG.warn("maxFormKeys limit exceeded keys>{}",maxKeys);
- return;
- }
+ throw new IllegalStateException("Form too many keys");
break;
case '=':
if (key!=null)
@@ -331,7 +330,16 @@ public class UrlEncoded extends MultiMap implements Cloneable
case '%':
if (i+20 && map.size()>maxKeys)
- {
- LOG.warn("maxFormKeys limit exceeded keys>{}",maxKeys);
- return;
- }
+ throw new IllegalStateException("Form too many keys");
break;
case '=':
@@ -417,12 +422,29 @@ public class UrlEncoded extends MultiMap implements Cloneable
break;
case '%':
- int dh=in.read();
- int dl=in.read();
- if (dh<0||dl<0)
- break;
- buffer.append((char)((TypeUtil.convertHexDigit((byte)dh)<<4) + TypeUtil.convertHexDigit((byte)dl)));
+ int code0=in.read();
+ if ('u'==code0)
+ {
+ int code1=in.read();
+ if (code1>=0)
+ {
+ int code2=in.read();
+ if (code2>=0)
+ {
+ int code3=in.read();
+ if (code3>=0)
+ buffer.append(Character.toChars((convertHexDigit(code0)<<12)+(convertHexDigit(code1)<<8)+(convertHexDigit(code2)<<4)+convertHexDigit(code3)));
+ }
+ }
+ }
+ else if (code0>=0)
+ {
+ int code1=in.read();
+ if (code1>=0)
+ buffer.append((char)((convertHexDigit(code0)<<4)+convertHexDigit(code1)));
+ }
break;
+
default:
buffer.append((char)b);
break;
@@ -483,10 +505,7 @@ public class UrlEncoded extends MultiMap implements Cloneable
key = null;
value=null;
if (maxKeys>0 && map.size()>maxKeys)
- {
- LOG.warn("maxFormKeys limit exceeded keys>{}",maxKeys);
- return;
- }
+ throw new IllegalStateException("Form too many keys");
break;
case '=':
@@ -504,12 +523,29 @@ public class UrlEncoded extends MultiMap implements Cloneable
break;
case '%':
- int dh=in.read();
- int dl=in.read();
- if (dh<0||dl<0)
- break;
- buffer.append((byte)((TypeUtil.convertHexDigit((byte)dh)<<4) + TypeUtil.convertHexDigit((byte)dl)));
+ int code0=in.read();
+ if ('u'==code0)
+ {
+ int code1=in.read();
+ if (code1>=0)
+ {
+ int code2=in.read();
+ if (code2>=0)
+ {
+ int code3=in.read();
+ if (code3>=0)
+ buffer.getStringBuilder().append(Character.toChars((convertHexDigit(code0)<<12)+(convertHexDigit(code1)<<8)+(convertHexDigit(code2)<<4)+convertHexDigit(code3)));
+ }
+ }
+ }
+ else if (code0>=0)
+ {
+ int code1=in.read();
+ if (code1>=0)
+ buffer.append((byte)((convertHexDigit(code0)<<4)+convertHexDigit(code1)));
+ }
break;
+
default:
buffer.append((byte)b);
break;
@@ -544,7 +580,7 @@ public class UrlEncoded extends MultiMap implements Cloneable
StringWriter buf = new StringWriter(8192);
IO.copy(input,buf,maxLength);
- decodeTo(buf.getBuffer().toString(),map,ENCODING,maxKeys);
+ decodeTo(buf.getBuffer().toString(),map,StringUtil.__UTF16,maxKeys);
}
/* -------------------------------------------------------------- */
@@ -585,8 +621,6 @@ public class UrlEncoded extends MultiMap implements Cloneable
String value = null;
int c;
- int digit=0;
- int digits=0;
int totalLength = 0;
ByteArrayOutputStream2 output = new ByteArrayOutputStream2();
@@ -611,6 +645,8 @@ public class UrlEncoded extends MultiMap implements Cloneable
}
key = null;
value=null;
+ if (maxKeys>0 && map.size()>maxKeys)
+ throw new IllegalStateException("Form too many keys");
break;
case '=':
if (key!=null)
@@ -626,21 +662,31 @@ public class UrlEncoded extends MultiMap implements Cloneable
output.write(' ');
break;
case '%':
- digits=2;
+ int code0=in.read();
+ if ('u'==code0)
+ {
+ int code1=in.read();
+ if (code1>=0)
+ {
+ int code2=in.read();
+ if (code2>=0)
+ {
+ int code3=in.read();
+ if (code3>=0)
+ output.write(new String(Character.toChars((convertHexDigit(code0)<<12)+(convertHexDigit(code1)<<8)+(convertHexDigit(code2)<<4)+convertHexDigit(code3))).getBytes(charset));
+ }
+ }
+
+ }
+ else if (code0>=0)
+ {
+ int code1=in.read();
+ if (code1>=0)
+ output.write((convertHexDigit(code0)<<4)+convertHexDigit(code1));
+ }
break;
default:
- if (digits==2)
- {
- digit=TypeUtil.convertHexDigit((byte)c);
- digits=1;
- }
- else if (digits==1)
- {
- output.write((digit<<4) + TypeUtil.convertHexDigit((byte)c));
- digits=0;
- }
- else
- output.write(c);
+ output.write(c);
break;
}
@@ -695,24 +741,45 @@ public class UrlEncoded extends MultiMap implements Cloneable
buffer.getStringBuffer().append(' ');
}
- else if (c=='%' && (i+2)
- *
- *
+ * If a JSON object has a "class" field, then a java class for that name is
+ * looked up and the method {@link convertTo(Class,Map)} is used to find a
+ * Convertor for that class. If a JSON object has a "x-class" field then a
+ * direct lookup for a Convertor for that named x-class is done, so that none
+ * java classes may be converted.
+ *
*/
public class JSON
{
@@ -945,6 +949,15 @@ public class JSON
next = seekTo("\"}",source);
}
+ String xclassname = (String)map.get("x-class");
+ if (xclassname != null)
+ {
+ Convertor c = getConvertorFor(xclassname);
+ if (c != null)
+ return c.fromJSON(map);
+ LOG.warn("no Convertor for xclassname '%s'", xclassname);
+ }
+
String classname = (String)map.get("class");
if (classname != null)
{
@@ -955,9 +968,10 @@ public class JSON
}
catch (ClassNotFoundException e)
{
- LOG.warn(e);
+ LOG.warn("no Class for classname '%s'", classname);
}
}
+
return map;
}
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSONDateConvertor.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSONDateConvertor.java
index c4082eb3e93..a244b1fc7c8 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSONDateConvertor.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSONDateConvertor.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSONEnumConvertor.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSONEnumConvertor.java
index 1b802154602..3d90eaa7de0 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSONEnumConvertor.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSONEnumConvertor.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSONObjectConvertor.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSONObjectConvertor.java
index f2e823deab9..9e3f64e619c 100755
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSONObjectConvertor.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSONObjectConvertor.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSONPojoConvertor.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSONPojoConvertor.java
index b0196fc49b5..e74b45091a1 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSONPojoConvertor.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSONPojoConvertor.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorFactory.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorFactory.java
index 1cda379f626..617182d7f7f 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorFactory.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorFactory.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/component/AbstractLifeCycle.java b/jetty-util/src/main/java/org/eclipse/jetty/util/component/AbstractLifeCycle.java
index 5c8a082072b..fd24e559a9a 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/component/AbstractLifeCycle.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/component/AbstractLifeCycle.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/component/AggregateLifeCycle.java b/jetty-util/src/main/java/org/eclipse/jetty/util/component/AggregateLifeCycle.java
index 780a8df77b2..349a2b667a8 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/component/AggregateLifeCycle.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/component/AggregateLifeCycle.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/component/Container.java b/jetty-util/src/main/java/org/eclipse/jetty/util/component/Container.java
index 6dcc9789b57..7f51a1d56b7 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/component/Container.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/component/Container.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/component/Destroyable.java b/jetty-util/src/main/java/org/eclipse/jetty/util/component/Destroyable.java
index ec1445b2cec..f0a3b040d00 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/component/Destroyable.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/component/Destroyable.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/component/Dumpable.java b/jetty-util/src/main/java/org/eclipse/jetty/util/component/Dumpable.java
index f95d3f1f987..631f3c2677b 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/component/Dumpable.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/component/Dumpable.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/component/FileDestroyable.java b/jetty-util/src/main/java/org/eclipse/jetty/util/component/FileDestroyable.java
index 5e46483044a..e38eb8b35d5 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/component/FileDestroyable.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/component/FileDestroyable.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/component/LifeCycle.java b/jetty-util/src/main/java/org/eclipse/jetty/util/component/LifeCycle.java
index 1ee9e16a60b..864e4e2ba2a 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/component/LifeCycle.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/component/LifeCycle.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/AbstractLogger.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/AbstractLogger.java
index 7ae0ad4905d..f313b5696bd 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/AbstractLogger.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/log/AbstractLogger.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/JavaUtilLog.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/JavaUtilLog.java
index 519962cf7ca..eafacca3337 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/JavaUtilLog.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/log/JavaUtilLog.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/JettyAwareLogger.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/JettyAwareLogger.java
index 7e5b734584b..94d87ddd5cd 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/JettyAwareLogger.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/log/JettyAwareLogger.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Log.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Log.java
index ab2486ea935..88da1a6ada3 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Log.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Log.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -91,7 +91,7 @@ public class Log
* configuration of the Log class in situations where access to the System.properties are
* either too late or just impossible.
*/
- URL testProps = Log.class.getClassLoader().getResource("jetty-logging.properties");
+ URL testProps = Loader.getResource(Log.class,"jetty-logging.properties",true);
if (testProps != null)
{
InputStream in = null;
@@ -234,7 +234,7 @@ public class Log
public static void setLogToParent(String name)
{
ClassLoader loader = Log.class.getClassLoader();
- if (loader.getParent()!=null)
+ if (loader!=null && loader.getParent()!=null)
{
try
{
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Logger.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Logger.java
index 192d4f5de71..afe405cc710 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Logger.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Logger.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/LoggerLog.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/LoggerLog.java
index 32e95232318..7909ced4133 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/LoggerLog.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/log/LoggerLog.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Slf4jLog.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Slf4jLog.java
index 7eece9f8b8e..d9ebd177b2d 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Slf4jLog.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Slf4jLog.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/StdErrLog.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/StdErrLog.java
index 39f0fa918ec..5ceb3cca8a8 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/StdErrLog.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/log/StdErrLog.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/AWTLeakPreventer.java b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/AWTLeakPreventer.java
index f70ddec0b95..d4bd4755489 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/AWTLeakPreventer.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/AWTLeakPreventer.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/AbstractLeakPreventer.java b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/AbstractLeakPreventer.java
index 17a4fef8bd9..33e18b03013 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/AbstractLeakPreventer.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/AbstractLeakPreventer.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/AppContextLeakPreventer.java b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/AppContextLeakPreventer.java
index 7820c7be773..36965b6eb94 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/AppContextLeakPreventer.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/AppContextLeakPreventer.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/DOMLeakPreventer.java b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/DOMLeakPreventer.java
index 4ac6fde3e1c..d42d75a7e50 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/DOMLeakPreventer.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/DOMLeakPreventer.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/DriverManagerLeakPreventer.java b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/DriverManagerLeakPreventer.java
index 6f37264b621..03977ee5cc5 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/DriverManagerLeakPreventer.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/DriverManagerLeakPreventer.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/GCThreadLeakPreventer.java b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/GCThreadLeakPreventer.java
index c7903916296..34e3ba60068 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/GCThreadLeakPreventer.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/GCThreadLeakPreventer.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/Java2DLeakPreventer.java b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/Java2DLeakPreventer.java
index ab2abf4d3d6..47b09f7307e 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/Java2DLeakPreventer.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/Java2DLeakPreventer.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/LDAPLeakPreventer.java b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/LDAPLeakPreventer.java
index 0c0d9ffbc40..71560c704a4 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/LDAPLeakPreventer.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/LDAPLeakPreventer.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/LoginConfigurationLeakPreventer.java b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/LoginConfigurationLeakPreventer.java
index 2b0eb77f0e5..3bdcfc09817 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/LoginConfigurationLeakPreventer.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/LoginConfigurationLeakPreventer.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/SecurityProviderLeakPreventer.java b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/SecurityProviderLeakPreventer.java
index 632122f5436..9573944ed28 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/SecurityProviderLeakPreventer.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/preventers/SecurityProviderLeakPreventer.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/BadResource.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/BadResource.java
index a9a9d508316..d796ecfb1b9 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/BadResource.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/BadResource.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/FileResource.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/FileResource.java
index 211de5ba5fc..add7e67b0c4 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/FileResource.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/FileResource.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -86,6 +86,10 @@ public class FileResource extends URLResource
// Try standard API to convert URL to file.
_file =new File(new URI(url.toString()));
}
+ catch (URISyntaxException e)
+ {
+ throw e;
+ }
catch (Exception e)
{
LOG.ignore(e);
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarFileResource.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarFileResource.java
index cbf95d6b20c..e6752f0d0ba 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarFileResource.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarFileResource.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarResource.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarResource.java
index 62ac81eb295..971d8f1409f 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarResource.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarResource.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java
index bc13427e07e..688d4a530a5 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -31,6 +31,7 @@ import java.text.DateFormat;
import java.util.Arrays;
import java.util.Date;
+import org.eclipse.jetty.util.B64Code;
import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.Loader;
import org.eclipse.jetty.util.StringUtil;
@@ -48,7 +49,8 @@ public abstract class Resource implements ResourceFactory
private static final Logger LOG = Log.getLogger(Resource.class);
public static boolean __defaultUseCaches = true;
volatile Object _associate;
-
+
+ /* ------------------------------------------------------------ */
/**
* Change the default setting for url connection caches.
* Subsequent URLConnections will use this default.
@@ -187,20 +189,6 @@ public abstract class Resource implements ResourceFactory
}
}
- // Make sure that any special characters stripped really are ignorable.
- String nurl=url.toString();
- if (nurl.length()>0 && nurl.charAt(nurl.length()-1)!=resource.charAt(resource.length()-1))
- {
- if ((nurl.charAt(nurl.length()-1)!='/' ||
- nurl.charAt(nurl.length()-2)!=resource.charAt(resource.length()-1))
- &&
- (resource.charAt(resource.length()-1)!='/' ||
- resource.charAt(resource.length()-2)!=nurl.charAt(nurl.length()-1)
- ))
- {
- return new BadResource(url,"Trailing special characters stripped by URL in "+resource);
- }
- }
return newResource(url);
}
@@ -296,16 +284,7 @@ public abstract class Resource implements ResourceFactory
URL url=Resource.class.getResource(name);
if (url==null)
- {
- try
- {
- url=Loader.getResource(Resource.class,name,checkParents);
- }
- catch(ClassNotFoundException e)
- {
- url=ClassLoader.getSystemResource(name);
- }
- }
+ url=Loader.getResource(Resource.class,name,checkParents);
if (url==null)
return null;
return newResource(url,useCaches);
@@ -662,6 +641,31 @@ public abstract class Resource implements ResourceFactory
writeTo(new FileOutputStream(destination),0,-1);
}
+ /* ------------------------------------------------------------ */
+ public String getWeakETag()
+ {
+ try
+ {
+ StringBuilder b = new StringBuilder(32);
+ b.append("W/\"");
+
+ String name=getName();
+ int length=name.length();
+ long lhash=0;
+ for (int i=0; i parts = mpis.getParts();
+ assertThat(parts.size(), is(4));
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ Part fileName = mpis.getPart("fileName");
+ assertThat(fileName, notNullValue());
+ assertThat(fileName.getSize(), is(3L));
+ IO.copy(fileName.getInputStream(), baos);
+ assertThat(baos.toString("US-ASCII"), is("abc"));
+
+ baos = new ByteArrayOutputStream();
+ Part desc = mpis.getPart("desc");
+ assertThat(desc, notNullValue());
+ assertThat(desc.getSize(), is(3L));
+ IO.copy(desc.getInputStream(), baos);
+ assertThat(baos.toString("US-ASCII"), is("123"));
+
+ baos = new ByteArrayOutputStream();
+ Part title = mpis.getPart("title");
+ assertThat(title, notNullValue());
+ assertThat(title.getSize(), is(3L));
+ IO.copy(title.getInputStream(), baos);
+ assertThat(baos.toString("US-ASCII"), is("ttt"));
+ }
+ public void testNoBody()
+ throws Exception
+ {
+ String body = "";
+
+ MultipartConfigElement config = new MultipartConfigElement(_dirname, 1024, 3072, 50);
+ MultiPartInputStream mpis = new MultiPartInputStream(new ByteArrayInputStream(body.getBytes()),
+ _contentType,
+ config,
+ _tmpDir);
+ mpis.setDeleteOnExit(true);
+ try
+ {
+ mpis.getParts();
+ fail ("Multipart missing body");
+ }
+ catch (IOException e)
+ {
+ assertTrue(e.getMessage().startsWith("Missing content"));
+ }
+ }
+
+ public void testWhitespaceBodyWithCRLF()
+ throws Exception
+ {
+ String whitespace = " \n\n\n\r\n\r\n\r\n\r\n";
+
+
+ MultipartConfigElement config = new MultipartConfigElement(_dirname, 1024, 3072, 50);
+ MultiPartInputStream mpis = new MultiPartInputStream(new ByteArrayInputStream(whitespace.getBytes()),
+ _contentType,
+ config,
+ _tmpDir);
+ mpis.setDeleteOnExit(true);
+ try
+ {
+ mpis.getParts();
+ fail ("Multipart missing body");
+ }
+ catch (IOException e)
+ {
+ assertTrue(e.getMessage().startsWith("Missing initial"));
+ }
+ }
+
+ public void testWhitespaceBody()
+ throws Exception
+ {
+ String whitespace = " ";
+
+ MultipartConfigElement config = new MultipartConfigElement(_dirname, 1024, 3072, 50);
+ MultiPartInputStream mpis = new MultiPartInputStream(new ByteArrayInputStream(whitespace.getBytes()),
+ _contentType,
+ config,
+ _tmpDir);
+ mpis.setDeleteOnExit(true);
+ try
+ {
+ mpis.getParts();
+ fail ("Multipart missing body");
+ }
+ catch (IOException e)
+ {
+ assertTrue(e.getMessage().startsWith("Missing initial"));
+ }
+ }
+
+
+ public void testLeadingWhitespaceBodyWithCRLF()
+ throws Exception
+ {
+ String body = " \n\n\n\r\n\r\n\r\n\r\n"+
+ "--AaB03x\r\n"+
+ "content-disposition: form-data; name=\"field1\"\r\n"+
+ "\r\n"+
+ "Joe Blow\r\n"+
+ "--AaB03x\r\n"+
+ "content-disposition: form-data; name=\"stuff\"; filename=\"" + "foo.txt" + "\"\r\n"+
+ "Content-Type: text/plain\r\n"+
+ "\r\n"+"aaaa"+
+ "bbbbb"+"\r\n" +
+ "--AaB03x--\r\n";
+
+
+ MultipartConfigElement config = new MultipartConfigElement(_dirname, 1024, 3072, 50);
+ MultiPartInputStream mpis = new MultiPartInputStream(new ByteArrayInputStream(body.getBytes()),
+ _contentType,
+ config,
+ _tmpDir);
+ mpis.setDeleteOnExit(true);
+
+ Collection parts = mpis.getParts();
+ assertThat(parts, notNullValue());
+ assertThat(parts.size(), is(2));
+ Part field1 = mpis.getPart("field1");
+ assertThat(field1, notNullValue());
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ IO.copy(field1.getInputStream(), baos);
+ assertThat(baos.toString("US-ASCII"), is("Joe Blow"));
+
+ Part stuff = mpis.getPart("stuff");
+ assertThat(stuff, notNullValue());
+ baos = new ByteArrayOutputStream();
+ IO.copy(stuff.getInputStream(), baos);
+ assertTrue(baos.toString("US-ASCII").contains("aaaa"));
+ }
+
+
+
+
+ public void testLeadingWhitespaceBodyWithoutCRLF()
+ throws Exception
+ {
+ String body = " "+
+ "--AaB03x\r\n"+
+ "content-disposition: form-data; name=\"field1\"\r\n"+
+ "\r\n"+
+ "Joe Blow\r\n"+
+ "--AaB03x\r\n"+
+ "content-disposition: form-data; name=\"stuff\"; filename=\"" + "foo.txt" + "\"\r\n"+
+ "Content-Type: text/plain\r\n"+
+ "\r\n"+"aaaa"+
+ "bbbbb"+"\r\n" +
+ "--AaB03x--\r\n";
+
+ MultipartConfigElement config = new MultipartConfigElement(_dirname, 1024, 3072, 50);
+ MultiPartInputStream mpis = new MultiPartInputStream(new ByteArrayInputStream(body.getBytes()),
+ _contentType,
+ config,
+ _tmpDir);
+ mpis.setDeleteOnExit(true);
+
+ Collection parts = mpis.getParts();
+ assertThat(parts, notNullValue());
+ assertThat(parts.size(), is(2));
+ Part field1 = mpis.getPart("field1");
+ assertThat(field1, notNullValue());
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ IO.copy(field1.getInputStream(), baos);
+ assertThat(baos.toString("US-ASCII"), is("Joe Blow"));
+
+ Part stuff = mpis.getPart("stuff");
+ assertThat(stuff, notNullValue());
+ baos = new ByteArrayOutputStream();
+ IO.copy(stuff.getInputStream(), baos);
+ assertTrue(baos.toString("US-ASCII").contains("bbbbb"));
+ }
+
+
+
+
+
public void testNonMultiPartRequest()
throws Exception
{
+
MultipartConfigElement config = new MultipartConfigElement(_dirname, 1024, 3072, 50);
MultiPartInputStream mpis = new MultiPartInputStream(new ByteArrayInputStream(_multi.getBytes()),
"Content-type: text/plain",
@@ -195,7 +411,178 @@ public class MultiPartInputStreamTest extends TestCase
assertThat(stuff.exists(), is(false)); //tmp file was removed after cleanup
}
+
+ public void testLFOnlyRequest()
+ throws Exception
+ {
+ String str = "--AaB03x\n"+
+ "content-disposition: form-data; name=\"field1\"\n"+
+ "\n"+
+ "Joe Blow\n"+
+ "--AaB03x\n"+
+ "content-disposition: form-data; name=\"field2\"\n"+
+ "\n"+
+ "Other\n"+
+ "--AaB03x--\n";
+
+ MultipartConfigElement config = new MultipartConfigElement(_dirname, 1024, 3072, 50);
+ MultiPartInputStream mpis = new MultiPartInputStream(new ByteArrayInputStream(str.getBytes()),
+ _contentType,
+ config,
+ _tmpDir);
+ mpis.setDeleteOnExit(true);
+ Collection parts = mpis.getParts();
+ assertThat(parts.size(), is(2));
+ Part p1 = mpis.getPart("field1");
+ assertThat(p1, notNullValue());
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ IO.copy(p1.getInputStream(), baos);
+ assertThat(baos.toString("UTF-8"), is("Joe Blow"));
+
+ Part p2 = mpis.getPart("field2");
+ assertThat(p2, notNullValue());
+ baos = new ByteArrayOutputStream();
+ IO.copy(p2.getInputStream(), baos);
+ assertThat(baos.toString("UTF-8"), is("Other"));
+ }
+
+ public void testCROnlyRequest()
+ throws Exception
+ {
+ String str = "--AaB03x\r"+
+ "content-disposition: form-data; name=\"field1\"\r"+
+ "\r"+
+ "Joe Blow\r"+
+ "--AaB03x\r"+
+ "content-disposition: form-data; name=\"field2\"\r"+
+ "\r"+
+ "Other\r"+
+ "--AaB03x--\r";
+
+ MultipartConfigElement config = new MultipartConfigElement(_dirname, 1024, 3072, 50);
+ MultiPartInputStream mpis = new MultiPartInputStream(new ByteArrayInputStream(str.getBytes()),
+ _contentType,
+ config,
+ _tmpDir);
+ mpis.setDeleteOnExit(true);
+ Collection parts = mpis.getParts();
+ assertThat(parts.size(), is(2));
+
+ assertThat(parts.size(), is(2));
+ Part p1 = mpis.getPart("field1");
+ assertThat(p1, notNullValue());
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ IO.copy(p1.getInputStream(), baos);
+ assertThat(baos.toString("UTF-8"), is("Joe Blow"));
+
+ Part p2 = mpis.getPart("field2");
+ assertThat(p2, notNullValue());
+ baos = new ByteArrayOutputStream();
+ IO.copy(p2.getInputStream(), baos);
+ assertThat(baos.toString("UTF-8"), is("Other"));
+ }
+
+
+ public void testCRandLFMixRequest()
+ throws Exception
+ {
+ String str = "--AaB03x\r"+
+ "content-disposition: form-data; name=\"field1\"\r"+
+ "\r"+
+ "\nJoe Blow\n"+
+ "\r"+
+ "--AaB03x\r"+
+ "content-disposition: form-data; name=\"field2\"\r"+
+ "\r"+
+ "Other\r"+
+ "--AaB03x--\r";
+
+ MultipartConfigElement config = new MultipartConfigElement(_dirname, 1024, 3072, 50);
+ MultiPartInputStream mpis = new MultiPartInputStream(new ByteArrayInputStream(str.getBytes()),
+ _contentType,
+ config,
+ _tmpDir);
+ mpis.setDeleteOnExit(true);
+ Collection parts = mpis.getParts();
+ assertThat(parts.size(), is(2));
+
+ Part p1 = mpis.getPart("field1");
+ assertThat(p1, notNullValue());
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ IO.copy(p1.getInputStream(), baos);
+ assertThat(baos.toString("UTF-8"), is("\nJoe Blow\n"));
+
+ Part p2 = mpis.getPart("field2");
+ assertThat(p2, notNullValue());
+ baos = new ByteArrayOutputStream();
+ IO.copy(p2.getInputStream(), baos);
+ assertThat(baos.toString("UTF-8"), is("Other"));
+ }
+
+
+ public void testBadlyEncodedFilename() throws Exception
+ {
+
+ String contents = "--AaB03x\r\n"+
+ "content-disposition: form-data; name=\"stuff\"; filename=\"" +"Taken on Aug 22 \\ 2012.jpg" + "\"\r\n"+
+ "Content-Type: text/plain\r\n"+
+ "\r\n"+"stuff"+
+ "aaa"+"\r\n" +
+ "--AaB03x--\r\n";
+
+ MultipartConfigElement config = new MultipartConfigElement(_dirname, 1024, 3072, 50);
+ MultiPartInputStream mpis = new MultiPartInputStream(new ByteArrayInputStream(contents.getBytes()),
+ _contentType,
+ config,
+ _tmpDir);
+ mpis.setDeleteOnExit(true);
+ Collection parts = mpis.getParts();
+ assertThat(parts.size(), is(1));
+ assertThat(((MultiPartInputStream.MultiPart)parts.iterator().next()).getContentDispositionFilename(), is("Taken on Aug 22 \\ 2012.jpg"));
+ }
+
+ public void testBadlyEncodedMSFilename() throws Exception
+ {
+
+ String contents = "--AaB03x\r\n"+
+ "content-disposition: form-data; name=\"stuff\"; filename=\"" +"c:\\this\\really\\is\\some\\path\\to\\a\\file.txt" + "\"\r\n"+
+ "Content-Type: text/plain\r\n"+
+ "\r\n"+"stuff"+
+ "aaa"+"\r\n" +
+ "--AaB03x--\r\n";
+
+ MultipartConfigElement config = new MultipartConfigElement(_dirname, 1024, 3072, 50);
+ MultiPartInputStream mpis = new MultiPartInputStream(new ByteArrayInputStream(contents.getBytes()),
+ _contentType,
+ config,
+ _tmpDir);
+ mpis.setDeleteOnExit(true);
+ Collection parts = mpis.getParts();
+ assertThat(parts.size(), is(1));
+ assertThat(((MultiPartInputStream.MultiPart)parts.iterator().next()).getContentDispositionFilename(), is("c:\\this\\really\\is\\some\\path\\to\\a\\file.txt"));
+ }
+
+ public void testCorrectlyEncodedMSFilename() throws Exception
+ {
+ String contents = "--AaB03x\r\n"+
+ "content-disposition: form-data; name=\"stuff\"; filename=\"" +"c:\\\\this\\\\really\\\\is\\\\some\\\\path\\\\to\\\\a\\\\file.txt" + "\"\r\n"+
+ "Content-Type: text/plain\r\n"+
+ "\r\n"+"stuff"+
+ "aaa"+"\r\n" +
+ "--AaB03x--\r\n";
+
+ MultipartConfigElement config = new MultipartConfigElement(_dirname, 1024, 3072, 50);
+ MultiPartInputStream mpis = new MultiPartInputStream(new ByteArrayInputStream(contents.getBytes()),
+ _contentType,
+ config,
+ _tmpDir);
+ mpis.setDeleteOnExit(true);
+ Collection parts = mpis.getParts();
+ assertThat(parts.size(), is(1));
+ assertThat(((MultiPartInputStream.MultiPart)parts.iterator().next()).getContentDispositionFilename(), is("c:\\this\\really\\is\\some\\path\\to\\a\\file.txt"));
+ }
public void testMulti ()
throws Exception
@@ -208,6 +595,9 @@ public class MultiPartInputStreamTest extends TestCase
testMulti("stuff with spaces.txt");
}
+
+
+
private void testMulti(String filename) throws IOException, ServletException
{
MultipartConfigElement config = new MultipartConfigElement(_dirname, 1024, 3072, 50);
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/QuotedStringTokenizerTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/QuotedStringTokenizerTest.java
index da008c87b8a..14d6eaf3546 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/QuotedStringTokenizerTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/QuotedStringTokenizerTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -18,9 +18,7 @@
package org.eclipse.jetty.util;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
import org.junit.Test;
@@ -178,5 +176,33 @@ public class QuotedStringTokenizerTest
assertEquals("ab\u001ec",QuotedStringTokenizer.unquote("ab\u001ec"));
assertEquals("ab\u001ec",QuotedStringTokenizer.unquote("\"ab\u001ec\""));
}
+
+
+ @Test
+ public void testUnquoteOnly()
+ {
+ assertEquals("abc",QuotedStringTokenizer.unquoteOnly("abc"));
+ assertEquals("a\"c",QuotedStringTokenizer.unquoteOnly("\"a\\\"c\""));
+ assertEquals("a'c",QuotedStringTokenizer.unquoteOnly("\"a'c\""));
+ assertEquals("a\\n\\r\\t",QuotedStringTokenizer.unquoteOnly("\"a\\\\n\\\\r\\\\t\""));
+ assertEquals("ba\\uXXXXaaa", QuotedStringTokenizer.unquoteOnly("\"ba\\\\uXXXXaaa\""));
+ }
+ /**
+ * When encountering a Content-Disposition line during a multi-part mime file
+ * upload, the filename="..." field can contain '\' characters that do not
+ * belong to a proper escaping sequence, this tests QuotedStringTokenizer to
+ * ensure that it preserves those slashes for where they cannot be escaped.
+ */
+ @Test
+ public void testNextTokenOnContentDisposition()
+ {
+ String content_disposition = "form-data; name=\"fileup\"; filename=\"Taken on Aug 22 \\ 2012.jpg\"";
+
+ QuotedStringTokenizer tok=new QuotedStringTokenizer(content_disposition,";",false,true);
+
+ assertEquals("form-data", tok.nextToken().trim());
+ assertEquals("name=\"fileup\"", tok.nextToken().trim());
+ assertEquals("filename=\"Taken on Aug 22 \\ 2012.jpg\"", tok.nextToken().trim());
+ }
}
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/ScannerTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/ScannerTest.java
index d7e890c61b1..7a6c09f06f1 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/ScannerTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/ScannerTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/StringMapTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/StringMapTest.java
index 9b099848ef7..bdc34191bf4 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/StringMapTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/StringMapTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/StringUtilTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/StringUtilTest.java
index 73e7b09ddc9..82cc555ed90 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/StringUtilTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/StringUtilTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/TestIntrospectionUtil.java b/jetty-util/src/test/java/org/eclipse/jetty/util/TestIntrospectionUtil.java
index ff08c112171..3db3562f5f4 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/TestIntrospectionUtil.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/TestIntrospectionUtil.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/TypeUtilTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/TypeUtilTest.java
new file mode 100644
index 00000000000..4072cdf8a0f
--- /dev/null
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/TypeUtilTest.java
@@ -0,0 +1,93 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
+// ------------------------------------------------------------------------
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// and Apache License v2.0 which accompanies this distribution.
+//
+// The Eclipse Public License is available at
+// http://www.eclipse.org/legal/epl-v10.html
+//
+// The Apache License v2.0 is available at
+// http://www.opensource.org/licenses/apache2.0.php
+//
+// You may elect to redistribute this code under either of these licenses.
+// ========================================================================
+//
+
+package org.eclipse.jetty.util;
+
+import junit.framework.Assert;
+
+import org.junit.Test;
+
+public class TypeUtilTest
+{
+ @Test
+ public void convertHexDigitTest()
+ {
+ Assert.assertEquals((byte)0,TypeUtil.convertHexDigit((byte)'0'));
+ Assert.assertEquals((byte)9,TypeUtil.convertHexDigit((byte)'9'));
+ Assert.assertEquals((byte)10,TypeUtil.convertHexDigit((byte)'a'));
+ Assert.assertEquals((byte)10,TypeUtil.convertHexDigit((byte)'A'));
+ Assert.assertEquals((byte)15,TypeUtil.convertHexDigit((byte)'f'));
+ Assert.assertEquals((byte)15,TypeUtil.convertHexDigit((byte)'F'));
+
+ Assert.assertEquals((int)0,TypeUtil.convertHexDigit((int)'0'));
+ Assert.assertEquals((int)9,TypeUtil.convertHexDigit((int)'9'));
+ Assert.assertEquals((int)10,TypeUtil.convertHexDigit((int)'a'));
+ Assert.assertEquals((int)10,TypeUtil.convertHexDigit((int)'A'));
+ Assert.assertEquals((int)15,TypeUtil.convertHexDigit((int)'f'));
+ Assert.assertEquals((int)15,TypeUtil.convertHexDigit((int)'F'));
+ }
+
+ @Test
+ public void testToHexInt() throws Exception
+ {
+ StringBuilder b = new StringBuilder();
+
+ b.setLength(0);
+ TypeUtil.toHex((int)0,b);
+ Assert.assertEquals("00000000",b.toString());
+
+ b.setLength(0);
+ TypeUtil.toHex(Integer.MAX_VALUE,b);
+ Assert.assertEquals("7FFFFFFF",b.toString());
+
+ b.setLength(0);
+ TypeUtil.toHex(Integer.MIN_VALUE,b);
+ Assert.assertEquals("80000000",b.toString());
+
+ b.setLength(0);
+ TypeUtil.toHex(0x12345678,b);
+ Assert.assertEquals("12345678",b.toString());
+
+ b.setLength(0);
+ TypeUtil.toHex(0x9abcdef0,b);
+ Assert.assertEquals("9ABCDEF0",b.toString());
+ }
+
+ @Test
+ public void testToHexLong() throws Exception
+ {
+ StringBuilder b = new StringBuilder();
+
+ b.setLength(0);
+ TypeUtil.toHex((long)0,b);
+ Assert.assertEquals("0000000000000000",b.toString());
+
+ b.setLength(0);
+ TypeUtil.toHex(Long.MAX_VALUE,b);
+ Assert.assertEquals("7FFFFFFFFFFFFFFF",b.toString());
+
+ b.setLength(0);
+ TypeUtil.toHex(Long.MIN_VALUE,b);
+ Assert.assertEquals("8000000000000000",b.toString());
+
+ b.setLength(0);
+ TypeUtil.toHex(0x123456789abcdef0L,b);
+ Assert.assertEquals("123456789ABCDEF0",b.toString());
+ }
+
+}
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/URITest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/URITest.java
index b5c2099c2cd..ece100e7372 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/URITest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/URITest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/URLEncodedTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/URLEncodedTest.java
index 19f9ef818e3..d9b69a85fb9 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/URLEncodedTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/URLEncodedTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -120,33 +120,34 @@ public class URLEncodedTest
assertEquals("encoded get", url_encoded.getString("Name8"),"xx, yy ,zz");
url_encoded.clear();
- url_encoded.decode("Name11=xxVerdi+%C6+og+2zz", "ISO-8859-1");
+ url_encoded.decode("Name11=%u30EDxxVerdi+%C6+og+2zz", "ISO-8859-1");
assertEquals("encoded param size",1, url_encoded.size());
- assertEquals("encoded get", url_encoded.getString("Name11"),"xxVerdi \u00c6 og 2zz");
+ assertEquals("encoded get", "?xxVerdi \u00c6 og 2zz",url_encoded.getString("Name11"));
url_encoded.clear();
- url_encoded.decode("Name12=xxVerdi+%2F+og+2zz", "UTF-8");
+ url_encoded.decode("Name12=%u30EDxxVerdi+%2F+og+2zz", "UTF-8");
assertEquals("encoded param size",1, url_encoded.size());
- assertEquals("encoded get", url_encoded.getString("Name12"),"xxVerdi / og 2zz");
+ assertEquals("encoded get", url_encoded.getString("Name12"),"\u30edxxVerdi / og 2zz");
url_encoded.clear();
- url_encoded.decode("Name14=%GG%+%%+%", "ISO-8859-1");
+ url_encoded.decode("Name14=%uXXXXa%GGb%+%c%+%d", "ISO-8859-1");
assertEquals("encoded param size",1, url_encoded.size());
- assertEquals("encoded get", url_encoded.getString("Name14"),"%GG% %% %");
+ assertEquals("encoded get","?a?b?c?d", url_encoded.getString("Name14"));
url_encoded.clear();
- url_encoded.decode("Name14=%GG%+%%+%", "UTF-8");
+ url_encoded.decode("Name14=%uXXXX%GG%+%%+%", "UTF-8");
assertEquals("encoded param size",1, url_encoded.size());
- assertEquals("encoded get", url_encoded.getString("Name14"),"%GG% %% %");
+ assertEquals("encoded get", url_encoded.getString("Name14"),"\ufffd\ufffd\ufffd\ufffd");
+
/* Not every jvm supports this encoding */
if (java.nio.charset.Charset.isSupported("SJIS"))
{
url_encoded.clear();
- url_encoded.decode("Name9=%83e%83X%83g", "SJIS"); // "Test" in Japanese Katakana
+ url_encoded.decode("Name9=%u30ED%83e%83X%83g", "SJIS"); // "Test" in Japanese Katakana
assertEquals("encoded param size",1, url_encoded.size());
- assertEquals("encoded get", "\u30c6\u30b9\u30c8", url_encoded.getString("Name9"));
+ assertEquals("encoded get", "\u30ed\u30c6\u30b9\u30c8", url_encoded.getString("Name9"));
}
else
assertTrue("Charset SJIS not supported by jvm", true);
@@ -160,9 +161,9 @@ public class URLEncodedTest
UrlEncoded url_encoded = new UrlEncoded();
url_encoded.decode("Name15=xx%zz", "UTF-8");
assertEquals("encoded param size",1, url_encoded.size());
- assertEquals("encoded get", "xx%zz", url_encoded.getString("Name15"));
+ assertEquals("encoded get", "xx\ufffd", url_encoded.getString("Name15"));
- assertEquals("%u123",UrlEncoded.decodeString("%u123",0,5,"UTF-8"));
+ assertEquals("xxx",UrlEncoded.decodeString("xxx%u123",0,5,"UTF-8"));
}
@@ -173,16 +174,16 @@ public class URLEncodedTest
{
String [][] charsets = new String[][]
{
- {StringUtil.__UTF8,null},
- {StringUtil.__ISO_8859_1,StringUtil.__ISO_8859_1},
- {StringUtil.__UTF8,StringUtil.__UTF8},
- {StringUtil.__UTF16,StringUtil.__UTF16},
+ {StringUtil.__UTF8,null,"%30"},
+ {StringUtil.__ISO_8859_1,StringUtil.__ISO_8859_1,"%30"},
+ {StringUtil.__UTF8,StringUtil.__UTF8,"%30"},
+ {StringUtil.__UTF16,StringUtil.__UTF16,"%00%30"},
};
for (int i=0;i m2 = new MultiMap();
UrlEncoded.decodeTo(in2, m2, "Shift_JIS", -1,-1);
assertEquals("stream length",1,m2.size());
assertEquals("stream name","\u30c6\u30b9\u30c8",m2.getString("name"));
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/Utf8StringBufferTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/Utf8StringBufferTest.java
index e39eaff09d9..ab9371f7094 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/Utf8StringBufferTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/Utf8StringBufferTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/Utf8StringBuilderTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/Utf8StringBuilderTest.java
index 9a32873d50f..43198d8995f 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/Utf8StringBuilderTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/Utf8StringBuilderTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorFactoryTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorFactoryTest.java
index 089e5602419..75d5988b568 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorFactoryTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorFactoryTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorTest.java
index a62e0b95a77..cbbc2784ecf 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/ajax/JSONTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/ajax/JSONTest.java
index ff824b98f02..2189dd1db1d 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/ajax/JSONTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/ajax/JSONTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/component/AggregateLifeCycleTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/component/AggregateLifeCycleTest.java
index 7834e05b175..f34794d3d69 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/component/AggregateLifeCycleTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/component/AggregateLifeCycleTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/component/LifeCycleListenerTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/component/LifeCycleListenerTest.java
index a81bb4e89af..2a752d23e6f 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/component/LifeCycleListenerTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/component/LifeCycleListenerTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/Blue.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/Blue.java
index 3dec7c39612..38a9d21bfcb 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/Blue.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/log/Blue.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/CapturingJULHandler.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/CapturingJULHandler.java
index a3d4bf5429c..2228d6e0e80 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/CapturingJULHandler.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/log/CapturingJULHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/Green.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/Green.java
index 11a82e54754..816eb4ef51b 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/Green.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/log/Green.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/JavaUtilLogTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/JavaUtilLogTest.java
index dfda60a7cec..5475b805bd6 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/JavaUtilLogTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/log/JavaUtilLogTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/LogTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/LogTest.java
index 8b4324ebe79..0cf5e41adbe 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/LogTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/log/LogTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/NamedLogTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/NamedLogTest.java
index 17e1aaada24..04ca903e0a0 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/NamedLogTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/log/NamedLogTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/Red.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/Red.java
index c71f244722a..6e4d1c16cac 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/Red.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/log/Red.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/Slf4jHelper.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/Slf4jHelper.java
index 934b6f9aae6..e133bafa5e2 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/Slf4jHelper.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/log/Slf4jHelper.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrCapture.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrCapture.java
index 6acfd03c805..640f3ae184d 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrCapture.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrCapture.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrLogTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrLogTest.java
index cb6eb1a2f5b..d51099d239d 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrLogTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrLogTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/resource/FileResourceTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/resource/FileResourceTest.java
new file mode 100644
index 00000000000..7d7b1973514
--- /dev/null
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/resource/FileResourceTest.java
@@ -0,0 +1,98 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
+// ------------------------------------------------------------------------
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// and Apache License v2.0 which accompanies this distribution.
+//
+// The Eclipse Public License is available at
+// http://www.eclipse.org/legal/epl-v10.html
+//
+// The Apache License v2.0 is available at
+// http://www.opensource.org/licenses/apache2.0.php
+//
+// You may elect to redistribute this code under either of these licenses.
+// ========================================================================
+//
+
+package org.eclipse.jetty.util.resource;
+
+import static org.hamcrest.Matchers.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import org.eclipse.jetty.toolchain.test.TestingDir;
+import org.eclipse.jetty.util.StringUtil;
+import org.eclipse.jetty.util.UrlEncoded;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class FileResourceTest
+{
+ @Rule
+ public TestingDir testdir = new TestingDir();
+
+ private URI createDummyFile(String name) throws IOException
+ {
+ File file = testdir.getFile(name);
+ file.createNewFile();
+ return file.toURI();
+ }
+
+ private URL decode(URL url) throws MalformedURLException
+ {
+ String raw = url.toExternalForm();
+ String decoded = UrlEncoded.decodeString(raw,0,raw.length(),StringUtil.__UTF8);
+ return new URL(decoded);
+ }
+
+ @Test
+ public void testExist_Normal() throws Exception
+ {
+ createDummyFile("a.jsp");
+
+ URI ref = testdir.getDir().toURI().resolve("a.jsp");
+ FileResource fileres = new FileResource(decode(ref.toURL()));
+ Assert.assertThat("FileResource: " + fileres,fileres.exists(),is(true));
+ }
+
+ @Ignore("Cannot get null to be seen by FileResource")
+ @Test
+ public void testExist_BadNull() throws Exception
+ {
+ createDummyFile("a.jsp");
+
+ try {
+ // request with null at end
+ URI ref = testdir.getDir().toURI().resolve("a.jsp%00");
+ FileResource fileres = new FileResource(decode(ref.toURL()));
+ Assert.assertThat("FileResource: " + fileres,fileres.exists(),is(false));
+ } catch(URISyntaxException e) {
+ // Valid path
+ }
+ }
+
+ @Ignore("Validation shouldn't be done in FileResource")
+ @Test
+ public void testExist_BadNullX() throws Exception
+ {
+ createDummyFile("a.jsp");
+
+ try {
+ // request with null and x at end
+ URI ref = testdir.getDir().toURI().resolve("a.jsp%00x");
+ FileResource fileres = new FileResource(decode(ref.toURL()));
+ Assert.assertThat("FileResource: " + fileres,fileres.exists(),is(false));
+ } catch(URISyntaxException e) {
+ // Valid path
+ }
+ }
+}
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceCollectionTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceCollectionTest.java
index a6364ba2539..8d029c10b6c 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceCollectionTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceCollectionTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceTest.java
index caa24d17322..5e9ae153066 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/ssl/SslContextFactoryTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/ssl/SslContextFactoryTest.java
index 4e934a0e426..d2ffab62e13 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/ssl/SslContextFactoryTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/ssl/SslContextFactoryTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/statistic/SampleStatisticTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/statistic/SampleStatisticTest.java
index 3fe5b75cb26..12f348ce3ae 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/statistic/SampleStatisticTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/statistic/SampleStatisticTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/QueuedThreadPoolTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/QueuedThreadPoolTest.java
index e8f6b3d776f..15f3af76232 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/QueuedThreadPoolTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/QueuedThreadPoolTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/TimeoutTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/TimeoutTest.java
index 972f6b3bff8..82148ddf532 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/TimeoutTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/TimeoutTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/AbstractConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/AbstractConfiguration.java
index b97d1e8257d..c19feecff6e 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/AbstractConfiguration.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/AbstractConfiguration.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/ClasspathPattern.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/ClasspathPattern.java
index 63ec5b4ca76..dea26aeed8f 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/ClasspathPattern.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/ClasspathPattern.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -189,16 +189,24 @@ public class ClasspathPattern
if (_entries != null)
{
name = name.replace('/','.');
- name = name.replaceFirst("^[.]+","");
- name = name.replaceAll("\\$.*$","");
-
+
+ int startIndex = 0;
+
+ while(startIndex < name.length() && name.charAt(startIndex) == '.') {
+ startIndex++;
+ }
+
+ int dollar = name.indexOf("$");
+
+ int endIndex = dollar != -1 ? dollar : name.length();
+
for (Entry entry : _entries)
{
if (entry != null)
{
if (entry.partial)
{
- if (name.startsWith(entry.classpath))
+ if (name.regionMatches(startIndex, entry.classpath, 0, entry.classpath.length()))
{
result = entry.result;
break;
@@ -206,7 +214,9 @@ public class ClasspathPattern
}
else
{
- if (name.equals(entry.classpath))
+ int regionLength = endIndex-startIndex;
+ if (regionLength == entry.classpath.length()
+ && name.regionMatches(startIndex, entry.classpath, 0, regionLength))
{
result = entry.result;
break;
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/CloneConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/CloneConfiguration.java
index b94ce7a0efe..be9ba73f2a5 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/CloneConfiguration.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/CloneConfiguration.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Configuration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Configuration.java
index ad227ac2fdb..be1229d9a76 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Configuration.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Configuration.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/DefaultsDescriptor.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/DefaultsDescriptor.java
index 79d3ccae376..e036233b1fb 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/DefaultsDescriptor.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/DefaultsDescriptor.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Descriptor.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Descriptor.java
index 3210c9c1cb9..0e9d216c296 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Descriptor.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Descriptor.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/DescriptorProcessor.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/DescriptorProcessor.java
index 6a86969c5e6..55a76ee2501 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/DescriptorProcessor.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/DescriptorProcessor.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/DiscoveredAnnotation.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/DiscoveredAnnotation.java
index 988414b85f2..44ca2aab4db 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/DiscoveredAnnotation.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/DiscoveredAnnotation.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/FragmentConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/FragmentConfiguration.java
index 0d5f64915c1..eb8129228f5 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/FragmentConfiguration.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/FragmentConfiguration.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/FragmentDescriptor.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/FragmentDescriptor.java
index 3f185df4492..d228b324e26 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/FragmentDescriptor.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/FragmentDescriptor.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/IterativeDescriptorProcessor.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/IterativeDescriptorProcessor.java
index 2d37c323b31..21a893cf89b 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/IterativeDescriptorProcessor.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/IterativeDescriptorProcessor.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JarScanner.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JarScanner.java
index 0dfa1eefb9e..37404dfc019 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JarScanner.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JarScanner.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JettyWebXmlConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JettyWebXmlConfiguration.java
index aab89c33ed1..50b681da2e8 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JettyWebXmlConfiguration.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JettyWebXmlConfiguration.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaData.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaData.java
index cdd84b705de..43935f15873 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaData.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaData.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaDataComplete.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaDataComplete.java
index 2d65311f907..03ccee74599 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaDataComplete.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaDataComplete.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaInfConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaInfConfiguration.java
index 64f2dbab87a..37d16201107 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaInfConfiguration.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaInfConfiguration.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Ordering.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Ordering.java
index 3cdb86cefb1..9a74e12cedf 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Ordering.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Ordering.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Origin.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Origin.java
index f2f941c478b..7eea7cfccba 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Origin.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/Origin.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -18,4 +18,4 @@
package org.eclipse.jetty.webapp;
-public enum Origin {NotSet, WebXml, WebDefaults, WebOverride, WebFragment, Annotation, API}
\ No newline at end of file
+public enum Origin {NotSet, WebXml, WebDefaults, WebOverride, WebFragment, Annotation, API}
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/OverrideDescriptor.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/OverrideDescriptor.java
index fad8213d834..780b9a42044 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/OverrideDescriptor.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/OverrideDescriptor.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/StandardDescriptorProcessor.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/StandardDescriptorProcessor.java
index 074aade440b..0290d4eed63 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/StandardDescriptorProcessor.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/StandardDescriptorProcessor.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/TagLibConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/TagLibConfiguration.java
index da47a9ab62f..0f857aa565f 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/TagLibConfiguration.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/TagLibConfiguration.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppClassLoader.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppClassLoader.java
index 9c218953f63..295581997ac 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppClassLoader.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppClassLoader.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java
index 45ffa3ad590..468bf136e7e 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebDescriptor.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebDescriptor.java
index 58034e91ae0..9d36bf68e3f 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebDescriptor.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebDescriptor.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java
index 0d8865c3c4f..f2bd3803496 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebXmlConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebXmlConfiguration.java
index c0af4a8067f..aad8c963cd7 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebXmlConfiguration.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebXmlConfiguration.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/test/java/org/acme/webapp/ClassInJarA.java b/jetty-webapp/src/test/java/org/acme/webapp/ClassInJarA.java
index 96d69b30325..638ffd2f658 100644
--- a/jetty-webapp/src/test/java/org/acme/webapp/ClassInJarA.java
+++ b/jetty-webapp/src/test/java/org/acme/webapp/ClassInJarA.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/test/java/org/eclipse/jetty/webapp/OrderingTest.java b/jetty-webapp/src/test/java/org/eclipse/jetty/webapp/OrderingTest.java
index fe109c48cee..8a769f0f16c 100644
--- a/jetty-webapp/src/test/java/org/eclipse/jetty/webapp/OrderingTest.java
+++ b/jetty-webapp/src/test/java/org/eclipse/jetty/webapp/OrderingTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/test/java/org/eclipse/jetty/webapp/WebAppClassLoaderTest.java b/jetty-webapp/src/test/java/org/eclipse/jetty/webapp/WebAppClassLoaderTest.java
index b5023363ba8..19371a8fcc3 100644
--- a/jetty-webapp/src/test/java/org/eclipse/jetty/webapp/WebAppClassLoaderTest.java
+++ b/jetty-webapp/src/test/java/org/eclipse/jetty/webapp/WebAppClassLoaderTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-webapp/src/test/java/org/eclipse/jetty/webapp/WebAppContextTest.java b/jetty-webapp/src/test/java/org/eclipse/jetty/webapp/WebAppContextTest.java
index c6918c2cd87..4393c12d33c 100644
--- a/jetty-webapp/src/test/java/org/eclipse/jetty/webapp/WebAppContextTest.java
+++ b/jetty-webapp/src/test/java/org/eclipse/jetty/webapp/WebAppContextTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -35,7 +35,9 @@ import javax.servlet.ServletResponse;
import junit.framework.Assert;
+import org.eclipse.jetty.server.LocalConnector;
import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.handler.ContextHandlerCollection;
import org.eclipse.jetty.server.handler.HandlerList;
import org.eclipse.jetty.util.resource.Resource;
import org.eclipse.jetty.util.resource.ResourceCollection;
@@ -105,13 +107,8 @@ public class WebAppContextTest
server.setHandler(context);
server.start();
- // When
ServletContext ctx = context.getServletContext();
-
- // Then
- // This passes:
assertNotNull(ctx.getRealPath("/doesnotexist"));
- // This fails:
assertNotNull(ctx.getRealPath("/doesnotexist/"));
}
@@ -185,6 +182,36 @@ public class WebAppContextTest
assertFalse(context.isProtectedTarget("/something-else/web-inf"));
}
+
+ @Test
+ public void testNullPath() throws Exception
+ {
+ Server server = new Server(0);
+ HandlerList handlers = new HandlerList();
+ ContextHandlerCollection contexts = new ContextHandlerCollection();
+ WebAppContext context = new WebAppContext();
+ context.setBaseResource(Resource.newResource("./src/test/webapp"));
+ context.setContextPath("/");
+ server.setHandler(handlers);
+ handlers.addHandler(contexts);
+ contexts.addHandler(context);
+
+ LocalConnector connector = new LocalConnector();
+ server.addConnector(connector);
+
+ server.start();
+ try
+ {
+ String response = connector.getResponses("GET http://localhost:8080 HTTP/1.1\r\nHost: localhost:8080\r\nConnection: close\r\n\r\n");
+ Assert.assertTrue(response.indexOf("200 OK")>=0);
+ }
+ finally
+ {
+ server.stop();
+ }
+ }
+
+
class ServletA extends GenericServlet
{
@Override
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/AbstractExtension.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/AbstractExtension.java
index 0bf8ef1fb17..1913a04d50a 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/AbstractExtension.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/AbstractExtension.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/DeflateFrameExtension.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/DeflateFrameExtension.java
index 1ca08f0d2d2..8e55e89943b 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/DeflateFrameExtension.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/DeflateFrameExtension.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/Extension.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/Extension.java
index 23ed4a0260a..2e0ead691cf 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/Extension.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/Extension.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/FixedMaskGen.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/FixedMaskGen.java
index 3740a21fba4..650991712e0 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/FixedMaskGen.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/FixedMaskGen.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/FragmentExtension.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/FragmentExtension.java
index 83b85786f1e..a2bb5b6d607 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/FragmentExtension.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/FragmentExtension.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/IdentityExtension.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/IdentityExtension.java
index e45039f5743..8dec4214b61 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/IdentityExtension.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/IdentityExtension.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/MaskGen.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/MaskGen.java
index 85b01c66ede..020bd5bea88 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/MaskGen.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/MaskGen.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/RandomMaskGen.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/RandomMaskGen.java
index 5d2af59239d..05094fd603d 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/RandomMaskGen.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/RandomMaskGen.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocket.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocket.java
index 0a364ce6b5e..256933311b5 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocket.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocket.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketBuffers.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketBuffers.java
index 50645f1597c..001b58134bb 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketBuffers.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketBuffers.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketClient.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketClient.java
index 047c3f658fb..e9b0ad13cc6 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketClient.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketClient.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketClientFactory.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketClientFactory.java
index b365ee6dfd5..1e27bfae722 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketClientFactory.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketClientFactory.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnection.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnection.java
index eff9dc48a7f..784d9627f65 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnection.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnection.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD00.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD00.java
index a4e10bd32a6..e3a68ff1590 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD00.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD00.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD06.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD06.java
index 9813353a20a..da638f103c3 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD06.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD06.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD08.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD08.java
index 0718259c390..1d06880aa86 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD08.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD08.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionRFC6455.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionRFC6455.java
index d999d924fec..eeea3116c29 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionRFC6455.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionRFC6455.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketFactory.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketFactory.java
index ae01166ed92..1378956342f 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketFactory.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketFactory.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGenerator.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGenerator.java
index 97563488b28..5beac40f507 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGenerator.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGenerator.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorD00.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorD00.java
index c31327ffcd1..de83302dc6d 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorD00.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorD00.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorD06.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorD06.java
index dc5b896e3d0..43637eefc2a 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorD06.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorD06.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorD08.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorD08.java
index cf263bf9260..ce373d952fd 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorD08.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorD08.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorRFC6455.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorRFC6455.java
index b37864676de..dedaa735aa3 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorRFC6455.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorRFC6455.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketHandler.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketHandler.java
index 5f3f51f9dde..622bdbebe29 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketHandler.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketHandler.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketParser.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketParser.java
index b167f5f4864..16ff406d60b 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketParser.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketParser.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketParserD00.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketParserD00.java
index ebf3fe39513..3243cfba042 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketParserD00.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketParserD00.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketParserD06.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketParserD06.java
index 0104199f223..220dc2a7040 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketParserD06.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketParserD06.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketParserD08.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketParserD08.java
index 3d495d16b7a..60a3bb270d6 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketParserD08.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketParserD08.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketParserRFC6455.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketParserRFC6455.java
index f742d5ebdd6..36a731081ab 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketParserRFC6455.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketParserRFC6455.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServlet.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServlet.java
index d52c801900c..32813f5b68d 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServlet.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServlet.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnection.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnection.java
index ee799bda687..b5dffc95a82 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnection.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnection.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnectionD00.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnectionD00.java
index f2af7b1621b..1ef39886cf5 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnectionD00.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnectionD00.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnectionD06.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnectionD06.java
index cfeb5b448be..78096aba209 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnectionD06.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnectionD06.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnectionD08.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnectionD08.java
index f3489894626..631d19d716e 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnectionD08.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnectionD08.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnectionRFC6455.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnectionRFC6455.java
index c3d1713151d..e18efded9a4 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnectionRFC6455.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServletConnectionRFC6455.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/ZeroMaskGen.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/ZeroMaskGen.java
index 83dd18d28a7..c88f90a6575 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/ZeroMaskGen.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/ZeroMaskGen.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/SafariWebsocketDraft0Test.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/SafariWebsocketDraft0Test.java
index 67063501493..04c26891b98 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/SafariWebsocketDraft0Test.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/SafariWebsocketDraft0Test.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/TestClient.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/TestClient.java
index d2250c4d32d..b4e2c72c74e 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/TestClient.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/TestClient.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/TestServer.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/TestServer.java
index 64039f7b01c..0330febdb52 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/TestServer.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/TestServer.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/TomcatServerQuirksTest.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/TomcatServerQuirksTest.java
index 754a4199db4..30a38928ebf 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/TomcatServerQuirksTest.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/TomcatServerQuirksTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -44,14 +44,15 @@ public class TomcatServerQuirksTest
* @throws IOException
*/
@Test
- @Ignore("Bug with Transfer-Encoding")
- public void testTomcat7_0_32_WithTransferEncoding() throws Exception {
+ public void testTomcat7_0_32_WithTransferEncoding() throws Exception
+ {
DummyServer server = new DummyServer();
int bufferSize = 512;
QueuedThreadPool threadPool = new QueuedThreadPool();
WebSocketClientFactory factory = new WebSocketClientFactory(threadPool, new ZeroMaskGen(), bufferSize);
- try {
+ try
+ {
server.start();
// Setup Client Factory
@@ -113,7 +114,9 @@ public class TomcatServerQuirksTest
socket.flush();
Assert.assertTrue(dataLatch.await(1000, TimeUnit.SECONDS));
- } finally {
+ }
+ finally
+ {
factory.stop();
threadPool.stop();
server.stop();
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketClientTest.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketClientTest.java
index 8cd1b467c11..be1d5fc77c0 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketClientTest.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketClientTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketCommTest.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketCommTest.java
index 9674d86d4f9..11058d94a31 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketCommTest.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketCommTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorD00Test.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorD00Test.java
index 3e553fc8cad..74347f5ce17 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorD00Test.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorD00Test.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorD06Test.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorD06Test.java
index 78dd26ca318..60f5dd8d91e 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorD06Test.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorD06Test.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorD08Test.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorD08Test.java
index 80feabbb38a..7b1a36b89e6 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorD08Test.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorD08Test.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorRFC6455Test.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorRFC6455Test.java
index 8e1f7114fca..702c75af7e0 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorRFC6455Test.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorRFC6455Test.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketLoadD08Test.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketLoadD08Test.java
index 62500c45483..2a055869ec9 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketLoadD08Test.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketLoadD08Test.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketLoadRFC6455Test.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketLoadRFC6455Test.java
index 514ce754122..ea997a0fa66 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketLoadRFC6455Test.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketLoadRFC6455Test.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageD00Test.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageD00Test.java
index 1042978974a..958e0207ab1 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageD00Test.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageD00Test.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageD06Test.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageD06Test.java
index 2ce05d1c923..89cf1139a33 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageD06Test.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageD06Test.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageD08Test.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageD08Test.java
index 971f26f4790..9ecdfc25b56 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageD08Test.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageD08Test.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageRFC6455Test.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageRFC6455Test.java
index 048de59e078..8d8c5e6b9a2 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageRFC6455Test.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageRFC6455Test.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketOverSSLTest.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketOverSSLTest.java
index 6d576fec5b0..058050925b0 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketOverSSLTest.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketOverSSLTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketParserD00Test.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketParserD00Test.java
index 6fae67b5ba6..c2afd680297 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketParserD00Test.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketParserD00Test.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketParserD06Test.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketParserD06Test.java
index 1d17f9c0d01..50bf125d28b 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketParserD06Test.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketParserD06Test.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketParserD08Test.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketParserD08Test.java
index 7d1de4b54c0..e63c062ae1f 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketParserD08Test.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketParserD08Test.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketParserRFC6455Test.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketParserRFC6455Test.java
index c4c0cc29b58..5255626e64b 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketParserRFC6455Test.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketParserRFC6455Test.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketRedeployTest.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketRedeployTest.java
index 641220a3c15..e8d0fd2a6cc 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketRedeployTest.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketRedeployTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketServletRFCTest.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketServletRFCTest.java
index f03aba618bd..e32829d0e9d 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketServletRFCTest.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketServletRFCTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/dummy/DummyServer.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/dummy/DummyServer.java
index 1a9ff16fcd4..43ec371c526 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/dummy/DummyServer.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/dummy/DummyServer.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/helper/CaptureSocket.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/helper/CaptureSocket.java
index d6e3d4b2694..266d278c045 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/helper/CaptureSocket.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/helper/CaptureSocket.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/helper/MessageSender.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/helper/MessageSender.java
index ecff608bc23..ffb096ec258 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/helper/MessageSender.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/helper/MessageSender.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/helper/SafariD00.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/helper/SafariD00.java
index 94d65a936bf..d1a91e83ca4 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/helper/SafariD00.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/helper/SafariD00.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/helper/WebSocketCaptureServlet.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/helper/WebSocketCaptureServlet.java
index 25567670c40..0e6e35cf235 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/helper/WebSocketCaptureServlet.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/helper/WebSocketCaptureServlet.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-xml/src/main/java/org/eclipse/jetty/xml/ConfigurationProcessor.java b/jetty-xml/src/main/java/org/eclipse/jetty/xml/ConfigurationProcessor.java
index 150698daad4..b179da4a2e2 100644
--- a/jetty-xml/src/main/java/org/eclipse/jetty/xml/ConfigurationProcessor.java
+++ b/jetty-xml/src/main/java/org/eclipse/jetty/xml/ConfigurationProcessor.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-xml/src/main/java/org/eclipse/jetty/xml/ConfigurationProcessorFactory.java b/jetty-xml/src/main/java/org/eclipse/jetty/xml/ConfigurationProcessorFactory.java
index c6f29886098..0fde9f075d9 100644
--- a/jetty-xml/src/main/java/org/eclipse/jetty/xml/ConfigurationProcessorFactory.java
+++ b/jetty-xml/src/main/java/org/eclipse/jetty/xml/ConfigurationProcessorFactory.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java
index 66aa4ced6e2..42c234cd45d 100644
--- a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java
+++ b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -117,30 +117,23 @@ public class XmlConfiguration
private synchronized static XmlParser initParser()
{
XmlParser parser = new XmlParser();
- try
- {
- URL config60 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_6_0.dtd",true);
- URL config76 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_7_6.dtd",true);
- parser.redirectEntity("configure.dtd",config76);
- parser.redirectEntity("configure_1_0.dtd",config60);
- parser.redirectEntity("configure_1_1.dtd",config60);
- parser.redirectEntity("configure_1_2.dtd",config60);
- parser.redirectEntity("configure_1_3.dtd",config60);
- parser.redirectEntity("configure_6_0.dtd",config60);
- parser.redirectEntity("configure_7_6.dtd",config76);
+ URL config60 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_6_0.dtd",true);
+ URL config76 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_7_6.dtd",true);
+ parser.redirectEntity("configure.dtd",config76);
+ parser.redirectEntity("configure_1_0.dtd",config60);
+ parser.redirectEntity("configure_1_1.dtd",config60);
+ parser.redirectEntity("configure_1_2.dtd",config60);
+ parser.redirectEntity("configure_1_3.dtd",config60);
+ parser.redirectEntity("configure_6_0.dtd",config60);
+ parser.redirectEntity("configure_7_6.dtd",config76);
- parser.redirectEntity("http://jetty.mortbay.org/configure.dtd",config76);
- parser.redirectEntity("http://jetty.eclipse.org/configure.dtd",config76);
- parser.redirectEntity("http://www.eclipse.org/jetty/configure.dtd",config76);
+ parser.redirectEntity("http://jetty.mortbay.org/configure.dtd",config76);
+ parser.redirectEntity("http://jetty.eclipse.org/configure.dtd",config76);
+ parser.redirectEntity("http://www.eclipse.org/jetty/configure.dtd",config76);
+
+ parser.redirectEntity("-//Mort Bay Consulting//DTD Configure//EN",config76);
+ parser.redirectEntity("-//Jetty//Configure//EN",config76);
- parser.redirectEntity("-//Mort Bay Consulting//DTD Configure//EN",config76);
- parser.redirectEntity("-//Jetty//Configure//EN",config76);
- }
- catch (ClassNotFoundException e)
- {
- LOG.warn(e.toString());
- LOG.debug(e);
- }
return parser;
}
diff --git a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlParser.java b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlParser.java
index 248e8324896..d0650269a58 100644
--- a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlParser.java
+++ b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlParser.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-xml/src/test/java/org/eclipse/jetty/xml/ConstructorArgTestClass.java b/jetty-xml/src/test/java/org/eclipse/jetty/xml/ConstructorArgTestClass.java
index da6ec162d77..655d457cab7 100644
--- a/jetty-xml/src/test/java/org/eclipse/jetty/xml/ConstructorArgTestClass.java
+++ b/jetty-xml/src/test/java/org/eclipse/jetty/xml/ConstructorArgTestClass.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-xml/src/test/java/org/eclipse/jetty/xml/TestConfiguration.java b/jetty-xml/src/test/java/org/eclipse/jetty/xml/TestConfiguration.java
index ec5525ba216..6b33d7dbae0 100644
--- a/jetty-xml/src/test/java/org/eclipse/jetty/xml/TestConfiguration.java
+++ b/jetty-xml/src/test/java/org/eclipse/jetty/xml/TestConfiguration.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlConfigurationTest.java b/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlConfigurationTest.java
index dec74ecd11b..819be68cb76 100644
--- a/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlConfigurationTest.java
+++ b/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlConfigurationTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlParserTest.java b/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlParserTest.java
index 604cf89ce84..ab67c3dd14c 100644
--- a/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlParserTest.java
+++ b/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlParserTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/pom.xml b/pom.xml
index 702bd3fedd0..b2b4bdb3c28 100644
--- a/pom.xml
+++ b/pom.xml
@@ -207,7 +207,7 @@
true
true
- ${project.inceptionYear}-2012
+ ${project.inceptionYear}-2013
DOUBLESLASH_STYLE
@@ -237,7 +237,7 @@
org.eclipse.jetty.toolchain
jetty-version-maven-plugin
- 1.0.7
+ 1.0.9
org.apache.maven.plugins
@@ -759,6 +759,20 @@
+
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-1149868-7']);
+ _gaq.push(['_trackPageview']);
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+ ]]>
+
diff --git a/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/ContinuationBase.java b/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/ContinuationBase.java
index b61f7326a09..53fe3a01125 100644
--- a/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/ContinuationBase.java
+++ b/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/ContinuationBase.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/FauxContinuationTest.java b/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/FauxContinuationTest.java
index 236f0428d1c..ed0534e8bd3 100644
--- a/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/FauxContinuationTest.java
+++ b/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/FauxContinuationTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/Jetty6ContinuationBioFauxTest.java b/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/Jetty6ContinuationBioFauxTest.java
index 2820c47372e..497c9ae038f 100644
--- a/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/Jetty6ContinuationBioFauxTest.java
+++ b/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/Jetty6ContinuationBioFauxTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/Jetty6ContinuationBioTest.java b/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/Jetty6ContinuationBioTest.java
index 2c8883adb29..5d1d4a345a2 100644
--- a/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/Jetty6ContinuationBioTest.java
+++ b/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/Jetty6ContinuationBioTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/Jetty6ContinuationNioFauxTest.java b/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/Jetty6ContinuationNioFauxTest.java
index c1211f4a897..e1917a27ddd 100644
--- a/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/Jetty6ContinuationNioFauxTest.java
+++ b/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/Jetty6ContinuationNioFauxTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/Jetty6ContinuationNioTest.java b/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/Jetty6ContinuationNioTest.java
index c06299cb3ec..5e31abec8e2 100644
--- a/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/Jetty6ContinuationNioTest.java
+++ b/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/Jetty6ContinuationNioTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/TestProxyServer.java b/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/TestProxyServer.java
index 61f68039a5d..946bcb767f9 100644
--- a/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/TestProxyServer.java
+++ b/test-continuation-jetty6/src/test/java/org/eclipse/jetty/continuation/TestProxyServer.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/test-continuation/src/main/java/org/eclipse/jetty/continuation/test/ContinuationBase.java b/test-continuation/src/main/java/org/eclipse/jetty/continuation/test/ContinuationBase.java
index 5298c0e6367..85e411a9300 100644
--- a/test-continuation/src/main/java/org/eclipse/jetty/continuation/test/ContinuationBase.java
+++ b/test-continuation/src/main/java/org/eclipse/jetty/continuation/test/ContinuationBase.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationTest.java b/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationTest.java
index 74bb6acd34f..99cc00fd0f0 100644
--- a/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationTest.java
+++ b/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/test-continuation/src/test/java/org/eclipse/jetty/continuation/FauxContinuationTest.java b/test-continuation/src/test/java/org/eclipse/jetty/continuation/FauxContinuationTest.java
index 19ba5373992..894783ff557 100644
--- a/test-continuation/src/test/java/org/eclipse/jetty/continuation/FauxContinuationTest.java
+++ b/test-continuation/src/test/java/org/eclipse/jetty/continuation/FauxContinuationTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/test-jetty-nested/src/main/java/org/eclipse/jetty/nested/Dump.java b/test-jetty-nested/src/main/java/org/eclipse/jetty/nested/Dump.java
index 7a1a1558189..7c7bfc33707 100644
--- a/test-jetty-nested/src/main/java/org/eclipse/jetty/nested/Dump.java
+++ b/test-jetty-nested/src/main/java/org/eclipse/jetty/nested/Dump.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/test-jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedJettyServlet.java b/test-jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedJettyServlet.java
index bbae57a7c8a..c8675b88f60 100644
--- a/test-jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedJettyServlet.java
+++ b/test-jetty-nested/src/main/java/org/eclipse/jetty/nested/NestedJettyServlet.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/test-jetty-nested/src/main/java/org/eclipse/jetty/nested/TestServlet.java b/test-jetty-nested/src/main/java/org/eclipse/jetty/nested/TestServlet.java
index 8d64f70d4d3..7d670849f67 100644
--- a/test-jetty-nested/src/main/java/org/eclipse/jetty/nested/TestServlet.java
+++ b/test-jetty-nested/src/main/java/org/eclipse/jetty/nested/TestServlet.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/test-jetty-nested/src/test/java/org/eclipse/jetty/nested/NestedServer.java b/test-jetty-nested/src/test/java/org/eclipse/jetty/nested/NestedServer.java
index bc1429f4405..63d5f710a43 100644
--- a/test-jetty-nested/src/test/java/org/eclipse/jetty/nested/NestedServer.java
+++ b/test-jetty-nested/src/test/java/org/eclipse/jetty/nested/NestedServer.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/test-jetty-servlet/src/main/java/Jetty400Repro.java b/test-jetty-servlet/src/main/java/Jetty400Repro.java
index 980053aa97f..b4c0e36b6cb 100644
--- a/test-jetty-servlet/src/main/java/Jetty400Repro.java
+++ b/test-jetty-servlet/src/main/java/Jetty400Repro.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/test-jetty-servlet/src/main/java/org/eclipse/jetty/testing/HttpTester.java b/test-jetty-servlet/src/main/java/org/eclipse/jetty/testing/HttpTester.java
index 41cab781df2..1621a7ec7aa 100644
--- a/test-jetty-servlet/src/main/java/org/eclipse/jetty/testing/HttpTester.java
+++ b/test-jetty-servlet/src/main/java/org/eclipse/jetty/testing/HttpTester.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/test-jetty-servlet/src/main/java/org/eclipse/jetty/testing/ServletTester.java b/test-jetty-servlet/src/main/java/org/eclipse/jetty/testing/ServletTester.java
index 4d185c2a784..b558bb6bf80 100644
--- a/test-jetty-servlet/src/main/java/org/eclipse/jetty/testing/ServletTester.java
+++ b/test-jetty-servlet/src/main/java/org/eclipse/jetty/testing/ServletTester.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -100,6 +100,12 @@ public class ServletTester
_server.start();
}
+ /* ------------------------------------------------------------ */
+ public void join() throws Exception
+ {
+ _server.join();
+ }
+
/* ------------------------------------------------------------ */
public void stop() throws Exception
{
diff --git a/test-jetty-servlet/src/test/java/org/eclipse/jetty/testing/HttpTesterTest.java b/test-jetty-servlet/src/test/java/org/eclipse/jetty/testing/HttpTesterTest.java
index b509441e32e..e78c070f353 100644
--- a/test-jetty-servlet/src/test/java/org/eclipse/jetty/testing/HttpTesterTest.java
+++ b/test-jetty-servlet/src/test/java/org/eclipse/jetty/testing/HttpTesterTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/test-jetty-servlet/src/test/java/org/eclipse/jetty/testing/ServletTest.java b/test-jetty-servlet/src/test/java/org/eclipse/jetty/testing/ServletTest.java
index 0dcc7394fd1..f55f49838bd 100644
--- a/test-jetty-servlet/src/test/java/org/eclipse/jetty/testing/ServletTest.java
+++ b/test-jetty-servlet/src/test/java/org/eclipse/jetty/testing/ServletTest.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
diff --git a/test-jetty-webapp/pom.xml b/test-jetty-webapp/pom.xml
index 1cb0b4c05fb..f643c779fba 100644
--- a/test-jetty-webapp/pom.xml
+++ b/test-jetty-webapp/pom.xml
@@ -163,6 +163,11 @@
jetty-servlets
${project.version}