Package eu.planets_project.pp.plato.services.characterisation.jhove.tree

Examples of eu.planets_project.pp.plato.services.characterisation.jhove.tree.JHoveTree


     */
    private JHoveTree initFromJHoveProperty(String sampleName,
            JHoveFileProperty prop) {
        if (prop == null)
            return null;
        JHoveTree mTree = new JHoveTree();
        mTree.initRoot(sampleName);
        if (prop.getExtractionDate() != null)
            mTree.getRoot().addChild(
                    new JHoveTreeNode("Extraction date: "
                            + prop.getExtractionDate(), "leaf"));
        if (prop.getStatus().compareTo("Not well-formed") == 0) {
            mTree.getRoot().addChild(
                    new JHoveTreeNode("Status: " + prop.getStatus(), "leaf"));
            return mTree;
        }
        mTree.getRoot().addChild(
                new JHoveTreeNode("Size: " + prop.getFileSize(), "leaf"));
        mTree.getRoot().addChild(
                new JHoveTreeNode("Mime-Type: " + prop.getMimetype(), "leaf"));
        mTree.getRoot().addChild(
                new JHoveTreeNode("Format: " + prop.getFormat(), "leaf"));
        if (prop.getVersion() != null)
            mTree.getRoot().addChild(
                    new JHoveTreeNode("Version: " + prop.getVersion(), "leaf"));
        mTree.getRoot().addChild(
                new JHoveTreeNode("Status: " + prop.getStatus(), "leaf"));

        // if not a bytestream, display also the properties
        if (prop.getFormat().compareTo("bytestream") != 0) {
            // Add Module to the tree
            JHoveTreeNode tmpMaterialTreeNode = new JHoveTreeNode("Module",
                    "node");
            tmpMaterialTreeNode.addChild(new JHoveTreeNode("Name: "
                    + prop.getModule().getName(), "leaf"));
            tmpMaterialTreeNode.addChild(new JHoveTreeNode("Release: "
                    + prop.getModule().getRelease(), "leaf"));
            tmpMaterialTreeNode.addChild(new JHoveTreeNode("Date: "
                    + prop.getModule().getDate(), "leaf"));
            mTree.getRoot().addChild(tmpMaterialTreeNode);

            // Add Profiles
            tmpMaterialTreeNode = new JHoveTreeNode("Profiles", "node");
            Vector<String> profiles = prop.getProfiles();
            if (profiles != null) {
                for (String profile : profiles) {
                    tmpMaterialTreeNode.addChild(new JHoveTreeNode(profile,
                            "leaf"));
                }
            }

            mTree.getRoot().addChild(tmpMaterialTreeNode);

            JHoveTreeNode tmpProp = new JHoveTreeNode("Properties", "node");

            // Add Properties
            for (Property property : prop.getProperties()) {
                tmpProp.addChild(getPropertyTreeNode(property));
            }
            mTree.getRoot().addChild(tmpProp);

        }
        log.debug("JHoveTree created from Samplerecord " + sampleName);
        return mTree;
    }
View Full Code Here


        tempDir.mkdir();
        tempDir.deleteOnExit();
        tempDigitalObjects.clear();
       
        allowRemove = -1;
        jhoveTree = new JHoveTree();
        jHoveAdaptor=new JHoveAdaptor();
       
        try {
            fits = new FitsIntegration();
        } catch (Throwable e) {
View Full Code Here

     * Creates from the SampleObject object, retrieved by injection, a Tree with all the
     * characteristics extracted from Jhove
     *
     */
    public JHoveTree characteriseJHove(DigitalObject object) {
        JHoveTree jhoveTree = new JHoveTree();
       
        //returns an empty tree for null
        if(object==null) {
            return jhoveTree;
        }
View Full Code Here

TOP

Related Classes of eu.planets_project.pp.plato.services.characterisation.jhove.tree.JHoveTree

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.