001 /** 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017 018 package org.apache.geronimo.system.serverinfo; 019 020 import java.io.File; 021 import java.net.URI; 022 023 /** 024 * Contains information about the server and functions for resolving 025 * pathnames. 026 * 027 * @version $Rev: 476049 $ $Date: 2006-11-16 23:35:17 -0500 (Thu, 16 Nov 2006) $ 028 */ 029 public interface ServerInfo { 030 public String resolvePath(final String filename); 031 032 public String resolveServerPath(final String filename); 033 034 /** 035 * Resolves a relative pathname to a File, relative to the server 036 * installation directory (e.g. "foo" becomes .../geronimo/foo) 037 * 038 * @param filename a <code>String</code> containing a pathname, 039 * which will be resolved by {@link #resolvePath(String 040 * filename)}. 041 * @return a <code>File</code> value 042 */ 043 public File resolve(final String filename); 044 045 /** 046 * Resolves a relative pathname to a File, relative to the server 047 * configuration directory. Normally, this is the same as the Geronimo 048 * installation directory (e.g. "foo" becomes .../geronimo/foo). 049 * However, you can pass command-line arguments to the server to relocate 050 * this to a server-instance-specific directory (e.g. "var/foo" might 051 * become .../geronimo/instance1/var/foo if the server was started with 052 * the flag indicating that the server instance dir was "instance1"). 053 */ 054 public File resolveServer(final String filename); 055 056 public URI resolve(final URI uri); 057 058 public URI resolveServer(final URI uri); 059 060 /** 061 * A config.xml setting for the base directory. This is normally 062 * left null, which means the ServerInfo will use the Geronimo 063 * install directory. 064 */ 065 public String getBaseDirectory(); 066 067 /** 068 * The base directory that this ServerInfo is actually using. 069 */ 070 public String getCurrentBaseDirectory(); 071 072 public String getVersion(); 073 074 public String getBuildDate(); 075 076 public String getBuildTime(); 077 078 public String getCopyright(); 079 }