01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.pluto.util.install.file.tomcat6;
18:
19: import java.io.File;
20:
21: import org.apache.pluto.util.install.InstallationConfig;
22: import org.apache.pluto.util.install.file.tomcat5.Tomcat5FileSystemInstaller;
23:
24: public class Tomcat6FileSystemInstaller extends
25: Tomcat5FileSystemInstaller {
26:
27: public boolean isValidInstallationDirectory(File installDir) {
28: // Tomcat 6 - by default - does away with the classloader
29: // directories <tomcat>/server, <tomcat>/common, and <tomcat>/shared.
30: // Everything by default is installed under <tomcat>/lib.
31: File libDir = new File(installDir, "lib");
32: File serverConf = new File(installDir, "conf/server.xml");
33: File catalinaProps = new File(installDir,
34: "conf/catalina.properties");
35:
36: return libDir.exists() && serverConf.exists()
37: && catalinaProps.exists();
38: }
39:
40: protected File getEndorsedDir(InstallationConfig config) {
41: // Tomcat 6 uses <tomcat>/endorsed
42: return new File(config.getInstallationDirectory(), "endorsed");
43: }
44:
45: protected File getSharedDir(InstallationConfig config) {
46: // Tomcat 6, by default, uses <tomcat>/lib
47: return new File(config.getInstallationDirectory(), "lib");
48: }
49:
50: }
|