DeviceFileReporter
  public
  
  
  
  class
  DeviceFileReporter
  
    extends Object
  
  
  
  
  
  
| java.lang.Object | |
| ↳ | com.android.tradefed.result.DeviceFileReporter | 
A utility class that checks the device for files and sends them to
 ITestInvocationListener.testLog(String, LogDataType, InputStreamSource) if found.
Summary
| Public constructors | |
|---|---|
| 
      DeviceFileReporter(ITestDevice device, ITestInvocationListener listener)
      Initialize a new DeviceFileReporter with the provided  | |
| Public methods | |
|---|---|
| 
        
        
        
        
        
        void | 
      addPatterns(Add patterns with the respective log data types | 
| 
        
        
        
        
        
        void | 
      addPatterns(String... patterns)
      Add patterns with the log data type set to the default. | 
| 
        
        
        
        
        
         | 
      run()
      Actually search the filesystem for the specified patterns and send them to
  | 
| 
        
        
        
        
        
        void | 
      setDefaultLogDataType(LogDataType type)
      Set the default log data type set for patterns that don't have an associated type. | 
| 
        
        
        
        
        
        void | 
      setInferUnknownDataTypes(boolean infer)
      Whether to  | 
| 
        
        
        
        
        
        void | 
      setSkipRepeatFiles(boolean skip)
      Whether or not to skip files which have already been reported. | 
Public constructors
DeviceFileReporter
public DeviceFileReporter (ITestDevice device, ITestInvocationListener listener)
Initialize a new DeviceFileReporter with the provided ITestDevice
| Parameters | |
|---|---|
| device | ITestDevice | 
| listener | ITestInvocationListener | 
Public methods
addPatterns
public void addPatterns (patterns) 
Add patterns with the respective log data types
| Parameters | |
|---|---|
| patterns | : aERROR(/Map)ofStringfilename glob patterns to their respectiveLogDataTypes.  The globs should be absolute. | 
See also:
addPatterns
public void addPatterns (String... patterns)
Add patterns with the log data type set to the default.
| Parameters | |
|---|---|
| patterns | String: a varargs array ofStringfilename glob patterns. Should be absolute. | 
See also:
run
publicrun () 
Actually search the filesystem for the specified patterns and send them to
 ITestInvocationListener.testLog if found
| Returns | |
|---|---|
|  | |
| Throws | |
|---|---|
| DeviceNotAvailableException | |
setDefaultLogDataType
public void setDefaultLogDataType (LogDataType type)
Set the default log data type set for patterns that don't have an associated type.
| Parameters | |
|---|---|
| type | LogDataType: theLogDataType | 
See also:
setInferUnknownDataTypes
public void setInferUnknownDataTypes (boolean infer)
Whether to UNKNOWN files by checking
 the file extensions against a list.
 
UNKNOWN (which includes patterns added without a specific type, and without the)
 default type having been set manually).  If the inference fails, the data type will remain
 as UNKNOWN.
    | Parameters | |
|---|---|
| infer | boolean | 
setSkipRepeatFiles
public void setSkipRepeatFiles (boolean skip)
Whether or not to skip files which have already been reported. This is only relevant when multiple patterns are being used, and two or more of those patterns match the same file.
Note that thisrun(). Doing
 otherwise will cause undefined behavior.
    | Parameters | |
|---|---|
| skip | boolean | 
