Line | |
---|
1 | package org.greenstone.admin.guiext;
|
---|
2 |
|
---|
3 | import org.w3c.dom.Element;
|
---|
4 |
|
---|
5 | public class Source
|
---|
6 | {
|
---|
7 | String _method = null;
|
---|
8 | String _url = null;
|
---|
9 | String _folder = null;
|
---|
10 | DownloadStep _parent = null;
|
---|
11 |
|
---|
12 | public Source(String method, String url, String folder, DownloadStep parent)
|
---|
13 | {
|
---|
14 | _parent = parent;
|
---|
15 | _method = method;
|
---|
16 | _url = url;
|
---|
17 | _folder = folder;
|
---|
18 | }
|
---|
19 |
|
---|
20 | public Source(Element sourceElement, DownloadStep parent)
|
---|
21 | {
|
---|
22 | _parent = parent;
|
---|
23 |
|
---|
24 | if(sourceElement != null){
|
---|
25 | _method = sourceElement.getAttribute("method");
|
---|
26 | if(_method.equals("")){
|
---|
27 | System.err.println("This <" + ExtXMLHelper.SOURCE + "> element does not contain a method attribute");
|
---|
28 | }
|
---|
29 |
|
---|
30 | _folder = sourceElement.getAttribute("folder");
|
---|
31 |
|
---|
32 | _url = ExtXMLHelper.getValueFromSingleElement(sourceElement, true);
|
---|
33 | if(_url == null || _url.equals("")){
|
---|
34 | System.err.println("This <" + ExtXMLHelper.SOURCE + "> element does not contain a url");
|
---|
35 | }
|
---|
36 | }
|
---|
37 | else{
|
---|
38 | System.err.println("This <" + ExtXMLHelper.SOURCE + "> element is null");
|
---|
39 | }
|
---|
40 | }
|
---|
41 |
|
---|
42 | public DownloadStep getParent()
|
---|
43 | {
|
---|
44 | return _parent;
|
---|
45 | }
|
---|
46 |
|
---|
47 | public String getMethod()
|
---|
48 | {
|
---|
49 | return _method;
|
---|
50 | }
|
---|
51 |
|
---|
52 | public String getURL()
|
---|
53 | {
|
---|
54 | return _url;
|
---|
55 | }
|
---|
56 |
|
---|
57 | public String getFolder()
|
---|
58 | {
|
---|
59 | return _folder;
|
---|
60 | }
|
---|
61 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.