Package org.sleuthkit.datamodel

Examples of org.sleuthkit.datamodel.AbstractFile


    }

    @Override
    public int isPreferred(Node node) {
        //special case, check if deleted video, then do not make it preferred
        AbstractFile file = node.getLookup().lookup(AbstractFile.class);
        if (file == null) {
            return 0;
        }
        String name = file.getName().toLowerCase();
        boolean deleted = file.isDirNameFlagSet(TSK_FS_NAME_FLAG_ENUM.UNALLOC);

        if (containsExt(name, videoExtensions) && deleted) {
            return 0;
        }
        else {
View Full Code Here


            }
           
            try {
                BlackboardArtifact art = skCase.getBlackboardArtifact(artifactId);
                BlackboardArtifactNode n = new BlackboardArtifactNode(art);
                AbstractFile file;
                try {
                    file = skCase.getAbstractFileById(art.getObjectID());
                } catch (TskCoreException ex) {
                    logger.log(Level.SEVERE, "TskCoreException while constructing BlackboardArtifact Node from KeywordHitsKeywordChildren"); //NON-NLS
                    return n;
                }

                n.addNodeProperty(new NodeProperty<>(
                        NbBundle.getMessage(this.getClass(), "KeywordHits.createNodeForKey.modTime.name"),
                        NbBundle.getMessage(this.getClass(),
                        "KeywordHits.createNodeForKey.modTime.displayName"),
                        NbBundle.getMessage(this.getClass(),
                        "KeywordHits.createNodeForKey.modTime.desc"),
                        ContentUtils.getStringTime(file.getMtime(), file)));
                n.addNodeProperty(new NodeProperty<>(
                        NbBundle.getMessage(this.getClass(), "KeywordHits.createNodeForKey.accessTime.name"),
                        NbBundle.getMessage(this.getClass(),
                        "KeywordHits.createNodeForKey.accessTime.displayName"),
                        NbBundle.getMessage(this.getClass(),
                        "KeywordHits.createNodeForKey.accessTime.desc"),
                        ContentUtils.getStringTime(file.getAtime(), file)));
                n.addNodeProperty(new NodeProperty<>(
                        NbBundle.getMessage(this.getClass(), "KeywordHits.createNodeForKey.chgTime.name"),
                        NbBundle.getMessage(this.getClass(),
                        "KeywordHits.createNodeForKey.chgTime.displayName"),
                        NbBundle.getMessage(this.getClass(),
                        "KeywordHits.createNodeForKey.chgTime.desc"),
                        ContentUtils.getStringTime(file.getCtime(), file)));
                return n;
            } catch (TskException ex) {
                logger.log(Level.WARNING, "TSK Exception occurred", ex); //NON-NLS
            }
            return null;
View Full Code Here

         * Analyze artifact associated with tag and add to internal list if it is associated
         * with an image.  
         * @param artifactTag
         */
        private void checkIfTagHasImage(BlackboardArtifactTag artifactTag) {
            AbstractFile file;
            try {
                file = Case.getCurrentCase().getSleuthkitCase().getAbstractFileById(artifactTag.getArtifact().getObjectID());
            } catch (TskCoreException ex) {
                logger.log(Level.WARNING, "Error while getting content from a blackboard artifact to report on.", ex); //NON-NLS
                return;
View Full Code Here

            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

                 case TSK_ENCRYPTION_DETECTED:
                     orderedRowData.add(mappedAttributes.get(ATTRIBUTE_TYPE.TSK_NAME.getTypeID()));
                     orderedRowData.add(getFileUniquePath(getObjectID()));
                     break;
                case TSK_EXT_MISMATCH_DETECTED:  
                    AbstractFile file = skCase.getAbstractFileById(getObjectID());
                    orderedRowData.add(file.getName());
                    orderedRowData.add(file.getNameExtension());
                    List<BlackboardAttribute> attrs = file.getGenInfoAttributes(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_FILE_TYPE_SIG);
                    if (!attrs.isEmpty()) {
                        orderedRowData.add(attrs.get(0).getValueString());
                    } else {
                        orderedRowData.add("");
                    }                  
                    orderedRowData.add(file.getUniquePath());
                    break;
                 case TSK_OS_INFO:
                    orderedRowData.add(mappedAttributes.get(ATTRIBUTE_TYPE.TSK_PROCESSOR_ARCHITECTURE.getTypeID()));
                    orderedRowData.add(mappedAttributes.get(ATTRIBUTE_TYPE.TSK_PROG_NAME.getTypeID()));
                    orderedRowData.add(mappedAttributes.get(ATTRIBUTE_TYPE.TSK_DATETIME.getTypeID()));
View Full Code Here

        final VirtualDirectory fileSetRootDir = addLocalFileSetRootDir(trans);

        try {
            // recursively add each item in the set
            for (java.io.File localRootToAdd : rootsToAdd) {
                AbstractFile localFileAdded = addLocalDirInt(trans, fileSetRootDir, localRootToAdd, addProgressUpdater);

                if (localFileAdded == null) {
                    String msg = NbBundle
                            .getMessage(this.getClass(), "FileManager.addLocalFilesDirs.exception.cantAdd.msg",
                                        localRootToAdd.getAbsolutePath());
View Full Code Here

     * @param file File to analyze
     * @return List of errors or empty list if no errors
     */
    List<IngestModuleError> process(FileIngestTask task) {
        List<IngestModuleError> errors = new ArrayList<>();
        AbstractFile file = task.getFile();
        for (FileIngestModuleDecorator module : this.modules) {
            try {
                FileIngestPipeline.ingestManager.setIngestTaskProgress(task, module.getDisplayName());
                module.process(file);
            } catch (Exception ex) { // Catch-all exception firewall
                errors.add(new IngestModuleError(module.getDisplayName(), ex));
            }
            if (this.job.isCancelled()) {
                break;
            }
        }
        file.close();
        if (!this.job.isCancelled()) {
            IngestManager.getInstance().fireFileIngestDone(file);
        }
        FileIngestPipeline.ingestManager.setIngestTaskProgressCompleted(task);
        return errors;
View Full Code Here

        setIcon();
    }

    private void setIcon() {
        //if file/dir, set icon
        AbstractFile af = Lookup.getDefault().lookup(AbstractFile.class);
        if (af != null) {
            // set name, display name, and icon
            if (af.isDir()) {
                this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/Folder-icon.png"); //NON-NLS
            } else {
                this.setIconBaseWithExtension(FileNode.getIconForFileType(af));
            }
View Full Code Here

        Content content = contentTag.getContent();
        if (content instanceof AbstractFile == false) {
            addRow(row);
            return;
        }
        AbstractFile file = (AbstractFile) content;
        // Don't make a local copy of the file if it is a directory or unallocated space.
        if (file.isDir() ||
            file.getType() == TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS ||
            file.getType() == TSK_DB_FILES_TYPE_ENUM.UNUSED_BLOCKS) {
            row.add("");
            return;
        }
       
        // Add metadata about the file to HTML output
        row.add(file.getMtimeAsDate());
        row.add(file.getCtimeAsDate());
        row.add(file.getAtimeAsDate());
        row.add(file.getCrtimeAsDate());
        row.add(Long.toString(file.getSize()));
        row.add(file.getMd5Hash());
       
        // save it in a folder based on the tag name
        String localFilePath = saveContent(file, contentTag.getName().getDisplayName());
       
        // Add the hyperlink to the row. A column header for it was created in startTable().
View Full Code Here

                if (!isFromSource) {
                    //File was from a different dataSource. Skipping.
                    continue;
                }

                AbstractFile file = tskCase.getAbstractFileById(fileId);
                if (file == null) {
                    continue;
                }

                SearchEngineURLQueryAnalyzer.SearchEngine se = null;
View Full Code Here

TOP

Related Classes of org.sleuthkit.datamodel.AbstractFile

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.