001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common Development
008: * and Distribution License("CDDL") (collectively, the "License"). You
009: * may not use this file except in compliance with the License. You can obtain
010: * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
011: * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
012: * language governing permissions and limitations under the License.
013: *
014: * When distributing the software, include this License Header Notice in each
015: * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
016: * Sun designates this particular file as subject to the "Classpath" exception
017: * as provided by Sun in the GPL Version 2 section of the License file that
018: * accompanied this code. If applicable, add the following below the License
019: * Header, with the fields enclosed by brackets [] replaced by your own
020: * identifying information: "Portions Copyrighted [year]
021: * [name of copyright owner]"
022: *
023: * Contributor(s):
024: *
025: * If you wish your version of this file to be governed by only the CDDL or
026: * only the GPL Version 2, indicate your decision by adding "[Contributor]
027: * elects to include this software in this distribution under the [CDDL or GPL
028: * Version 2] license." If you don't indicate a single choice of license, a
029: * recipient has the option to distribute your version of this file under
030: * either the CDDL, the GPL Version 2 or to extend the choice of license to
031: * its licensees as provided above. However, if you add GPL Version 2 code
032: * and therefore, elected the GPL Version 2 license, then the option applies
033: * only if the new code is made subject to such option by the copyright
034: * holder.
035: */
036:
037: /*
038: * ArchiveBean.java
039: */
040:
041: package com.sun.jbi.jsf.bean;
042:
043: import com.sun.jbi.jsf.util.JBILogger;
044: import java.util.Properties;
045: import java.util.logging.Logger;
046:
047: public class ArchiveBean {
048:
049: //Get Logger to log fine mesages for debugging
050: private static Logger sLog = JBILogger.getInstance();
051:
052: public String getArchiveAbsolutePath() {
053: String result = mArchiveAbsolutePath;
054: sLog.fine("ArchiveBean.getArchiveAbsolutePath(), result="
055: + result);
056: return result;
057: }
058:
059: public String getArchiveDisplayName() {
060: String result = mArchiveDisplayName;
061: sLog.fine("ArchiveBean.getArchiveDisplayName(), result="
062: + result);
063: return result;
064: }
065:
066: public String getDescription() {
067: String result = mDescription;
068: sLog.fine("ArchiveBean.getDescription(), result=" + result);
069: return result;
070: }
071:
072: public String getJbiName() {
073: String result = mJbiName;
074: sLog.fine("ArchiveBean.getJbiName(), result=" + result);
075: return result;
076: }
077:
078: public String getJbiType() {
079: String result = mJbiType;
080: sLog.fine("ArchiveBean.getJbiType(), result=" + result);
081: return result;
082: }
083:
084: /**
085: * Get true if the provided zip archive is not readable else false
086: * @return - true if there is zipFile reading/processing error
087:
088: */
089: public boolean getZipFileReadError() {
090: boolean zReadError = mZipFileReadError;
091: sLog.fine("ArchiveBean.getZipFileReadError(), zReadError="
092: + zReadError);
093: return zReadError;
094: }
095:
096: /**
097: * Get true if the provided archive file is readable
098: * @return - true if there is error in reading the provided file
099: * - false otherwise
100: */
101:
102: public boolean getFileReadError() {
103: boolean fReadError = mFileReadError;
104: sLog.fine("ArchiveBean.getFileReadError(), fReadError="
105: + fReadError);
106: return fReadError;
107: }
108:
109: /**
110: * Get if the provided zip archive has jbi xml
111: * @return true if archive has jbi.xml file
112: */
113: public boolean getHasJbiXml() {
114: boolean archHasJbi = mHasJbiXml;
115: sLog.fine("ArchiveBean.getHasJbiXml(), archHasJbi="
116: + archHasJbi);
117: return archHasJbi;
118: }
119:
120: public boolean isArchiveValid() {
121: boolean result = mIsArchiveValid;
122: sLog.fine("ArchiveBean.isArchiveValid), result=" + result);
123: return result;
124:
125: }
126:
127: public void setArchiveAbsolutePath(String anArchiveAbsolutePath) {
128: sLog.fine("ArchiveBean.setArchiveAbsolutePath("
129: + anArchiveAbsolutePath + ")");
130: mArchiveAbsolutePath = anArchiveAbsolutePath;
131: }
132:
133: public void setArchiveDisplayName(String anArchiveDisplayName) {
134: sLog.fine("ArchiveBean.setArchiveDisplayName("
135: + anArchiveDisplayName + ")");
136: mArchiveDisplayName = anArchiveDisplayName;
137: }
138:
139: public void setIsArchiveValid(boolean isArchiveValid) {
140: sLog.fine("ArchiveBean.setIsArchiveValid(" + isArchiveValid
141: + ")");
142: mIsArchiveValid = isArchiveValid;
143: }
144:
145: public void setDescription(String aDescription) {
146: sLog.fine("ArchiveBean.setDescription(" + aDescription + ")");
147: mDescription = aDescription;
148: }
149:
150: public void setJbiName(String aJbiName) {
151: sLog.fine("ArchiveBean.setJbiName(" + aJbiName + ")");
152: mJbiName = aJbiName;
153: }
154:
155: public void setJbiType(String aJbiType) {
156: sLog.fine("ArchiveBean.setJbiType(" + aJbiType + ")");
157: if (null == aJbiType) {
158: throw new NullPointerException(
159: "ArchiveBean.setJbiType(null)");
160: }
161: mJbiType = aJbiType;
162: }
163:
164: /*
165: * Set to true after archive entered by user is invalidated because it cannot be read
166: * @pararm aFileReadError - true , if input archive file cannot be read
167: */
168: public void setFileReadError(boolean aFileReadError) {
169: sLog.fine("ArchiveBean.setFileReadError(" + aFileReadError
170: + ")");
171: mFileReadError = aFileReadError;
172: }
173:
174: /*
175: * Set to true after zip archive entered by user is invalidated when it cannot be unzipped
176: *@pararm aFileReadError - true , if input archive file is not recognised as zip file by ZipInputStream
177: */
178: public void setZipFileReadError(boolean aZipFileReadError) {
179: sLog.fine("ArchiveBean.setZipFileReadError("
180: + aZipFileReadError + ")");
181: mZipFileReadError = aZipFileReadError;
182: }
183:
184: /*
185: * Set true after zip archive entered by user is invalidated because it does not have decriptor file
186: * @param aHasJbiXml - true , if input archive file misses jbi.xml in its contents
187: */
188: public void setHasJbiXml(boolean aHasJbiXml) {
189: sLog.fine("ArchiveBean.setHasJbiXml(" + aHasJbiXml + ")");
190: mHasJbiXml = aHasJbiXml;
191: }
192:
193: private String mArchiveAbsolutePath;
194: private String mArchiveDisplayName;
195: private String mDescription;
196: private boolean mIsArchiveValid;
197: private String mJbiName;
198: private String mJbiType;
199: private boolean mFileReadError = false;
200: private boolean mZipFileReadError = false;
201: private boolean mHasJbiXml = true;
202:
203: }
|