SortedSet<Dimension> read() throws CubeXmlFileNotExistsException,
            IOException, DocumentException {
        Configuration conf = CubeConfiguration.getConfiguration();
        FileSystem hdfs = FileSystem.get(conf);
        Path dimensionXmlFile = new Path(PathConf.getDimensionXmlFilePath());
        if (!hdfs.exists(dimensionXmlFile)) {
            throw new CubeXmlFileNotExistsException();
        }
        FSDataInputStream in = hdfs.open(dimensionXmlFile);
        SAXReader reader = new SAXReader();
        Document document = reader.read(in);
        SortedSet<Dimension> dimensions = new TreeSet<Dimension>();
        List<?> dimensionNodeList = document
                .selectNodes("//dimensions/dimension");
        Node dimensionNode;
        String dimensionName;
        int dimensionOrderNumber;
        SortedSet<Level> levels;
        List<?> levelNodeList;
        Node levelNode;
        String levelName;
        long levelLength;
        long levelBegin;
        int levelOrderNumber;
        DimensionRange dimensionRange;
        Node dimensionRangeNode;
        long dimensionRangeStart;
        long dimensionRangeEnd;
        for (Iterator<?> dimensionNodeIter = dimensionNodeList.iterator(); dimensionNodeIter
                .hasNext(); ) {
            dimensionNode = (Node) dimensionNodeIter.next();
            dimensionName = dimensionNode.selectSingleNode("name").getText();
            dimensionOrderNumber = Integer.valueOf(dimensionNode
                    .selectSingleNode("orderNumber").getText());
            levelNodeList = dimensionNode.selectNodes("level");
            levels = new TreeSet<Level>();
            for (Iterator<?> levelNodeIter = levelNodeList.iterator(); levelNodeIter
                    .hasNext(); ) {
                levelNode = (Node) levelNodeIter.next();
                levelName = levelNode.selectSingleNode("name").getText();
                levelLength = Long.valueOf(levelNode.selectSingleNode("length")
                        .getText());
                levelBegin = Long.valueOf(levelNode.selectSingleNode("begin")
                        .getText());
                levelOrderNumber = Integer.valueOf(levelNode.selectSingleNode(
                        "orderNumber").getText());
                levels.add(new Level(levelName, levelLength, levelBegin,
                        levelOrderNumber));
            }
            dimensionRangeNode = dimensionNode.selectSingleNode("range");
            dimensionRangeStart = Long.valueOf(dimensionRangeNode
                    .selectSingleNode("start").getText());
            dimensionRangeEnd = Long.valueOf(dimensionRangeNode
                    .selectSingleNode("end").getText());
            dimensionRange = new DimensionRange(dimensionRangeStart,
                    dimensionRangeEnd);
            dimensions.add(Dimension.getDimension(dimensionName, levels,
                    dimensionOrderNumber, dimensionRange));
        }
        return dimensions;
    }