KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > bean > helpers > BeanConfigurator


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.bean.helpers;
17
18 import java.io.BufferedReader JavaDoc;
19 import java.io.FileReader JavaDoc;
20 import java.util.ArrayList JavaDoc;
21 import java.util.List JavaDoc;
22
23 import org.apache.cocoon.bean.CocoonBean;
24 import org.apache.cocoon.bean.helpers.OutputStreamListener;
25 import org.apache.commons.lang.BooleanUtils;
26
27 import org.w3c.dom.Document JavaDoc;
28 import org.w3c.dom.NamedNodeMap JavaDoc;
29 import org.w3c.dom.Node JavaDoc;
30 import org.w3c.dom.NodeList JavaDoc;
31
32 /**
33  * Static class for configuring a CocoonBean from a DOM Document object
34  *
35  * @author <a HREF="mailto:uv@upaya.co.uk">Upayavira</a>
36  * @version CVS $Id: BeanConfigurator.java 123789 2004-12-31 13:39:40Z antonio $
37  */

38 public class BeanConfigurator {
39
40     private static final String JavaDoc NODE_ROOT = "cocoon";
41     private static final String JavaDoc ATTR_VERBOSE = "verbose";
42
43     private static final String JavaDoc NODE_LOGGING = "logging";
44     private static final String JavaDoc ATTR_LOG_KIT = "log-kit";
45     private static final String JavaDoc ATTR_LOG_LEVEL = "level";
46     private static final String JavaDoc ATTR_LOGGER = "logger";
47
48     private static final String JavaDoc NODE_CONTEXT_DIR = "context-dir";
49     private static final String JavaDoc NODE_DEST_DIR = "dest-dir";
50     private static final String JavaDoc NODE_WORK_DIR = "work-dir";
51     private static final String JavaDoc NODE_CONFIG_FILE = "config-file";
52     private static final String JavaDoc NODE_URI_FILE = "uri-file";
53     private static final String JavaDoc NODE_CHECKSUMS_URI = "checksums-uri";
54  
55     private static final String JavaDoc ATTR_CONTEXT_DIR = "context-dir";
56     private static final String JavaDoc ATTR_DEST_DIR = "dest-dir";
57     private static final String JavaDoc ATTR_WORK_DIR = "work-dir";
58     private static final String JavaDoc ATTR_CONFIG_FILE = "config-file";
59     private static final String JavaDoc ATTR_URI_FILE = "uri-file";
60     private static final String JavaDoc ATTR_CHECKSUMS_URI = "checksums-uri";
61     private static final String JavaDoc ATTR_AGENT = "user-agent";
62     private static final String JavaDoc ATTR_ACCEPT = "accept";
63     private static final String JavaDoc ATTR_DEFAULT_FILENAME = "default-filename";
64      
65     private static final String JavaDoc NODE_BROKEN_LINKS = "broken-links";
66     private static final String JavaDoc ATTR_BROKEN_LINK_REPORT_TYPE = "type";
67     private static final String JavaDoc ATTR_BROKEN_LINK_REPORT_FILE = "file";
68     private static final String JavaDoc ATTR_BROKEN_LINK_GENERATE = "generate";
69     private static final String JavaDoc ATTR_BROKEN_LINK_EXTENSION = "extension";
70
71     private static final String JavaDoc NODE_AGENT = "user-agent";
72     private static final String JavaDoc NODE_ACCEPT = "accept";
73
74     private static final String JavaDoc ATTR_FOLLOW_LINKS = "follow-links";
75     private static final String JavaDoc ATTR_PRECOMPILE_ONLY = "precompile-only";
76     private static final String JavaDoc ATTR_CONFIRM_EXTENSIONS = "confirm-extensions";
77     private static final String JavaDoc NODE_LOAD_CLASS = "load-class";
78     private static final String JavaDoc NODE_DEFAULT_FILENAME = "default-filename";
79
80     private static final String JavaDoc NODE_INCLUDE = "include";
81     private static final String JavaDoc NODE_EXCLUDE = "exclude";
82     private static final String JavaDoc ATTR_INCLUDE_EXCLUDE_PATTERN = "pattern";
83     
84     private static final String JavaDoc NODE_INCLUDE_LINKS = "include-links";
85     private static final String JavaDoc ATTR_LINK_EXTENSION = "extension";
86     
87     private static final String JavaDoc NODE_URI = "uri";
88     private static final String JavaDoc ATTR_URI_TYPE = "type";
89     private static final String JavaDoc ATTR_URI_SOURCEPREFIX = "src-prefix";
90     private static final String JavaDoc ATTR_URI_SOURCEURI = "src";
91     private static final String JavaDoc ATTR_URI_DESTURI = "dest";
92
93     private static final String JavaDoc NODE_URIS = "uris";
94     private static final String JavaDoc ATTR_NAME = "name";
95     
96     public static String JavaDoc configure(Document JavaDoc xconf, CocoonBean cocoon, String JavaDoc destDir, String JavaDoc uriGroup, OutputStreamListener listener)
97         throws IllegalArgumentException JavaDoc {
98
99         Node JavaDoc root = xconf.getDocumentElement();
100         if (!NODE_ROOT.equals(root.getNodeName())) {
101             throw new IllegalArgumentException JavaDoc("Expected root node of "+ NODE_ROOT);
102         }
103
104         if (hasAttribute(root, ATTR_VERBOSE)) {
105             cocoon.setVerbose(getBooleanAttributeValue(root, ATTR_VERBOSE));
106         }
107         if (hasAttribute(root, ATTR_FOLLOW_LINKS)) {
108             cocoon.setFollowLinks(getBooleanAttributeValue(root, ATTR_FOLLOW_LINKS));
109         }
110         if (hasAttribute(root, ATTR_PRECOMPILE_ONLY)) {
111             cocoon.setPrecompileOnly(getBooleanAttributeValue(root, ATTR_PRECOMPILE_ONLY));
112         }
113         if (hasAttribute(root, ATTR_CONFIRM_EXTENSIONS)) {
114             cocoon.setConfirmExtensions(getBooleanAttributeValue(root, ATTR_CONFIRM_EXTENSIONS));
115         }
116         if (hasAttribute(root, ATTR_CONTEXT_DIR)) {
117             cocoon.setContextDir(getAttributeValue(root, ATTR_CONTEXT_DIR));
118         }
119         if (hasAttribute(root, ATTR_DEST_DIR)) {
120             destDir = getAttributeValue(root, ATTR_DEST_DIR);
121         }
122         if (hasAttribute(root, ATTR_WORK_DIR)) {
123             cocoon.setWorkDir(getAttributeValue(root, ATTR_WORK_DIR));
124         }
125         if (hasAttribute(root, ATTR_CONFIG_FILE)) {
126             cocoon.setConfigFile(getAttributeValue(root, ATTR_CONFIG_FILE));
127         }
128         if (hasAttribute(root, ATTR_URI_FILE)) {
129             cocoon.addTargets(processURIFile(getAttributeValue(root, ATTR_URI_FILE)), destDir);
130         }
131         if (hasAttribute(root, ATTR_CHECKSUMS_URI)) {
132             cocoon.setChecksumURI(getAttributeValue(root, ATTR_CHECKSUMS_URI));
133         }
134         if (hasAttribute(root, ATTR_AGENT)) {
135             cocoon.setAgentOptions(getAttributeValue(root, ATTR_AGENT));
136         }
137         if (hasAttribute(root, ATTR_ACCEPT)) {
138             cocoon.setAcceptOptions(getAttributeValue(root, ATTR_ACCEPT));
139         }
140         if (hasAttribute(root, ATTR_DEFAULT_FILENAME)) {
141             cocoon.setDefaultFilename(getAttributeValue(root, ATTR_DEFAULT_FILENAME));
142         }
143
144         if (destDir == null || destDir.length() == 0) {
145             destDir = getNodeValue(root, NODE_DEST_DIR);
146         }
147  
148         NodeList JavaDoc nodes = root.getChildNodes();
149         for (int i = 0; i < nodes.getLength(); i++) {
150             Node JavaDoc node = nodes.item(i);
151             if (node.getNodeType()== Node.ELEMENT_NODE) {
152                 String JavaDoc nodeName = node.getNodeName();
153                 if (nodeName.equals(NODE_BROKEN_LINKS)) {
154                     parseBrokenLinkNode(cocoon, node, listener);
155
156                 } else if (nodeName.equals(NODE_LOAD_CLASS)) {
157                     cocoon.addLoadedClass(getNodeValue(node));
158
159                 } else if (nodeName.equals(NODE_LOGGING)) {
160                     parseLoggingNode(cocoon, node);
161
162                 } else if (nodeName.equals(NODE_CONTEXT_DIR)) {
163                     if (hasAttribute(root, ATTR_CONTEXT_DIR)) {
164                         throw new IllegalArgumentException JavaDoc("Cannot have "+NODE_CONTEXT_DIR+" as both element and attribute");
165                     } else {
166                         cocoon.setContextDir(getNodeValue(node));
167                     }
168
169                 } else if (nodeName.equals(NODE_CONFIG_FILE)) {
170                     if (hasAttribute(root, ATTR_CONFIG_FILE)) {
171                         throw new IllegalArgumentException JavaDoc("Cannot have "+NODE_CONFIG_FILE+" as both element and attribute");
172                     } else {
173                         cocoon.setConfigFile(getNodeValue(node));
174                     }
175                 } else if (nodeName.equals(NODE_DEST_DIR)) {
176                     // Ignore
177

178                 } else if (nodeName.equals(NODE_WORK_DIR)) {
179                     if (hasAttribute(root, ATTR_WORK_DIR)) {
180                         throw new IllegalArgumentException JavaDoc("Cannot have "+NODE_WORK_DIR+" as both element and attribute");
181                     } else {
182                         cocoon.setWorkDir(getNodeValue(node));
183                     }
184                 } else if (nodeName.equals(NODE_CHECKSUMS_URI)) {
185                     if (hasAttribute(root, ATTR_CHECKSUMS_URI)) {
186                         throw new IllegalArgumentException JavaDoc("Cannot have "+NODE_CHECKSUMS_URI+" as both element and attribute");
187                     } else {
188                         cocoon.setChecksumURI(getNodeValue(node));
189                     }
190                 } else if (nodeName.equals(NODE_AGENT)) {
191                     cocoon.setAgentOptions(getNodeValue(node));
192
193                 } else if (nodeName.equals(NODE_ACCEPT)) {
194                     cocoon.setAcceptOptions(getNodeValue(node));
195
196                 } else if (nodeName.equals(NODE_DEFAULT_FILENAME)) {
197                     cocoon.setDefaultFilename(getNodeValue(node));
198
199                 } else if (nodeName.equals(NODE_INCLUDE)) {
200                     String JavaDoc pattern = parseIncludeExcludeNode(cocoon, node, NODE_INCLUDE);
201                     cocoon.addIncludePattern(pattern);
202
203                 } else if (nodeName.equals(NODE_EXCLUDE)) {
204                     String JavaDoc pattern = parseIncludeExcludeNode(cocoon, node, NODE_EXCLUDE);
205                     cocoon.addExcludePattern(pattern);
206
207                 } else if (nodeName.equals(NODE_INCLUDE_LINKS)) {
208                     parseIncludeLinksNode(cocoon, node);
209
210                 } else if (nodeName.equals(NODE_URI)) {
211                     parseURINode(cocoon, node, destDir);
212
213                 } else if (nodeName.equals(NODE_URIS)) {
214                     parseURIsNode(cocoon, node, destDir, uriGroup);
215
216                 } else if (nodeName.equals(NODE_URI_FILE)) {
217                     if (hasAttribute(root, ATTR_URI_FILE)) {
218                         throw new IllegalArgumentException JavaDoc("Cannot have "+NODE_URI_FILE+" as both element and attribute");
219                     } else {
220                         cocoon.addTargets(processURIFile(getNodeValue(node)), destDir);
221                     }
222                 } else {
223                     throw new IllegalArgumentException JavaDoc("Unknown element: <" + nodeName + ">");
224                 }
225             }
226         }
227         return destDir;
228     }
229
230     private static void parseLoggingNode(CocoonBean cocoon, Node JavaDoc node) throws IllegalArgumentException JavaDoc {
231         if (hasAttribute(node, ATTR_LOG_KIT)) {
232             cocoon.setLogKit(getAttributeValue(node, ATTR_LOG_KIT));
233         }
234         if (hasAttribute(node, ATTR_LOGGER)) {
235             cocoon.setLogger(getAttributeValue(node, ATTR_LOGGER));
236         }
237         if (hasAttribute(node, ATTR_LOG_LEVEL)) {
238             cocoon.setLogLevel(getAttributeValue(node, ATTR_LOG_LEVEL));
239         }
240         NodeList JavaDoc nodes = node.getChildNodes();
241         if (nodes.getLength()!=0) {
242             throw new IllegalArgumentException JavaDoc("Unexpected children of <" + NODE_LOGGING + "> node");
243         }
244     }
245
246     private static void parseIncludeLinksNode(CocoonBean cocoon, Node JavaDoc node) throws IllegalArgumentException JavaDoc {
247         if (hasAttribute(node, ATTR_LINK_EXTENSION)) {
248             cocoon.addIncludeLinkExtension(getAttributeValue(node, ATTR_LINK_EXTENSION));
249         }
250     }
251
252     private static void parseBrokenLinkNode(CocoonBean cocoon, Node JavaDoc node, OutputStreamListener listener) throws IllegalArgumentException JavaDoc {
253         if (hasAttribute(node, ATTR_BROKEN_LINK_REPORT_FILE)) {
254             listener.setReportFile(getAttributeValue(node, ATTR_BROKEN_LINK_REPORT_FILE));
255         }
256         if (hasAttribute(node, ATTR_BROKEN_LINK_REPORT_TYPE)) {
257             listener.setReportType(getAttributeValue(node, ATTR_BROKEN_LINK_REPORT_TYPE));
258         }
259         if (hasAttribute(node, ATTR_BROKEN_LINK_GENERATE)) {
260         cocoon.setBrokenLinkGenerate(getBooleanAttributeValue(node, ATTR_BROKEN_LINK_GENERATE));
261         }
262         if (hasAttribute(node, ATTR_BROKEN_LINK_EXTENSION)) {
263         cocoon.setBrokenLinkExtension(getAttributeValue(node, ATTR_BROKEN_LINK_EXTENSION));
264         }
265         NodeList JavaDoc nodes = node.getChildNodes();
266         if (nodes.getLength()!=0) {
267             throw new IllegalArgumentException JavaDoc("Unexpected children of <" + NODE_BROKEN_LINKS + "> node");
268         }
269     }
270
271     private static String JavaDoc parseIncludeExcludeNode(CocoonBean cocoon, Node JavaDoc node, final String JavaDoc NODE_TYPE) throws IllegalArgumentException JavaDoc {
272         NodeList JavaDoc nodes = node.getChildNodes();
273         if (nodes.getLength() != 0) {
274             throw new IllegalArgumentException JavaDoc("Unexpected children of <" + NODE_INCLUDE + "> node");
275         }
276
277         if (hasAttribute(node, ATTR_INCLUDE_EXCLUDE_PATTERN)) {
278             return getAttributeValue(node, ATTR_INCLUDE_EXCLUDE_PATTERN);
279         } else {
280             throw new IllegalArgumentException JavaDoc("Expected a "+ATTR_INCLUDE_EXCLUDE_PATTERN+" attribute for <"+NODE_TYPE+"> node");
281         }
282     }
283
284     private static void parseURIsNode(CocoonBean cocoon, Node JavaDoc node, String JavaDoc destDir, String JavaDoc uriGroup) throws IllegalArgumentException JavaDoc {
285
286         boolean followLinks = cocoon.followLinks();
287         boolean confirmExtensions = cocoon.confirmExtensions();
288         String JavaDoc logger = cocoon.getLoggerName();
289         String JavaDoc destURI = destDir;
290         String JavaDoc root = null;
291         String JavaDoc type = null;
292         String JavaDoc name = null;
293         
294         if (hasAttribute(node, ATTR_FOLLOW_LINKS)) {
295             followLinks = getBooleanAttributeValue(node, ATTR_FOLLOW_LINKS);
296         }
297         if (hasAttribute(node, ATTR_CONFIRM_EXTENSIONS)) {
298             confirmExtensions = getBooleanAttributeValue(node, ATTR_CONFIRM_EXTENSIONS);
299         }
300         if (hasAttribute(node, ATTR_URI_TYPE)) {
301             type = getAttributeValue(node, ATTR_URI_TYPE);
302         }
303         if (hasAttribute(node, ATTR_URI_SOURCEPREFIX)) {
304             root = getAttributeValue(node, ATTR_URI_SOURCEPREFIX);
305         }
306         if (hasAttribute(node, ATTR_URI_DESTURI)) {
307             destURI = getAttributeValue(node, ATTR_URI_DESTURI);
308         }
309         if (hasAttribute(node, ATTR_LOGGER)) {
310             logger = getAttributeValue(node, ATTR_LOGGER);
311         }
312         if (hasAttribute(node, ATTR_NAME)) {
313             name = getAttributeValue(node, ATTR_NAME);
314             if (name != null && uriGroup != null && !name.equals(uriGroup)) {
315                 // The user has not selected this URI group, so ignore it.
316
return;
317             }
318         }
319         NodeList JavaDoc nodes = node.getChildNodes();
320         for (int i = 0; i < nodes.getLength(); i++) {
321             Node JavaDoc child = nodes.item(i);
322             if (child.getNodeType()== Node.ELEMENT_NODE) {
323                 String JavaDoc childName = child.getNodeName();
324                 if (childName.equals(NODE_URI)) {
325                     String JavaDoc _sourceURI = null;
326                     String JavaDoc _destURI = destURI;
327                     String JavaDoc _root = root;
328                     String JavaDoc _type = type;
329                     
330                     if (child.getAttributes().getLength() == 0) {
331                         _sourceURI = getNodeValue(child);
332                         //destURI is inherited
333
} else {
334                         _sourceURI = getAttributeValue(child, ATTR_URI_SOURCEURI);
335
336                         if (hasAttribute(child, ATTR_URI_TYPE)) {
337                             _type = getAttributeValue(child, ATTR_URI_TYPE);
338                         }
339                         if (hasAttribute(child, ATTR_URI_SOURCEPREFIX)) {
340                             _root = getAttributeValue(child, ATTR_URI_SOURCEPREFIX);
341                         }
342                         if (hasAttribute(child, ATTR_URI_DESTURI)) {
343                             _destURI = getAttributeValue(child, ATTR_URI_DESTURI);
344                         }
345                     }
346                     cocoon.addTarget(_type, _root, _sourceURI, _destURI, followLinks, confirmExtensions, logger);
347                 } else {
348                     throw new IllegalArgumentException JavaDoc("Unknown element: <" + childName + ">");
349                 }
350             }
351         }
352     }
353         
354     private static void parseURINode(CocoonBean cocoon, Node JavaDoc node, String JavaDoc destDir) throws IllegalArgumentException JavaDoc {
355         NodeList JavaDoc nodes = node.getChildNodes();
356
357         if (node.getAttributes().getLength() == 0 && nodes.getLength() != 0) {
358             cocoon.addTarget(getNodeValue(node), destDir);
359         } else if (node.getAttributes().getLength() !=0 && nodes.getLength() ==0){
360
361             String JavaDoc src = getAttributeValue(node, ATTR_URI_SOURCEURI);
362
363             String JavaDoc type = null;
364             if (hasAttribute(node, ATTR_URI_TYPE)) {
365                 type = getAttributeValue(node, ATTR_URI_TYPE);
366             }
367             String JavaDoc root = null;
368             if (hasAttribute(node, ATTR_URI_SOURCEPREFIX)) {
369                 root = getAttributeValue(node, ATTR_URI_SOURCEPREFIX);
370             }
371             String JavaDoc dest = null;
372             if (hasAttribute(node, ATTR_URI_DESTURI)) {
373                 dest = getAttributeValue(node, ATTR_URI_DESTURI);
374             }
375
376             if (root != null && type != null && dest != null) {
377                 cocoon.addTarget(type, root, src, dest);
378             } else if (root != null && dest != null) {
379                 cocoon.addTarget(root, src, dest);
380             } else if (dest != null) {
381                 cocoon.addTarget(src, dest);
382             } else {
383                 cocoon.addTarget(src, destDir);
384             }
385         } else if (node.getAttributes().getLength() !=0 && nodes.getLength() != 0) {
386             throw new IllegalArgumentException JavaDoc("Unexpected children of <" + NODE_URI + "> node");
387         } else {
388             throw new IllegalArgumentException JavaDoc("Not enough information for <"+ NODE_URI + "> node");
389         }
390     }
391
392     private static String JavaDoc getNodeValue(Node JavaDoc root, String JavaDoc name) throws IllegalArgumentException JavaDoc {
393         NodeList JavaDoc nodes = root.getChildNodes();
394         for (int i = 0; i < nodes.getLength(); i++) {
395             Node JavaDoc node = nodes.item(i);
396             if (node.getNodeType()== Node.ELEMENT_NODE) {
397                 String JavaDoc nodeName = node.getNodeName();
398                 if (nodeName.equals(name)) {
399                     return getNodeValue(node);
400                 }
401             }
402         }
403         return null;
404     }
405
406     private static String JavaDoc getNodeValue(Node JavaDoc node) throws IllegalArgumentException JavaDoc {
407         StringBuffer JavaDoc s = new StringBuffer JavaDoc();
408         NodeList JavaDoc children = node.getChildNodes();
409         boolean found = false;
410
411         for (int i = 0; i < children.getLength(); i++) {
412             Node JavaDoc child = children.item(i);
413             if (child.getNodeType() == Node.TEXT_NODE) {
414                 s.append(child.getNodeValue());
415                 found = true;
416             } else {
417                 throw new IllegalArgumentException JavaDoc("Unexpected node:" + child.getLocalName());
418             }
419         }
420         if (!found) {
421             throw new IllegalArgumentException JavaDoc("Expected value for " + node.getLocalName() + " node");
422         }
423         return s.toString();
424     }
425
426     private static String JavaDoc getAttributeValue(Node JavaDoc node, String JavaDoc attr) throws IllegalArgumentException JavaDoc {
427         NamedNodeMap JavaDoc nodes = node.getAttributes();
428         if (nodes != null) {
429             Node JavaDoc attribute = nodes.getNamedItem(attr);
430             if (attribute != null && attribute.getNodeValue() != null) {
431                 return attribute.getNodeValue();
432             }
433         }
434         throw new IllegalArgumentException JavaDoc("Missing " + attr + " attribute on <" + node.getNodeName() + "> node");
435     }
436
437     private static boolean hasAttribute(Node JavaDoc node, String JavaDoc attr) {
438         NamedNodeMap JavaDoc nodes = node.getAttributes();
439         if (nodes != null) {
440             Node JavaDoc attribute = nodes.getNamedItem(attr);
441             return (attribute != null);
442         }
443         return false;
444     }
445
446     private static boolean getBooleanAttributeValue(Node JavaDoc node, String JavaDoc attr) {
447         NamedNodeMap JavaDoc nodes = node.getAttributes();
448         if (nodes != null) {
449             Node JavaDoc attribute = nodes.getNamedItem(attr);
450
451             if (attribute != null) {
452                 String JavaDoc value = attribute.getNodeValue();
453                 return BooleanUtils.toBoolean(value);
454             }
455         }
456         return false;
457     }
458
459     /**
460      * <code>processURIFile</code> method.
461      *
462      * @param filename a <code>String</code> value
463      * @return uris a <code>List</code> of URIs
464      */

465     public static List JavaDoc processURIFile(String JavaDoc filename) {
466         List JavaDoc uris = new ArrayList JavaDoc();
467         try {
468             BufferedReader JavaDoc uriFile = new BufferedReader JavaDoc(new FileReader JavaDoc(filename));
469
470             while (true) {
471                 String JavaDoc uri = uriFile.readLine();
472
473                 if (null == uri) {
474                     break;
475                 }
476                 
477                 uri = uri.trim();
478                 if (!uri.equals("") && !uri.startsWith("#")){
479                     uris.add(uri.trim());
480                 }
481             }
482
483             uriFile.close();
484         } catch (Exception JavaDoc e) {
485             // ignore errors.
486
}
487         return uris;
488     }
489
490 }
491
Popular Tags