KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > deployment > backend > DeployableObjectInfo


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * EnterpriseInfo.java
26  *
27  * Created on November 15, 2001, 9:17 PM
28  */

29
30 package com.sun.enterprise.deployment.backend;
31
32 import java.io.*;
33 import java.util.*;
34 import com.sun.enterprise.util.io.FileUtils;
35
36 /**
37  *
38  * @author bnevins
39  * @version
40  */

41
42 abstract public class DeployableObjectInfo {
43
44     protected DeployableObjectInfo(File rootPath, String JavaDoc name)
45     {
46         this(rootPath, name, null);
47     }
48
49     ///////////////////////////////////////////////////////////////////////////
50

51     protected DeployableObjectInfo(File rootPath, String JavaDoc name, File archive)
52     {
53         this.rootPath = rootPath;
54         this.name = name;
55         this.archive = archive;
56     }
57
58     ///////////////////////////////////////////////////////////////////////////
59

60     /** Prepares a human-readable dump of all the information
61      * contained by this Object. Recursively calls toString()
62      * on contained objects.
63      * @return Returns a String
64      */

65     public String JavaDoc toString()
66     {
67         StringBuffer JavaDoc sb = new StringBuffer JavaDoc("*********** Archive Info Dump ***********\n");
68         
69         sb.append("Root Path: " + getRootPath() + '\n');
70         sb.append("Name: " + getName() + '\n');
71         
72         if(archive != null)
73             sb.append("Original Archive: " + getArchive() + '\n');
74         
75         return sb.toString();
76     }
77
78     ///////////////////////////////////////////////////////////////////////////
79

80     /** Returns the official name (ID) of the object
81      * @return The String ID of this object
82      */

83     public String JavaDoc getName()
84     {
85         return name;
86     }
87
88
89     ///////////////////////////////////////////////////////////////////////////
90

91     /** Returns the top-level directory that this object resides in
92      * @return A File object pointing at the top-level directory containing this object
93      */

94     public File getRootPath()
95     {
96         return rootPath;
97     }
98
99     ///////////////////////////////////////////////////////////////////////////
100

101     File getArchive()
102     {
103         return archive;
104     }
105
106     ///////////////////////////////////////////////////////////////////////////
107

108     private File rootPath;
109     private String JavaDoc name;
110     private File archive = null;
111 }
112
Popular Tags