Package org.sleuthkit.datamodel

Examples of org.sleuthkit.datamodel.Content


            String defaultName = NbBundle.getMessage(DataContentTopComponent.class, "CTL_DataContentTopComponent");
            // set the file path
            if (selectedNode == null) {
                setName(defaultName);
            } else {
                Content content = selectedNode.getLookup().lookup(Content.class);
                if (content != null) {
                    //String path = DataConversion.getformattedPath(ContentUtils.getDisplayPath(selectedNode.getLookup().lookup(Content.class)), 0);
                    String path = defaultName;
                    try {
                        path = content.getUniquePath();
                    } catch (TskCoreException ex) {
                        logger.log(Level.SEVERE, "Exception while calling Content.getUniquePath() for {0}", content); //NON-NLS
                    }
                    setName(path);
                } else {
View Full Code Here


                actions.add(new ViewContextAction(
                        NbBundle.getMessage(this.getClass(), "DataResultFilterNode.action.viewFileInDir.text"), ban));
            } else {
                // if the artifact links to another file, add an action to go to
                // that file
                Content c = findLinked(ban);
                if (c != null) {
                    actions.add(new ViewContextAction(
                            NbBundle.getMessage(this.getClass(), "DataResultFilterNode.action.viewFileInDir.text"), c));
                }
                // action to go to the source file of the artifact
                actions.add(new ViewContextAction(
                        NbBundle.getMessage(this.getClass(), "DataResultFilterNode.action.viewSrcFileInDir.text"), ban));
            }
            Content c = ban.getLookup().lookup(File.class);
            Node n = null;
            boolean md5Action = false;
            if (c != null) {
                n = new FileNode((AbstractFile) c);
                md5Action = true;
View Full Code Here

            return actions;
        }

        private Content findLinked(BlackboardArtifactNode ba) {
            BlackboardArtifact art = ba.getLookup().lookup(BlackboardArtifact.class);
            Content c = null;
            try {
                for (BlackboardAttribute attr : art.getAttributes()) {
                    if (attr.getAttributeTypeID() == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH_ID.getTypeID()) {
                        switch (attr.getValueType()) {
                            case INTEGER:
View Full Code Here

        try {
            if (!shouldDisplayTimesInLocalTime()) {
                return TimeZone.getTimeZone("GMT");
            }
            else {
                final Content dataSource = c.getDataSource();
                if ((dataSource != null) && (dataSource instanceof Image)) {
                    Image image = (Image)dataSource;
                    return TimeZone.getTimeZone(image.getTimeZone());
                } else {
                    //case such as top level VirtualDirectory
View Full Code Here

            return;
        }
               
        // Make sure the node is of the correct type.
        Lookup lookup = selectedNode.getLookup();
        Content content = lookup.lookup(Content.class);
        if (content == null) {
            return;
        }
       
        startNewTask(new SelectedNodeChangedTask(selectedNode));
View Full Code Here

    public boolean isSupported(Node node) {
        if (node == null) {
            return false;
        }

        Content content = node.getLookup().lookup(Content.class);       
        if(content != null) {
            try {
                return content.getAllArtifactsCount() > 0;
            }
            catch (TskException ex) {
                logger.log(Level.WARNING, "Couldn't get count of BlackboardArtifacts for content", ex); //NON-NLS
            }
        }
View Full Code Here

            // Get the lookup for the node for access to its underlying content and
            // blackboard artifact, if any.
            Lookup lookup = selectedNode.getLookup();
           
            // Get the content.
            Content content = lookup.lookup(Content.class);
            if (content == null) {
                return new ViewUpdate(getArtifactContentStrings().size(), currentPage, ERROR_TEXT);
            }
           
            // Get all of the blackboard artifacts associated with the content. These are what this
            // viewer displays.
            ArrayList<BlackboardArtifact> artifacts;
            try {
                artifacts = content.getAllArtifacts();
            }
            catch (TskException ex) {
                logger.log(Level.WARNING, "Couldn't get artifacts", ex); //NON-NLS
                return new ViewUpdate(getArtifactContentStrings().size(), currentPage, ERROR_TEXT);
            }
View Full Code Here

            if (selectedNode == null) {
                setText("");
                return;
            }
           
            Content content = selectedNode.getLookup().lookup(Content.class);
            if (content == null) {
                // non-content object passed in
                setText("");
                return;
            }
           
            setText("Doing Analysis");
            byte buffer[] = new byte[1024];
            int len = content.read(buffer, 0, 1024);
            int count = 0;
            for (int i = 0; i < len; i++) {
                if (buffer[i] == 0x00) {
                    count++;
                }
View Full Code Here

    }

    @Override
    public boolean isSupported(Node node) {
        // get a Content datamodel object out of the node
        Content content = node.getLookup().lookup(Content.class);
        if (content == null) {
            return false;
        }
       
        // we only want files that are 1024 bytes or larger (for no good reason)
        if (content.getSize() < 1024) {
            return false;
        }
        return true;
    }
View Full Code Here

        return errors;
    }

    List<IngestModuleError> process(DataSourceIngestTask task) {
        List<IngestModuleError> errors = new ArrayList<>();
        Content dataSource = task.getDataSource();
        for (DataSourceIngestModuleDecorator module : modules) {
            try {
                String displayName = NbBundle.getMessage(this.getClass(),
                        "IngestJob.progress.dataSourceIngest.displayName",
                        module.getDisplayName(), dataSource.getName());
                this.job.updateDataSourceIngestProgressBarDisplayName(displayName);
                this.job.switchDataSourceIngestProgressBarToIndeterminate();
                ingestManager.setIngestTaskProgress(task, module.getDisplayName());
                module.process(dataSource, new DataSourceIngestModuleProgress(this.job));
            } catch (Exception ex) { // Catch-all exception firewall
View Full Code Here

TOP

Related Classes of org.sleuthkit.datamodel.Content

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.