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.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: * Closes any resources that may have been opend during the use
39: * of this ObjectHandler.
40: * @throws IOException
41: */
42: void close() throws IOException;
43:
44: /**
45: * retreives the the configuration for this deployment artifact
46: * based on the artifact-relative <code>configPath</code>
47: * provided.
48: * @param configPath artifact-relative path to the confiuration file
49: * @return Configuration of this artificat or <code>null</code> if the
50: * configuration is not present in the artifact.
51: * @throws IOException error opening the configuration
52: */
53: InputStream getConfiguration(String configPath) throws IOException;
54:
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: }
|