View Javadoc
1   /******************************************************************************
2    * FilesInDirCountDom.java - Return the number of files/pics in a directory
3    * 
4    * PicMan - The BuckoSoft Picture Manager in Java
5    * Copyright(c) 2008 - Dick Balaska
6    * 
7    */
8   package com.buckosoft.PicMan.dom;
9   
10  import org.dom4j.Document;
11  import org.dom4j.DocumentHelper;
12  import org.dom4j.Element;
13  
14  import com.buckosoft.PicMan.business.PicManFacade;
15  
16  /** Return the number of files/pics in a directory
17   * @author Dick Balaska
18   */
19  public class FilesInDirCountDom {
20  	static public Document createDocument(PicManFacade pmf, int rid, String dir) {
21  		Document document = DocumentHelper.createDocument();
22  		Element root = document.addElement("FilesInDirCount");
23  		root.addElement("rid").addText("" + rid);
24  		root.addElement("dir").addText(dir);
25  		root.addElement("count").addText("" + pmf.getFilesInDirCount(rid, dir));
26  		return(document);
27  	}
28  	
29  }