Package org.sleuthkit.datamodel

Examples of org.sleuthkit.datamodel.Content


        String name = "DataContent"; //NON-NLS
        String s = contentNode.getLookup().lookup(String.class);
        if (s != null) {
            name = s;
        } else {
            Content c = contentNode.getLookup().lookup(Content.class);
            if (c != null) {
                try {
                    name = c.getUniquePath();
                } catch (TskCoreException ex) {
                    logger.log(Level.SEVERE, "Except while calling Content.getUniquePath() on " + c); //NON-NLS
                }
            }
        }
View Full Code Here


        if (iconCache != null) {
            icon = iconCache.get();
        }

        if (icon == null) {
            Content content = this.getLookup().lookup(Content.class);

            if (content != null) {
                icon = ImageUtils.getIcon(content, iconSize);
            } else {
                icon = ImageUtils.getDefaultIcon();
View Full Code Here

            resetComponent();
            return;
        }

        Lookup lookup = selectedNode.getLookup();
        Content content = lookup.lookup(Content.class);
        if (content != null) {
            this.setDataView(content, 0);
            return;
        } else {
            StringContent scontent = selectedNode.getLookup().lookup(StringContent.class);
View Full Code Here

    @Override
    public boolean isSupported(Node node) {
        if (node == null) {
            return false;
        }
        Content content = node.getLookup().lookup(Content.class);
        if (content != null && content.getSize() > 0) {
            return true;
        }

        return false;
    }
View Full Code Here

                        Node drfn = new DataResultFilterNode(originNode, DirectoryTreeTopComponent.this.em);
                        Node kffn = new KnownFileFilterNode(drfn, KnownFileFilterNode.getSelectionContext(originNode));
                        dataResult.setNode(new TableFilterNode(kffn, true));

                        String displayName = "";
                        Content content = originNode.getLookup().lookup(Content.class);
                        if (content != null) {
                            try {
                                displayName = content.getUniquePath();
                            } catch (TskCoreException ex) {
                                logger.log(Level.SEVERE, "Exception while calling Content.getUniquePath() for node: " + originNode); //NON-NLS
                            }
                        } else if (originNode.getLookup().lookup(String.class) != null) {
                            displayName = originNode.getLookup().lookup(String.class);
View Full Code Here

        Collection<? extends AbstractFile> selectedFiles = Utilities.actionsGlobalContext().lookupAll(AbstractFile.class);
        for (AbstractFile file : selectedFiles) {
            try {
                // Handle the special cases of current (".") and parent ("..") directory entries.
                if (file.getName().equals(".")) {
                    Content parentFile = file.getParent();                  
                    if (parentFile instanceof AbstractFile) {
                        file = (AbstractFile)parentFile;
                    }
                    else {
                        JOptionPane.showMessageDialog(null,
                                                      NbBundle.getMessage(this.getClass(),
                                                                          "AddContentTagAction.unableToTag.msg",
                                                                          parentFile.getName()),
                                                      NbBundle.getMessage(this.getClass(),
                                                                          "AddContentTagAction.cannotApplyTagErr"),
                                                      JOptionPane.WARNING_MESSAGE);
                        continue;
                    }
                }
                else if (file.getName().equals("..")) {
                    Content parentFile = file.getParent();                  
                    if (parentFile instanceof AbstractFile) {
                        parentFile = (AbstractFile)((AbstractFile)parentFile).getParent();
                        if (parentFile instanceof AbstractFile) {
                            file = (AbstractFile)parentFile;
                        }
                        else {
                            JOptionPane.showMessageDialog(null,
                                                          NbBundle.getMessage(this.getClass(),
                                                                              "AddContentTagAction.unableToTag.msg",
                                                                              parentFile.getName()),
                                                          NbBundle.getMessage(this.getClass(),
                                                                              "AddContentTagAction.cannotApplyTagErr"),
                                                          JOptionPane.WARNING_MESSAGE);
                            continue;
                        }
                    }
                    else {
                        JOptionPane.showMessageDialog(null,
                                                      NbBundle.getMessage(this.getClass(),
                                                                          "AddContentTagAction.unableToTag.msg",
                                                                          parentFile.getName()),
                                                      NbBundle.getMessage(this.getClass(),
                                                                          "AddContentTagAction.cannotApplyTagErr"),
                                                      JOptionPane.WARNING_MESSAGE);
                        continue;
                    }                   
View Full Code Here

     * @param file The file we want to find the root parent for
     * @return The ID of the root parent Volume or Image
     */
    private static long getRootId(AbstractFile file) {
        long id = -1;
        Content parent = null;
        try {
            parent = file.getParent();
            while (parent != null) {
                if (parent instanceof Volume || parent instanceof Image) {
                    id = parent.getId();
                    break;
                }
                parent = parent.getParent();
            }
        }
        catch (TskCoreException ex) {
            logger.log(Level.SEVERE, "PhotoRec carver exception while trying to get parent of AbstractFile.", ex); //NON-NLS
        }
View Full Code Here

    private class ReverseHierarchyVisitor extends ContentVisitor.Default<List<Content>> {

        List<Content> ret = new ArrayList<Content>();

        private List<Content> visitParentButDontAddMe(Content content) {
            Content parent = null;
            try {
                parent = content.getParent();
            } catch (TskCoreException ex) {
                logger.log(Level.WARNING, "Couldn't get parent of Content object: " + content); //NON-NLS
            }
            return parent == null ? ret : parent.accept(this);
        }
View Full Code Here

        }

        @Override
        protected List<Content> defaultVisit(Content content) {
            ret.add(content);
            Content parent = null;
            try {
                parent = content.getParent();
            } catch (TskCoreException ex) {
                logger.log(Level.WARNING, "Couldn't get parent of Content object: " + content); //NON-NLS
            }
            return parent == null ? ret : parent.accept(this);
        }
View Full Code Here

    public Action[] getActions(boolean context) {
        Action[] superActions = super.getActions(context);
        List<Action> actionsList = new ArrayList<>();
        actionsList.addAll(Arrays.asList(superActions));

        final Content content = getLookup().lookup(Content.class);
        final BlackboardArtifact artifact = getLookup().lookup(BlackboardArtifact.class);

        final List<Action> factoryActions = DataModelActionsFactory.getActions(content, artifact != null);

        actionsList.addAll(factoryActions);
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.