1
2
3
4
5
6
7
8 package com.buckosoft.PicMan.dom;
9
10 import java.util.Iterator;
11 import java.util.List;
12
13 import org.dom4j.Document;
14 import org.dom4j.DocumentHelper;
15 import org.dom4j.Element;
16
17 import com.buckosoft.PicMan.business.PicManFacade;
18
19
20
21
22
23
24 public class DirsInDirDom {
25
26
27
28
29
30 static public Document createDocument(PicManFacade pmf, int rid, String dir) {
31 Document document = DocumentHelper.createDocument();
32 Element root = document.addElement("DirsInDir");
33 List<String> list = pmf.getDirsInDir(rid, dir);
34 Iterator<String> iter = list.iterator();
35 while (iter.hasNext()) {
36 String s = iter.next();
37 Element ele = DocumentHelper.createElement("Dir");
38 ele.addElement("name").addText(s);
39 root.add(ele);
40 }
41 return(document);
42 }
43
44 }