PccTarget


public final class PccTarget
extends OperationTarget

java.lang.Object
   ↳ android.os.storage.operations.targets.OperationTarget
     ↳ android.os.storage.operations.targets.PccTarget


A target representing the calling application's Private Compute Core (PCC) data directory.

Files directed to this target will be securely stored within the PCC component of the application. The optional path prefix can be used to organize files into subdirectories within the PCC storage area.

Example Usage:

// Create a target that places files in a "processed_results" subdirectory within PCC
 PccTarget target = new PccTarget("processed_results/daily_logs");

 // If a file named "report.dat" is sent to this target, it will be stored at:
 // [PCC_ROOT]/processed_results/daily_logs/report.dat
 

Prefix Requirements:

  • Must be relative: Absolute paths are rejected to prevent escaping the PCC root directory.
  • No Path Traversal: The prefix cannot contain ".." or "." segments that resolve to parent or current directories.
  • No Control Characters: Invisible or control characters (e.g., null, newline, surrogates) are prohibited for security.

Summary

Public constructors

PccTarget()

Creates a new PCC target with no path prefix.

PccTarget(String pathPrefix)

Creates a new PCC target with the specified path prefix.

Public methods

String toString()

Returns a string representation of this target for debugging.

Inherited methods

Public constructors

PccTarget

Added in API level 37
public PccTarget ()

Creates a new PCC target with no path prefix.

PccTarget

Added in API level 37
public PccTarget (String pathPrefix)

Creates a new PCC target with the specified path prefix.

Parameters
pathPrefix String: The prefix to be added to the destination path of files.
This value cannot be null.

Public methods

toString

Added in API level 37
public String toString ()

Returns a string representation of this target for debugging.

Returns
String A string containing the target type and prefix.
This value cannot be null.