01: //========================================================================
02: //$Id: Jetty6MavenTagLibConfiguration.java 1052 2006-10-01 20:31:29Z janb $
03: //Copyright 2000-2005 Mort Bay Consulting Pty. Ltd.
04: //------------------------------------------------------------------------
05: //Licensed under the Apache License, Version 2.0 (the "License");
06: //you may not use this file except in compliance with the License.
07: //You may obtain a copy of the License at
08: //http://www.apache.org/licenses/LICENSE-2.0
09: //Unless required by applicable law or agreed to in writing, software
10: //distributed under the License is distributed on an "AS IS" BASIS,
11: //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: //See the License for the specific language governing permissions and
13: //limitations under the License.
14: //========================================================================
15: package org.mortbay.jetty.plugin;
16:
17: import java.io.File;
18: import java.io.IOException;
19: import java.net.MalformedURLException;
20: import java.net.URL;
21: import java.util.ArrayList;
22: import java.util.Iterator;
23: import java.util.List;
24:
25: import org.mortbay.jetty.webapp.TagLibConfiguration;
26: import org.mortbay.resource.Resource;
27: import org.mortbay.util.TypeUtil;
28:
29: /**
30: * @author janb
31: *
32: */
33: public class Jetty6MavenTagLibConfiguration extends TagLibConfiguration {
34:
35: private List classPathFiles;
36:
37: public void setClassPathFiles(List classPathFiles) {
38: this .classPathFiles = classPathFiles;
39: }
40:
41: public List getClassPathFiles() {
42: return this .classPathFiles;
43: }
44:
45: protected List getJarResourceList() throws MalformedURLException,
46: IOException {
47: List list = new ArrayList();
48:
49: Iterator itor = (getClassPathFiles() == null ? null
50: : getClassPathFiles().iterator());
51: while (itor.hasNext()) {
52: File f = (File) itor.next();
53: if (f.getName().toLowerCase().endsWith(".jar"))
54: list.add(Resource.newResource(f.toURL()));
55: }
56: list.addAll(getServerJarResourceList());
57:
58: return list;
59: }
60:
61: }
|