java.lang.Object
org.apache.tika.parser.microsoft.onenote.fsshttpb.util.DataElementUtils

public class DataElementUtils extends Object
  • Field Details

    • RootExGuid

      public static final UUID RootExGuid
    • CellSecondExGuid

      public static final UUID CellSecondExGuid
    • SchemaGuid

      public static final UUID SchemaGuid
  • Constructor Details

    • DataElementUtils

      public DataElementUtils()
  • Method Details

    • buildDataElements

      public static List<DataElement> buildDataElements(byte[] fileContent, AtomicReference<ExGuid> storageIndexExGuid) throws TikaException, IOException
      This method is used to build a list of data elements to represent a file.
      Parameters:
      fileContent - The file content in byte array form.
      storageIndexExGuid - Reference set to the storage index ex guid.
      Returns:
      List of DataElement objects that are stored in the file content.
      Throws:
      TikaException
      IOException
    • createObjectGroupDataElement

      public static List<DataElement> createObjectGroupDataElement(byte[] fileContent, AtomicReference<ExGuid> rootNodeExGuid, List<ExGuid> objectDataExGuidList) throws TikaException, IOException
      This method is used to create object group data/blob element list.
      Parameters:
      fileContent - The file content in byte array format.
      rootNodeExGuid - Output parameter to represent the root node extended GUID.
      objectDataExGuidList - Input/Output parameter to represent the list of extended GUID for the data object data.
      Returns:
      Return the list of data element which will represent the file content.
      Throws:
      TikaException
      IOException
    • createRevisionManifestDataElement

      public static DataElement createRevisionManifestDataElement(ExGuid rootObjectExGuid, ExGuid baseRevisionID, List<ExGuid> refferenceObjectDataExGuidList, Map<ExGuid,ExGuid> revisionMapping, AtomicReference<ExGuid> currentRevisionID)
      This method is used to create the revision manifest data element.
      Parameters:
      rootObjectExGuid - Specify the root node object extended GUID.
      baseRevisionID - Specify the base revision Id.
      refferenceObjectDataExGuidList - Specify the reference object data extended list.
      currentRevisionID - Input/output parameter to represent the mapping of revision manifest.
      currentRevisionID - Output parameter to represent the revision GUID.
      Returns:
      Return the revision manifest data element.
    • createCellMainifestDataElement

      public static DataElement createCellMainifestDataElement(ExGuid revisionId, Map<CellID,ExGuid> cellIDMapping)
      This method is used to create the cell manifest data element.
      Parameters:
      revisionId - Specify the revision GUID.
      cellIDMapping - Input/output parameter to represent the mapping of cell manifest.
      Returns:
      Return the cell manifest data element.
    • createStorageManifestDataElement

      public static DataElement createStorageManifestDataElement(Map<CellID,ExGuid> cellIDMapping)
      This method is used to create the storage manifest data element.
      Parameters:
      cellIDMapping - Specify the mapping of cell manifest.
      Returns:
      The storage manifest data element.
    • createStorageIndexDataElement

      public static DataElement createStorageIndexDataElement(ExGuid manifestExGuid, Map<CellID,ExGuid> cellIDMappings, Map<ExGuid,ExGuid> revisionIDMappings)
      This method is used to create the storage index data element.
      Parameters:
      manifestExGuid - Specify the storage manifest data element extended GUID.
      cellIDMappings - Specify the mapping of cell manifest.
      revisionIDMappings - Specify the mapping of revision manifest.
      Returns:
      The storage index data element.
    • getDataObjectDataElementData

      public static List<ObjectGroupDataElementData> getDataObjectDataElementData(List<DataElement> dataElements, ExGuid storageIndexExGuid, AtomicReference<ExGuid> rootExGuid) throws TikaException
      This method is used to get the list of object group data element from a list of data element.
      Parameters:
      dataElements - Specify the data element list.
      storageIndexExGuid - Specify the storage index extended GUID.
      rootExGuid - Output parameter to represent the root node object.
      Returns:
      Return the list of object group data elements.
      Throws:
      TikaException
    • tryAnalyzeWhetherFullDataElementList

      public static boolean tryAnalyzeWhetherFullDataElementList(List<DataElement> dataElements, ExGuid storageIndexExGuid) throws TikaException
      This method is used to try to analyze the returned whether data elements are complete.
      Parameters:
      dataElements - Specify the data elements list.
      storageIndexExGuid - Specify the storage index extended GUID.
      Returns:
      If the data elements start with the specified storage index extended GUID are complete, return true. Otherwise return false.
      Throws:
      TikaException
    • tryAnalyzeWhetherConfirmSchema

      public static boolean tryAnalyzeWhetherConfirmSchema(List<DataElement> dataElements, ExGuid storageIndexExGuid) throws TikaException
      This method is used to analyze whether the data elements are confirmed to the schema defined in MS-FSSHTTPD.
      Parameters:
      dataElements - Specify the data elements list.
      storageIndexExGuid - Specify the storage index extended GUID.
      Returns:
      If the data elements confirms to the schema defined in the MS-FSSHTTPD returns true, otherwise false.
      Throws:
      TikaException
    • analyzeStorageIndexDataElement

      public static boolean analyzeStorageIndexDataElement(List<DataElement> dataElements, ExGuid storageIndexExGuid, AtomicReference<ExGuid> manifestMappingGuid, AtomicReference<HashMap<CellID,ExGuid>> cellIDMappings, AtomicReference<HashMap<ExGuid,ExGuid>> revisionIDMappings) throws TikaException
      This method is used to analyze the storage index data element to get all the mappings.
      Parameters:
      dataElements - Specify the data element list.
      storageIndexExGuid - Specify the storage index extended GUID.
      manifestMappingGuid - Output parameter to represent the storage manifest mapping GUID.
      cellIDMappings - Output parameter to represent the mapping of cell id.
      revisionIDMappings - Output parameter to represent the revision id.
      Returns:
      Return true if analyze the storage index succeeds, otherwise return false.
      Throws:
      TikaException
    • getStorageManifestDataElementData

      public static StorageManifestDataElementData getStorageManifestDataElementData(List<DataElement> dataElements, ExGuid manifestMapping) throws TikaException
      This method is used to get storage manifest data element from a list of data element.
      Parameters:
      dataElements - Specify the data element list.
      manifestMapping - Specify the manifest mapping GUID.
      Returns:
      Return the storage manifest data element.
      Throws:
      TikaException
    • getCellManifestDataElementData

      public static CellManifestDataElementData getCellManifestDataElementData(List<DataElement> dataElements, StorageManifestDataElementData manifestDataElementData, HashMap<CellID,ExGuid> cellIDMappings) throws TikaException
      This method is used to get cell manifest data element from a list of data element.
      Parameters:
      dataElements - Specify the data element list.
      manifestDataElementData - Specify the manifest data element.
      cellIDMappings - Specify mapping of cell id.
      Returns:
      Return the cell manifest data element.
      Throws:
      TikaException
    • getRevisionManifestDataElementData

      public static RevisionManifestDataElementData getRevisionManifestDataElementData(List<DataElement> dataElements, CellManifestDataElementData cellData, HashMap<ExGuid,ExGuid> revisionIDMappings) throws TikaException
      This method is used to get revision manifest data element from a list of data element.
      Parameters:
      dataElements - Specify the data element list.
      cellData - Specify the cell data element.
      revisionIDMappings - Specify mapping of revision id.
      Returns:
      Return the revision manifest data element.
      Throws:
      TikaException
    • getDataObjectDataElementData

      public static List<ObjectGroupDataElementData> getDataObjectDataElementData(List<DataElement> dataElements, RevisionManifestDataElementData revisionData, AtomicReference<ExGuid> rootExGuid) throws TikaException
      This method is used to get a list of object group data element from a list of data element.
      Parameters:
      dataElements - Specify the data element list.
      revisionData - Specify the revision data.
      rootExGuid - Specify the root node object extended GUID.
      Returns:
      Return the list of object group data element.
      Throws:
      TikaException