KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > retriever > RetrieveEntry


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.xml.retriever;
20
21 import java.io.File JavaDoc;
22 import org.netbeans.modules.xml.retriever.catalog.Utilities.DocumentTypesEnum;
23
24
25 public class RetrieveEntry{
26     //address from where this file was refered. Null for root file.
27
private String JavaDoc baseAddress;
28     //relative/abs address of the external entry
29
private String JavaDoc currentAddress;
30     //location of the base file
31
private File JavaDoc localBaseFile = null;
32     //location where this file has to be stroed or was stored
33
private File JavaDoc saveFile = null;
34     //retrieve this entry recursively
35
private boolean recursive = false;
36     //what is the type of this document.
37
private DocumentTypesEnum docType = DocumentTypesEnum.schema;
38     //final abs address from where the file was retrieved
39
private String JavaDoc effectiveAddress = null;
40     
41     public RetrieveEntry(String JavaDoc baseAddress, String JavaDoc currentAddress, File JavaDoc localBaseFile){
42         this.baseAddress = baseAddress;
43         this.currentAddress = currentAddress;
44         this.localBaseFile = localBaseFile;
45     }
46     
47     public RetrieveEntry(String JavaDoc baseAddress, String JavaDoc currentAddress, File JavaDoc localBaseFile, File JavaDoc saveFile, DocumentTypesEnum docType, boolean recursive){
48         this.baseAddress = baseAddress;
49         this.currentAddress = currentAddress;
50         this.localBaseFile = localBaseFile;
51         this.saveFile = saveFile;
52         this.setDocType(docType);
53         this.setRecursive(recursive);
54     }
55     
56     public String JavaDoc getBaseAddress() {
57         return baseAddress;
58     }
59     
60     public void setBaseAddress(String JavaDoc baseAddress) {
61         this.baseAddress = baseAddress;
62     }
63     
64     public String JavaDoc getCurrentAddress() {
65         return currentAddress;
66     }
67     
68     public void setCurrentAddress(String JavaDoc currentAddress) {
69         this.currentAddress = currentAddress;
70     }
71     
72     public File JavaDoc getLocalBaseFile() {
73         return localBaseFile;
74     }
75     
76     public void setLocalBaseFile(File JavaDoc localBaseFile) {
77         this.localBaseFile = localBaseFile;
78     }
79     
80     public File JavaDoc getSaveFile() {
81         return saveFile;
82     }
83     
84     public void setSaveFile(File JavaDoc saveFile) {
85         this.saveFile = saveFile;
86     }
87
88     public boolean isRecursive() {
89         return recursive;
90     }
91
92     public void setRecursive(boolean recursive) {
93         this.recursive = recursive;
94     }
95
96     public DocumentTypesEnum getDocType() {
97         return docType;
98     }
99
100     public void setDocType(DocumentTypesEnum docType) {
101         this.docType = docType;
102     }
103     //NOI18N
104
public String JavaDoc toString(){
105         return "base:" +this.baseAddress+
106                 "\n\tcur:" +this.currentAddress+
107                 "\n\tbFile:" +this.localBaseFile+
108                 "\n\tcFile:" +this.saveFile+
109                 "\n\tdType:" +this.docType+
110                 "\n\trec:"+this.recursive;
111     }
112
113     public String JavaDoc getEffectiveAddress() {
114         return effectiveAddress;
115     }
116
117     public void setEffectiveAddress(String JavaDoc effectiveAddress) {
118         this.effectiveAddress = effectiveAddress;
119     }
120 }
Popular Tags