Skip to main content
The Item API provides access to evidence items and their properties through two core interfaces:
  • IItemReader: Read-only access to item properties and content
  • IItem: Full read-write access for processing tasks

IItemReader Interface

The IItemReader interface provides read-only access to evidence items. It is the base interface extended by IItem. Package: iped.data
Source: iped-api/src/main/java/iped/data/IItemReader.java

Basic Properties

int
Returns the unique identifier of the item within the case
String
Returns the filename of the item
String
Returns the full path of the item including parent directories
Long
Returns the size of the item in bytes
String
Returns the hash value of the item (if computed during processing)

Example: Basic Property Access

/api/item-api.mdx:55:72

File Type Information

String
Returns the original file extension
String
Returns the detected file type extension based on signature analysis
MediaType
Returns the Apache Tika MediaType detected from file signature analysis
HashSet<String>
Returns the set of categories assigned to this item

Example: File Type Detection

Hierarchical Properties

Integer
Returns the ID of the parent item (null if root level)
Integer
Returns the subitem order within its parent, or null if not a subitem
boolean
Returns true if this is a subitem extracted from a container (e.g., file within a ZIP)
boolean
Returns true if the item is a directory
boolean
Returns true if this is a root item
boolean
Returns true if the item has child items (subitems or carved items)

Example: Navigating Hierarchy

State Flags

boolean
Returns true if the item is a deleted file
boolean
Returns true if the item was recovered through data carving
boolean
Returns true if parsing of the item resulted in a timeout

Timestamps

Date
Returns the last modification date of the file
Date
Returns the creation date of the file
Date
Returns the last access date of the file
Date
Returns the change date of the file (filesystem metadata change)

Example: Date Analysis

Content Access

BufferedInputStream
Returns a buffered input stream to read the item’s raw content. Preferred method for streaming access.
SeekableInputStream
Returns a seekable input stream allowing random access to content
ImageInputStream
Returns an ImageInputStream for image processing
File
Returns a temporary file containing the item’s content. Avoid using if you can work with streams, as this spools data to disk.
ISeekableInputStreamFactory
Returns a factory for creating multiple input streams to the same item

Example: Reading Content

Performance: Always prefer streaming methods (getBufferedInputStream(), getSeekableInputStream()) over getTempFile() to avoid unnecessary disk I/O.

Preview and Thumbnails

boolean
Returns true if a preview/view file exists for this item
File
Returns the view/preview file path (relative to case), or null if none exists
String
Returns the file extension of the preview file
byte[]
Returns the thumbnail image as a byte array

Metadata

Metadata
Returns the Apache Tika Metadata object containing all extracted metadata
Object
Returns the value of a custom extra attribute set by processing modules
Map<String, Object>
Returns the map of all extra attributes

Example: Accessing Metadata

Data Source

IDataSource
Returns the data source (evidence) that contains this item
String
Returns the identifier of this item within its original data source

IItem Interface

The IItem interface extends IItemReader with write operations for use in processing tasks. Package: iped.data
Source: iped-api/src/main/java/iped/data/IItem.java

Modifying Properties

void
Sets the filename
void
Sets the file extension
void
Sets the detected media type
void
Sets the file size in bytes
void
Sets the hash value

Category Management

void
Adds the item to a category
void
Removes the item from a category
void
Replaces all categories with a single category

Example: Category Management

State Management

void
Marks the item as deleted
void
Marks the item as recovered through carving
void
Marks the item to be ignored by subsequent processing tasks and excluded from the case
void
Sets whether the item should be added to the final case
void
Sets whether the item should be extracted/exported

Extra Attributes

void
Sets a custom extra attribute that will be indexed and searchable
void
Sets a temporary attribute (not indexed, used only during processing)

Example: Custom Attributes in Task

Resource Management

void
Releases resources used by the item, including temporary files and file handles. Important: Always call when done processing.
IItem
Creates a new child item (subitem) of this item. Used when extracting embedded content.

Example: Creating Subitems

IIPEDSource Interface

The IIPEDSource interface provides access to IPED cases and their indices. Package: iped.data
Source: iped-api/src/main/java/iped/data/IIPEDSource.java

Opening Cases

constructor
Opens an IPED case from the specified directory

Retrieving Items

IItem
Returns the item with the specified ID
IItem
Returns the item with the specified Lucene document ID
int
Converts item ID to Lucene document ID
int
Converts Lucene document ID to item ID

Case Information

File
Returns the case directory
File
Returns the IPED module directory (containing index, data, etc.)
int
Returns the total number of items in the case
int
Returns the highest item ID in the case

Index Access

IndexReader
Returns the Lucene IndexReader for low-level index access
IndexSearcher
Returns the Lucene IndexSearcher for executing queries
Analyzer
Returns the Lucene Analyzer used for text analysis

Categories and Metadata

List<String>
Returns the list of leaf-level categories in the case
Set<String>
Returns the set of extra attribute names defined in the case
Set<String>
Returns the set of keywords/search terms saved in the case

Example: Case Statistics

Best Practices

Always Close Resources: Use try-with-resources or explicitly call close() on IPEDSource and dispose() on IItem instances.
Thread Safety: IItem objects are not thread-safe. Each processing worker maintains its own item instances.
Stream Content: Prefer streaming methods over getTempFile() to avoid unnecessary disk I/O and improve performance.

See Also