Autopsy  4.19.3
Graphical digital forensics platform for The Sleuth Kit and other tools.
Classes | Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
org.sleuthkit.autopsy.datamodel.ContentUtils Class Reference

Classes

class  ExtractFscContentVisitor
 
class  SystemNameVisitor
 

Static Public Member Functions

static String getStringTime (long epochSeconds, TimeZone tzone)
 
static String getStringTime (long epochSeconds, Content content)
 
static String getStringTimeISO8601 (long epochSeconds, TimeZone tzone)
 
static String getStringTimeISO8601 (long epochSeconds, Content c)
 
static String getSystemName (Content content)
 
static TimeZone getTimeZone (Content content)
 
static boolean isDotDirectory (AbstractFile dir)
 
static boolean shouldDisplayTimesInLocalTime ()
 
static< T > long writeToFile (Content content, java.io.File outputFile, ProgressHandle progress, Future< T > worker, boolean source) throws IOException
 
static void writeToFile (Content content, java.io.File outputFile) throws IOException
 
static long writeToFile (Content content, java.io.File outputFile, Supplier< Boolean > cancelCheck) throws IOException
 
static long writeToFile (Content content, java.io.File outputFile, Supplier< Boolean > cancelCheck, long startingOffset, long endingOffset) throws IOException
 

Private Member Functions

 ContentUtils ()
 

Static Private Attributes

static final SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z")
 
static final SimpleDateFormat dateFormatterISO8601 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'")
 
static final Logger logger = Logger.getLogger(ContentUtils.class.getName())
 
static final SystemNameVisitor systemName = new SystemNameVisitor()
 
static final int TO_FILE_BUFFER_SIZE = 8192
 

Detailed Description

Static class of utility methods for Content objects

Definition at line 52 of file ContentUtils.java.

Constructor & Destructor Documentation

org.sleuthkit.autopsy.datamodel.ContentUtils.ContentUtils ( )
private

Don't instantiate

Definition at line 61 of file ContentUtils.java.

Member Function Documentation

static String org.sleuthkit.autopsy.datamodel.ContentUtils.getStringTime ( long  epochSeconds,
TimeZone  tzone 
)
static

Convert epoch seconds to a string value in the given time zone.

Parameters
epochSecondsEpoch seconds
tzoneTime zone
Returns
The time

Definition at line 74 of file ContentUtils.java.

References org.sleuthkit.autopsy.datamodel.ContentUtils.dateFormatter.

Referenced by org.sleuthkit.autopsy.datamodel.ContentUtils.getStringTime().

static String org.sleuthkit.autopsy.datamodel.ContentUtils.getStringTime ( long  epochSeconds,
Content  content 
)
static

Convert epoch seconds to a string value (convenience method)

Parameters
epochSeconds
content
Returns
Deprecated:
Use org.sleuthkit.autopsy.coreutils.TimeZoneUtils.getFormattedTime instead

Definition at line 117 of file ContentUtils.java.

References org.sleuthkit.autopsy.datamodel.ContentUtils.getStringTime(), and org.sleuthkit.autopsy.datamodel.ContentUtils.getTimeZone().

static String org.sleuthkit.autopsy.datamodel.ContentUtils.getStringTimeISO8601 ( long  epochSeconds,
TimeZone  tzone 
)
static

Convert epoch seconds to a string value (ISO8601) in the given time zone.

Parameters
epochSecondsEpoch seconds
tzoneTime zone
Returns
The time

Definition at line 94 of file ContentUtils.java.

References org.sleuthkit.autopsy.datamodel.ContentUtils.dateFormatterISO8601.

Referenced by org.sleuthkit.autopsy.datamodel.ContentUtils.getStringTimeISO8601().

static String org.sleuthkit.autopsy.datamodel.ContentUtils.getStringTimeISO8601 ( long  epochSeconds,
Content  c 
)
static

Convert epoch seconds to a string value (convenience method) in ISO8601 format such as 2008-07-04T13:45:04Z

Parameters
epochSeconds
c
Returns
Deprecated:
Use org.sleuthkit.autopsy.coreutils.TimeZoneUtils.getFormattedTimeISO8601 instead

Definition at line 133 of file ContentUtils.java.

References org.sleuthkit.autopsy.datamodel.ContentUtils.getStringTimeISO8601(), and org.sleuthkit.autopsy.datamodel.ContentUtils.getTimeZone().

static String org.sleuthkit.autopsy.datamodel.ContentUtils.getSystemName ( Content  content)
static

Get system name from content using SystemNameVisitor.

Parameters
contentThe content object.
Returns
The system name.

Definition at line 163 of file ContentUtils.java.

static TimeZone org.sleuthkit.autopsy.datamodel.ContentUtils.getTimeZone ( Content  content)
static
static boolean org.sleuthkit.autopsy.datamodel.ContentUtils.isDotDirectory ( AbstractFile  dir)
static

Helper to ignore the '.' and '..' directories

Parameters
dirthe directory to check
Returns
true if dir is a '.' or '..' directory, false otherwise

Definition at line 347 of file ContentUtils.java.

Referenced by org.sleuthkit.autopsy.directorytree.actionhelpers.ExtractActionHelper.runExtractionTasks(), org.sleuthkit.autopsy.modules.hashdatabase.HashDbSearchAction.InitializeContentVisitor.visit(), and org.sleuthkit.autopsy.datamodel.ContentUtils.ExtractFscContentVisitor< T, V >.visitDir().

static boolean org.sleuthkit.autopsy.datamodel.ContentUtils.shouldDisplayTimesInLocalTime ( )
static

Indicates whether or not times should be displayed using local time.

Returns
True or false.
Deprecated:
Call UserPreferences.displayTimesInLocalTime instead.

Definition at line 548 of file ContentUtils.java.

References org.sleuthkit.autopsy.core.UserPreferences.displayTimesInLocalTime().

Referenced by org.sleuthkit.autopsy.datamodel.ContentUtils.getTimeZone().

static <T> long org.sleuthkit.autopsy.datamodel.ContentUtils.writeToFile ( Content  content,
java.io.File  outputFile,
ProgressHandle  progress,
Future< T >  worker,
boolean  source 
) throws IOException
static

Reads all the data from any content object and writes (extracts) it to a file.

Parameters
contentAny content object.
outputFileWill be created if it doesn't exist, and overwritten if it does
progressprogress bar handle to update, if available. null otherwise
workerthe swing worker background thread the process runs within, or null, if in the main thread, used to handle task cancellation
sourcetrue if source file
Returns
number of bytes extracted
Exceptions
IOExceptionif file could not be written

Definition at line 201 of file ContentUtils.java.

References org.sleuthkit.autopsy.datamodel.ContentUtils.TO_FILE_BUFFER_SIZE.

Referenced by org.sleuthkit.autopsy.directorytree.ExternalViewerAction.actionPerformed(), org.sleuthkit.autopsy.report.modules.portablecase.PortableCaseReportModule.copyContent(), org.sleuthkit.autopsy.coreutils.SQLiteTableReader.copyFileToTempDirectory(), org.sleuthkit.autopsy.modules.yara.YaraIngestModule.createLocalCopy(), org.sleuthkit.autopsy.corecomponents.DataContentViewerHex.BackgroundFileCopyTask.doInBackground(), org.sleuthkit.autopsy.contentviewers.MediaPlayerPanel.ExtractMedia.doInBackground(), org.sleuthkit.autopsy.coreutils.AppSQLiteDB.findAndCopySQLiteDB(), org.sleuthkit.autopsy.coreutils.AppSQLiteDB.findAndCopySQLiteMetaFile(), org.sleuthkit.autopsy.thunderbirdparser.ThunderbirdMboxFileIngestModule.processMBox(), org.sleuthkit.autopsy.thunderbirdparser.ThunderbirdMboxFileIngestModule.processPst(), org.sleuthkit.autopsy.modules.leappanalyzers.ALeappAnalyzerIngestModule.writeaLeappFile(), org.sleuthkit.autopsy.datamodel.ContentUtils.ExtractFscContentVisitor< T, V >.writeFile(), org.sleuthkit.autopsy.modules.leappanalyzers.ILeappAnalyzerIngestModule.writeiLeappFile(), and org.sleuthkit.autopsy.datamodel.ContentUtils.writeToFile().

static void org.sleuthkit.autopsy.datamodel.ContentUtils.writeToFile ( Content  content,
java.io.File  outputFile 
) throws IOException
static

Write content to an output file.

Parameters
contentThe Content object.
outputFileThe output file.
Exceptions
IOExceptionIf the file could not be written.

Definition at line 244 of file ContentUtils.java.

References org.sleuthkit.autopsy.datamodel.ContentUtils.writeToFile().

static long org.sleuthkit.autopsy.datamodel.ContentUtils.writeToFile ( Content  content,
java.io.File  outputFile,
Supplier< Boolean >  cancelCheck 
) throws IOException
static

Reads all the data from any content object and writes (extracts) it to a file, using a cancellation check instead of a Future object method.

Parameters
contentAny content object.
outputFileWill be created if it doesn't exist, and overwritten if it does
cancelCheckA function used to check if the file write process should be terminated.
Returns
number of bytes extracted
Exceptions
IOExceptionif file could not be written

Definition at line 262 of file ContentUtils.java.

References org.sleuthkit.autopsy.datamodel.ContentUtils.TO_FILE_BUFFER_SIZE.

static long org.sleuthkit.autopsy.datamodel.ContentUtils.writeToFile ( Content  content,
java.io.File  outputFile,
Supplier< Boolean >  cancelCheck,
long  startingOffset,
long  endingOffset 
) throws IOException
static

Reads all the data from any content object and writes (extracts) it to a file, using a cancellation check instead of a Future object method.

Parameters
contentAny content object.
outputFileWill be created if it doesn't exist, and overwritten if it does
cancelCheckA function used to check if the file write process should be terminated.
startingOffsetthe starting offset to start reading the file
endingOffsetthe ending offset to read of the file to write
Returns
number of bytes extracted
Exceptions
IOExceptionif file could not be written

Definition at line 300 of file ContentUtils.java.

References org.sleuthkit.autopsy.datamodel.ContentUtils.TO_FILE_BUFFER_SIZE.

Member Data Documentation

final SimpleDateFormat org.sleuthkit.autopsy.datamodel.ContentUtils.dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z")
staticprivate
final SimpleDateFormat org.sleuthkit.autopsy.datamodel.ContentUtils.dateFormatterISO8601 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'")
staticprivate
final Logger org.sleuthkit.autopsy.datamodel.ContentUtils.logger = Logger.getLogger(ContentUtils.class.getName())
staticprivate

Definition at line 54 of file ContentUtils.java.

final SystemNameVisitor org.sleuthkit.autopsy.datamodel.ContentUtils.systemName = new SystemNameVisitor()
staticprivate

Definition at line 154 of file ContentUtils.java.

final int org.sleuthkit.autopsy.datamodel.ContentUtils.TO_FILE_BUFFER_SIZE = 8192
staticprivate

The documentation for this class was generated from the following file:

Copyright © 2012-2022 Basis Technology. Generated on: Mon Oct 3 2022
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.