Skip to content

Industry Submodel Service Usage

Adapters

FileSystemAdapter

The FileSystemAdapter is a utility provided by the Tractus-X SDK to interact with the file system for managing submodels. It allows users to perform common file operations such as reading, writing, deleting files, and managing directories.

Python
from tractusx_sdk.industry.adapters.submodel_adapter_factory import SubmodelAdapterFactory

submodel_service_path = "/data/submodels"
file_system = SubmodelAdapterFactory.get_file_system(root_path=submodel_service_path)

FileSystemAdapter Methods

Method Description Parameters
read Return the entire content of a file path
write Write a new file path
delete Delete a specific file path
exists Check if a file exists path
list_contents Return a list of files based in a directory directory_path
create_directory Create a directory path
delete_directory Remove a directory path

NOTICE

This work is licensed under the CC-BY-4.0.

  • SPDX-License-Identifier: CC-BY-4.0
  • SPDX-FileCopyrightText: 2025 Contributors to the Eclipse Foundation
  • Source URL: https://github.com/eclipse-tractusx/tractusx-sdk