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
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041: package org.netbeans.modules.xml.retriever;
042:
043: import java.io.File;
044: import org.netbeans.modules.xml.retriever.catalog.Utilities.DocumentTypesEnum;
045:
046: public class RetrieveEntry {
047: //address from where this file was refered. Null for root file.
048: private String baseAddress;
049: //relative/abs address of the external entry
050: private String currentAddress;
051: //location of the base file
052: private File localBaseFile = null;
053: //location where this file has to be stroed or was stored
054: private File saveFile = null;
055: //retrieve this entry recursively
056: private boolean recursive = false;
057: //what is the type of this document.
058: private DocumentTypesEnum docType = DocumentTypesEnum.schema;
059: //final abs address from where the file was retrieved
060: private String effectiveAddress = null;
061:
062: public RetrieveEntry(String baseAddress, String currentAddress,
063: File localBaseFile) {
064: this .baseAddress = baseAddress;
065: this .currentAddress = currentAddress;
066: this .localBaseFile = localBaseFile;
067: }
068:
069: public RetrieveEntry(String baseAddress, String currentAddress,
070: File localBaseFile, File saveFile,
071: DocumentTypesEnum docType, boolean recursive) {
072: this .baseAddress = baseAddress;
073: this .currentAddress = currentAddress;
074: this .localBaseFile = localBaseFile;
075: this .saveFile = saveFile;
076: this .setDocType(docType);
077: this .setRecursive(recursive);
078: }
079:
080: public String getBaseAddress() {
081: return baseAddress;
082: }
083:
084: public void setBaseAddress(String baseAddress) {
085: this .baseAddress = baseAddress;
086: }
087:
088: public String getCurrentAddress() {
089: return currentAddress;
090: }
091:
092: public void setCurrentAddress(String currentAddress) {
093: this .currentAddress = currentAddress;
094: }
095:
096: public File getLocalBaseFile() {
097: return localBaseFile;
098: }
099:
100: public void setLocalBaseFile(File localBaseFile) {
101: this .localBaseFile = localBaseFile;
102: }
103:
104: public File getSaveFile() {
105: return saveFile;
106: }
107:
108: public void setSaveFile(File saveFile) {
109: this .saveFile = saveFile;
110: }
111:
112: public boolean isRecursive() {
113: return recursive;
114: }
115:
116: public void setRecursive(boolean recursive) {
117: this .recursive = recursive;
118: }
119:
120: public DocumentTypesEnum getDocType() {
121: return docType;
122: }
123:
124: public void setDocType(DocumentTypesEnum docType) {
125: this .docType = docType;
126: }
127:
128: //NOI18N
129: public String toString() {
130: return "base:" + this .baseAddress + "\n\tcur:"
131: + this .currentAddress + "\n\tbFile:"
132: + this .localBaseFile + "\n\tcFile:" + this .saveFile
133: + "\n\tdType:" + this .docType + "\n\trec:"
134: + this .recursive;
135: }
136:
137: public String getEffectiveAddress() {
138: return effectiveAddress;
139: }
140:
141: public void setEffectiveAddress(String effectiveAddress) {
142: this.effectiveAddress = effectiveAddress;
143: }
144: }
|