View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      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.jetspeed.deployment;
18  
19  import java.io.File;
20  import java.io.IOException;
21  import java.io.InputStream;
22  
23  /***
24   * <p>
25   * DeploymentObject
26   * </p>
27   * <p> 
28   *   Object representation of a deployment artifact of some type.
29   * </p>
30   * 
31   * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
32   * @version $Id: DeploymentObject.java 516448 2007-03-09 16:25:47Z ate $
33   *
34   */
35  public interface DeploymentObject
36  {
37  
38  	/***
39  	 * Closes any resources that may have been opend during the use
40  	 * of this ObjectHandler.
41  	 * @throws IOException
42  	 */
43  	void close() throws IOException;
44  	
45  	/***
46  	 * retreives the the configuration for this deployment artifact
47  	 * based on the artifact-relative <code>configPath</code>
48  	 * provided.
49  	 * @param configPath artifact-relative path to the confiuration file
50  	 * @return Configuration of this artificat or <code>null</code> if the 
51  	 * configuration is not present in the artifact.
52  	 * @throws IOException error opening the configuration
53  	 */
54  	InputStream getConfiguration(String configPath) throws IOException;
55  	/***
56  	 * 
57  	 * <p>
58  	 * getName
59  	 * </p>
60  	 *
61  	 * @return name of the deployment object.  Yeilds the same result as if you were
62  	 * to invoke: <code>new java.io.File(getPath()).getName()</code>
63  	 */
64  	String getName();
65  	
66  	/***
67  	 * 
68  	 * <p>
69  	 * getPath
70  	 * </p>
71  	 *
72  	 * @return path the deployment object's source directory or jar/war file.
73  	 */
74  	String getPath();
75  	
76  	/***
77  	 * 
78     * @return the underlying File object
79  	 */
80  	File getFile();
81  }