[BUG-27751] update headers and remove extra file

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@448 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Jesse McConnell 2009-06-30 21:34:46 +00:00
parent 639d9712bc
commit 54414938a6
15 changed files with 159 additions and 146 deletions

View File

@ -1,15 +1,18 @@
package org.eclipse.jetty.policy; package org.eclipse.jetty.policy;
//======================================================================== //========================================================================
//Copyright (c) 2003-2009 Mort Bay Consulting Pty. Ltd. //Copyright (c) Webtide LLC
//------------------------------------------------------------------------ //------------------------------------------------------------------------
//All rights reserved. This program and the accompanying materials //All rights reserved. This program and the accompanying materials
//are made available under the terms of the Eclipse Public License v1.0 //are made available under the terms of the Eclipse Public License v1.0
//and Apache License v2.0 which accompanies this distribution. //and Apache License v2.0 which accompanies this distribution.
//
//The Eclipse Public License is available at //The Eclipse Public License is available at
//http://www.eclipse.org/legal/epl-v10.html //http://www.eclipse.org/legal/epl-v10.html
//
//The Apache License v2.0 is available at //The Apache License v2.0 is available at
//http://www.opensource.org/licenses/apache2.0.php //http://www.opensource.org/licenses/apache2.0.php
//
//You may elect to redistribute this code under either of these licenses. //You may elect to redistribute this code under either of these licenses.
//======================================================================== //========================================================================
@ -56,9 +59,7 @@ public class JettyPolicy extends Policy
{ {
// Policy files that are actively managed by the aggregate policy mechanism // Policy files that are actively managed by the aggregate policy mechanism
private Set<String> _policies; private Set<String> _policies;
private PropertyEvaluator _evaluator;
private Map<ProtectionDomain, PolicyEntry> pdMapping = private Map<ProtectionDomain, PolicyEntry> pdMapping =
Collections.synchronizedMap( new HashMap<ProtectionDomain, PolicyEntry>() ); Collections.synchronizedMap( new HashMap<ProtectionDomain, PolicyEntry>() );

View File

@ -1,4 +1,19 @@
package org.eclipse.jetty.policy; package org.eclipse.jetty.policy;
//========================================================================
//Copyright (c) Webtide LLC
//------------------------------------------------------------------------
//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.apache.org/licenses/LICENSE-2.0.txt
//
//You may elect to redistribute this code under either of these licenses.
//========================================================================
import java.security.KeyStore; import java.security.KeyStore;
import java.security.Principal; import java.security.Principal;

View File

@ -1,5 +1,21 @@
package org.eclipse.jetty.policy; package org.eclipse.jetty.policy;
//========================================================================
//Copyright (c) Webtide LLC
//------------------------------------------------------------------------
//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.apache.org/licenses/LICENSE-2.0.txt
//
//You may elect to redistribute this code under either of these licenses.
//========================================================================
import java.security.CodeSource; import java.security.CodeSource;
import java.security.PermissionCollection; import java.security.PermissionCollection;
import java.security.Principal; import java.security.Principal;

View File

@ -1,16 +1,18 @@
package org.eclipse.jetty.policy; package org.eclipse.jetty.policy;
//======================================================================== //========================================================================
//Copyright (c) 2004-2009 Mort Bay Consulting Pty. Ltd. //Copyright (c) Webtide LLC
//------------------------------------------------------------------------ //------------------------------------------------------------------------
//All rights reserved. This program and the accompanying materials //All rights reserved. This program and the accompanying materials
//are made available under the terms of the Eclipse Public License v1.0 //are made available under the terms of the Eclipse Public License v1.0
//and Apache License v2.0 which accompanies this distribution. //and Apache License v2.0 which accompanies this distribution.
//The Eclipse Public License is available at //
//The Eclipse Public License is available at
//http://www.eclipse.org/legal/epl-v10.html //http://www.eclipse.org/legal/epl-v10.html
//
//The Apache License v2.0 is available at //The Apache License v2.0 is available at
//http://www.opensource.org/licenses/apache2.0.php //http://www.apache.org/licenses/LICENSE-2.0.txt
//You may elect to redistribute this code under either of these licenses. //
//You may elect to redistribute this code under either of these licenses.
//======================================================================== //========================================================================

View File

@ -1,102 +0,0 @@
package org.eclipse.jetty.policy;
//========================================================================
//Copyright (c) 2003-2009 Mort Bay Consulting 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.
//========================================================================
import java.io.File;
import java.security.Principal;
import java.util.HashMap;
import java.util.Map;
/*
* Property evaluator to provide common reference object for property access and evaluation
*
* The origin of this class was in the Main.class of the jetty-start package where is where
* it picks up the convention of $() properties and ${} system properties
*
* Not exactly sun convention but a jetty convention none the less
*/
public class PropertyEvaluator extends HashMap<String,String>
{
private static final long serialVersionUID = -7745629868268683553L;
public PropertyEvaluator( Map<String,String> properties )
{
putAll( properties );
put("/", File.separator ); // '/' is a special case when evaluated itself, resolves to File.separator as per policy parsing convention
}
/**
* returns the value of it exists in this map, otherwise consults the System properties
*
* @param name
* @return
*/
public String getSystemProperty(String name)
{
if (containsKey(name))
{
return get(name);
}
return System.getProperty(name);
}
public String getProperty(String name)
{
return get(name);
}
/* ------------------------------------------------------------ */
public String evaluate(String s)
{
int i1=0;
int i2=0;
/*
while (s!=null)
{
i1=s.indexOf("$(",i2);
if (i1<0)
break;
i2=s.indexOf(")",i1+2);
if (i2<0)
break;
String name=s.substring(i1+2,i2);
String property=getSystemProperty(name);
s=s.substring(0,i1)+property+s.substring(i2+1);
}
i1=0;
i2=0;
*/
while (s!=null)
{
i1=s.indexOf("${",i2);
if (i1<0)
break;
i2=s.indexOf("}",i1+2);
if (i2<0)
break;
String name=s.substring(i1+2,i2);
String property=getSystemProperty(name);
s=s.substring(0,i1)+property+s.substring(i2+1);
}
return s;
}
}

View File

@ -1,4 +1,19 @@
package org.eclipse.jetty.policy.component; package org.eclipse.jetty.policy.component;
//========================================================================
//Copyright (c) Webtide LLC
//------------------------------------------------------------------------
//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.apache.org/licenses/LICENSE-2.0.txt
//
//You may elect to redistribute this code under either of these licenses.
//========================================================================
import org.eclipse.jetty.policy.PolicyContext; import org.eclipse.jetty.policy.PolicyContext;
import org.eclipse.jetty.policy.PolicyException; import org.eclipse.jetty.policy.PolicyException;

View File

@ -1,4 +1,19 @@
package org.eclipse.jetty.policy.component; package org.eclipse.jetty.policy.component;
//========================================================================
//Copyright (c) Webtide LLC
//------------------------------------------------------------------------
//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.apache.org/licenses/LICENSE-2.0.txt
//
//You may elect to redistribute this code under either of these licenses.
//========================================================================
import java.net.URL; import java.net.URL;
import java.security.CodeSource; import java.security.CodeSource;
@ -17,8 +32,6 @@ import java.util.StringTokenizer;
import org.eclipse.jetty.policy.PolicyContext; import org.eclipse.jetty.policy.PolicyContext;
import org.eclipse.jetty.policy.PolicyException; import org.eclipse.jetty.policy.PolicyException;
public class GrantNode extends AbstractNode public class GrantNode extends AbstractNode
{ {

View File

@ -1,4 +1,19 @@
package org.eclipse.jetty.policy.component; package org.eclipse.jetty.policy.component;
//========================================================================
//Copyright (c) Webtide LLC
//------------------------------------------------------------------------
//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.apache.org/licenses/LICENSE-2.0.txt
//
//You may elect to redistribute this code under either of these licenses.
//========================================================================
import java.io.InputStream; import java.io.InputStream;
import java.net.URL; import java.net.URL;

View File

@ -1,4 +1,19 @@
package org.eclipse.jetty.policy.component; package org.eclipse.jetty.policy.component;
//========================================================================
//Copyright (c) Webtide LLC
//------------------------------------------------------------------------
//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.apache.org/licenses/LICENSE-2.0.txt
//
//You may elect to redistribute this code under either of these licenses.
//========================================================================
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.security.KeyStore; import java.security.KeyStore;

View File

@ -1,4 +1,19 @@
package org.eclipse.jetty.policy.component; package org.eclipse.jetty.policy.component;
//========================================================================
//Copyright (c) Webtide LLC
//------------------------------------------------------------------------
//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.apache.org/licenses/LICENSE-2.0.txt
//
//You may elect to redistribute this code under either of these licenses.
//========================================================================
import java.security.KeyStoreException; import java.security.KeyStoreException;
import java.security.Principal; import java.security.Principal;

View File

@ -1,17 +1,20 @@
package org.eclipse.jetty.policy.loader; package org.eclipse.jetty.policy.loader;
//======================================================================== //========================================================================
//Copyright (c) 2004-2009 Mort Bay Consulting Pty. Ltd. //Copyright (c) Webtide LLC
//------------------------------------------------------------------------ //------------------------------------------------------------------------
//All rights reserved. This program and the accompanying materials //All rights reserved. This program and the accompanying materials
//are made available under the terms of the Eclipse Public License v1.0 //are made available under the terms of the Eclipse Public License v1.0
//and Apache License v2.0 which accompanies this distribution. //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.
// //
//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.apache.org/licenses/LICENSE-2.0.txt
//
//You may elect to redistribute this code under either of these licenses.
//========================================================================
//Portions of this file adapted for use from Apache Harmony code by written //Portions of this file adapted for use from Apache Harmony code by written
//and contributed to that project by Alexey V. Varlamov under the ASL //and contributed to that project by Alexey V. Varlamov under the ASL
//======================================================================== //========================================================================

View File

@ -1,35 +1,22 @@
package org.eclipse.jetty.policy.loader; package org.eclipse.jetty.policy.loader;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//======================================================================== //========================================================================
//Copyright (c) Webtide LLC
//------------------------------------------------------------------------
//All rights reserved. This program and the accompanying materials //All rights reserved. This program and the accompanying materials
//are made available under the terms of the Eclipse Public License v1.0 //are made available under the terms of the Eclipse Public License v1.0
//and Apache License v2.0 which accompanies this distribution. //and Apache License v2.0 which accompanies this distribution.
//The Eclipse Public License is available at //
//The Eclipse Public License is available at
//http://www.eclipse.org/legal/epl-v10.html //http://www.eclipse.org/legal/epl-v10.html
//
//The Apache License v2.0 is available at //The Apache License v2.0 is available at
//http://www.opensource.org/licenses/apache2.0.php //http://www.apache.org/licenses/LICENSE-2.0.txt
//You may elect to redistribute this code under either of these licenses. //
// //You may elect to redistribute this code under either of these licenses.
//========================================================================
// This file adapted for use from Apache Harmony code by written and contributed // This file adapted for use from Apache Harmony code by written and contributed
// to that project by Alexey V. Varlamov under the ASL-2.0 // to that project by Alexey V. Varlamov under the ASL-2.0
//
// See CQ3380 // See CQ3380
//======================================================================== //========================================================================

View File

@ -1,15 +1,18 @@
package org.eclipse.jetty.policy; package org.eclipse.jetty.policy;
//======================================================================== //========================================================================
//Copyright (c) 2003-2009 Mort Bay Consulting Pty. Ltd. //Copyright (c) Webtide LLC
//------------------------------------------------------------------------ //------------------------------------------------------------------------
//All rights reserved. This program and the accompanying materials //All rights reserved. This program and the accompanying materials
//are made available under the terms of the Eclipse Public License v1.0 //are made available under the terms of the Eclipse Public License v1.0
//and Apache License v2.0 which accompanies this distribution. //and Apache License v2.0 which accompanies this distribution.
//The Eclipse Public License is available at //
//The Eclipse Public License is available at
//http://www.eclipse.org/legal/epl-v10.html //http://www.eclipse.org/legal/epl-v10.html
//
//The Apache License v2.0 is available at //The Apache License v2.0 is available at
//http://www.opensource.org/licenses/apache2.0.php //http://www.apache.org/licenses/LICENSE-2.0.txt
//You may elect to redistribute this code under either of these licenses. //
//You may elect to redistribute this code under either of these licenses.
//======================================================================== //========================================================================
import java.io.FilePermission; import java.io.FilePermission;

View File

@ -1,6 +1,6 @@
package org.eclipse.jetty.policy; package org.eclipse.jetty.policy;
//======================================================================== //========================================================================
//Copyright (c) 2003-2009 Mort Bay Consulting Pty. Ltd. //Copyright (c) Webtide LLC
//------------------------------------------------------------------------ //------------------------------------------------------------------------
//All rights reserved. This program and the accompanying materials //All rights reserved. This program and the accompanying materials
//are made available under the terms of the Eclipse Public License v1.0 //are made available under the terms of the Eclipse Public License v1.0

View File

@ -1,4 +1,19 @@
package org.eclipse.jetty.policy; package org.eclipse.jetty.policy;
//========================================================================
//Copyright (c) Webtide LLC
//------------------------------------------------------------------------
//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.apache.org/licenses/LICENSE-2.0.txt
//
//You may elect to redistribute this code under either of these licenses.
//========================================================================
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;