Package org.sleuthkit.datamodel

Examples of org.sleuthkit.datamodel.Content


                        associated.getSize()));            
            }           
        } else {
            String dataSourceStr = "";
            try {
                Content dataSource = associated.getDataSource();
                if (dataSource != null) {
                    dataSourceStr = dataSource.getName();
                } else {
                    dataSourceStr = getRootParentName();
                }
            } catch (TskCoreException ex) {
                logger.log(Level.WARNING, "Failed to get image name from {0}", associated.getName()); //NON-NLS
View Full Code Here


        return s;
    }
   
    private String getRootParentName() {
        String parentName = associated.getName();
        Content parent = associated;
        try {
            while ((parent = parent.getParent()) != null) {
                parentName = parent.getName();
            }
        } catch (TskCoreException ex) {
            logger.log(Level.WARNING, "Failed to get parent name from {0}", associated.getName()); //NON-NLS
            return "";
        }
View Full Code Here

    private static Lookup createLookup(BlackboardArtifact artifact) {
        List<Object> forLookup = new ArrayList<>();
        forLookup.add(artifact);
       
        // Add the content the artifact is associated with
        Content content = getAssociatedContent(artifact);
        if (content != null) {
            forLookup.add(content);
        }
       
        // if there is a text highlighted version, of the content, add it too
View Full Code Here

        return instance;
    }

    @Override
    public void search(Node contentNode) {
        Content tempContent = contentNode.getLookup().lookup(Content.class);
        this.file = tempContent.accept(initializeCV);
        performAction();
    }
View Full Code Here

        return new Node[]{pageNode};
    }

    public static boolean isSupported(Node node) {
        if (node != null) {
            Content content = node.getLookup().lookup(Content.class);
            if (content != null) {
                return ImageUtils.thumbnailSupported(content);
            }
        }
        return false;
View Full Code Here

        if ((selectedNode == null) || (!isSupported(selectedNode))) {
            resetComponent();
            return;
        }
       
        Content content = (selectedNode).getLookup().lookup(Content.class);
        if (content == null) {
            resetComponent();
            return;
        }
       
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

         * it is an image and should have a thumbnail reported for it.
         * Images are added to internal list.
         * @param contentTag
         */
        private void checkIfTagHasImage(ContentTag contentTag) {
            Content c = contentTag.getContent();
            if (c instanceof AbstractFile == false) {
                return;
            }
            checkIfFileIsImage((AbstractFile) c);
        }
View Full Code Here

                "last_inum" //NON-NLS
            };

            Object[][] rowValues = new Object[1][9];

            Content parent = null;
            try {
                parent = fs.getParent();
            } catch (Exception ex) {
                throw new RuntimeException(
                        NbBundle.getMessage(this.getClass(), "ExplorerNodeActionVisitor.exception.probGetParent.text",
                                            FileSystem.class.getName(), fs), ex);
            }
            long id = -1;
            if (parent != null) {
                id = parent.getId();
            }

            Arrays.fill(rowValues, 0, 1, new Object[]{
                fs.getId(),
                fs.getImageOffset(),
View Full Code Here

        this.tag = tag;
    }

    @Override
    protected Sheet createSheet() {
        Content content = tag.getContent();
        String contentPath;
        try {
            contentPath = content.getUniquePath();
        } catch (TskCoreException ex) {
            Logger.getLogger(ContentTagNode.class.getName()).log(Level.SEVERE, "Failed to get path for content (id = " + content.getId() + ")", ex); //NON-NLS
            contentPath = NbBundle.getMessage(this.getClass(), "ContentTagNode.createSheet.unavail.path");
        }
        AbstractFile file = content instanceof AbstractFile ? (AbstractFile)content : null;
       
        Sheet propertySheet = super.createSheet();
        Sheet.Set properties = propertySheet.get(Sheet.PROPERTIES);
        if (properties == null) {
            properties = Sheet.createPropertiesSet();
            propertySheet.put(properties);
        }
        properties.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "ContentTagNode.createSheet.file.name"),
                NbBundle.getMessage(this.getClass(), "ContentTagNode.createSheet.file.displayName"),
                "",
                content.getName()));
        properties.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "ContentTagNode.createSheet.filePath.name"),
                NbBundle.getMessage(this.getClass(), "ContentTagNode.createSheet.filePath.displayName"),
                "",
                contentPath));
        properties.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "ContentTagNode.createSheet.comment.name"),
                NbBundle.getMessage(this.getClass(), "ContentTagNode.createSheet.comment.displayName"),
                "",
                tag.getComment()));
        properties.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "ContentTagNode.createSheet.fileModifiedTime.name"),
                NbBundle.getMessage(this.getClass(), "ContentTagNode.createSheet.fileModifiedTime.displayName"),
                "",
                file != null ? ContentUtils.getStringTime(file.getMtime(), file) : ""));
        properties.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "ContentTagNode.createSheet.fileChangedTime.name"),
                NbBundle.getMessage(this.getClass(), "ContentTagNode.createSheet.fileChangedTime.displayName"),
                "",
                file != null ? ContentUtils.getStringTime(file.getCtime(), file) : ""));
        properties.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "ContentTagNode.createSheet.fileAccessedTime.name"),
                NbBundle.getMessage(this.getClass(), "ContentTagNode.createSheet.fileAccessedTime.displayName"),
                "",
                file != null ? ContentUtils.getStringTime(file.getAtime(), file) : ""));
        properties.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "ContentTagNode.createSheet.fileCreatedTime.name"),
                NbBundle.getMessage(this.getClass(), "ContentTagNode.createSheet.fileCreatedTime.displayName"),
                "",
                file != null ? ContentUtils.getStringTime(file.getCrtime(), file) : ""));
        properties.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "ContentTagNode.createSheet.fileSize.name"),
                NbBundle.getMessage(this.getClass(), "ContentTagNode.createSheet.fileSize.displayName"),
                "",
                content.getSize()));
        return propertySheet;
    }
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.