~ubuntu-branches/ubuntu/saucy/statsvn/saucy

« back to all changes in this revision

Viewing changes to src/net/sf/statsvn/input/RepositoriesBuilder.java

  • Committer: Bazaar Package Importer
  • Author(s): Vincent Fourmond
  • Date: 2008-06-28 15:53:07 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080628155307-sw2xqeigkk4zwlxm
Tags: 0.4.0.dfsg-1
* New upstream version (closes: #481799)
* Does not work with older statcvs, tightening up dependencies
* statsvn still complains about files with spaces within, but
  it does not seem to affect statistics anymore, so it 
  closes: #469937,#469938

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
import javax.xml.parsers.DocumentBuilderFactory;
5
5
import javax.xml.parsers.ParserConfigurationException;
6
6
 
 
7
import net.sf.statcvs.output.ConfigurationOptions;
 
8
 
7
9
import org.w3c.dom.Document;
8
10
import org.w3c.dom.Element;
9
11
import org.w3c.dom.NodeList;
17
19
 * 
18
20
 * @author Gunter Mussbacher <gunterm@site.uottawa.ca>
19
21
 * 
20
 
 * @version $Id: RepositoriesBuilder.java 196 2006-12-12 13:15:20Z benoitx $
 
22
 * @version $Id: RepositoriesBuilder.java 351 2008-03-28 18:46:26Z benoitx $
21
23
 * 
22
24
 */
23
25
public class RepositoriesBuilder {
24
26
        private static final String FILE_EXTENSION = ".xml";
 
27
 
25
28
        private static final String FILE_PREFIX = "cache_";
 
29
 
26
30
        private static final String REPOSITORIES = "repositories";
 
31
 
27
32
        private static final String UUID = "uuid";
 
33
 
28
34
        private static final String FILE = "file";
 
35
 
 
36
        private static final String PROJECT = "project";
 
37
 
29
38
        private static final String REPOSITORY = "repository";
 
39
 
30
40
        private Document document = null;
 
41
 
31
42
        private Element repositories = null;
32
43
 
33
44
        /**
67
78
                final Element repository = document.createElement(REPOSITORY);
68
79
                repository.setAttribute(UUID, uuid);
69
80
                repository.setAttribute(FILE, file);
 
81
                repository.setAttribute(PROJECT, ConfigurationOptions.getProjectName());
70
82
                repositories.appendChild(repository);
71
83
                return repository;
72
84
        }
77
89
         * @throws ParserConfigurationException
78
90
         */
79
91
        public void buildRoot() throws ParserConfigurationException {
80
 
                final DocumentBuilderFactory factoryDOM = DocumentBuilderFactory
81
 
                                .newInstance();
 
92
                final DocumentBuilderFactory factoryDOM = DocumentBuilderFactory.newInstance();
82
93
                DocumentBuilder builderDOM;
83
94
                builderDOM = factoryDOM.newDocumentBuilder();
84
95
                document = builderDOM.newDocument();
115
126
                }
116
127
                return "";
117
128
        }
118
 
        
119
129
 
120
130
        /**
121
131
         * Returns the DOM object when building is complete.