The chat responses are generated using Generative AI technology for intuitive search and may not be entirely accurate. They are not intended as professional advice. For full details, including our use rights, privacy practices and potential export control restrictions, please refer to our Generative AI Service Terms of Use and Generative AI Service Privacy Information. As this is a test version, please let us know if something irritating comes up. Like you get recommended a chocolate fudge ice cream instead of an energy managing application. If that occurs, please use the feedback button in our contact form!
Skip to content
Insights Hub and Industrial IoT

Insights Hub drives smart manufacturing through the industrial Internet of Things. Gain actionable insights with asset and operational data and improve your processes.

IoT File Client for Java¶

Introduction¶

The IoT File Java client allows you to manage files related to assets. Refer to IoT File Service for more information about the service.

Hint

In the IoT context, assets are referred to as entity and aspects as propertyset.

File Operations¶

Client name: FileservicesClient

Create a File¶

Create a file for the specified entity and path with the provided content.

FileservicesClient fileservicesClient = FileservicesClient.builder()
                                            .mindsphereCredentials(credentials)
                                            .restClientConfig(config)
                                            .build();

FileWriterResponse fileWriterResponse;
try {
    fileWriterResponse = fileservicesClient.createFile(file,entityId,filepath,description,type);
} catch (MindsphereException e) {
    // Exception handling
}

Update a File¶

Update a file for the specified entity and path with the provided content.

//Construct FileservicesClient object as shown above

FileWriterResponse fileWriterResponse;
try {
    fileWriterResponse = fileservicesClient.updateFile(file, entityId, filepath, description, type, ifMatch);
} catch (MindsphereException e) {
    // Exception handling
}

Read a File¶

Read a file for the specified entity and path. The GET method is used for the API call.

//Construct FileservicesClient object as shown above

FileReaderResponse fileReaderResponse;
try {
    fileReaderResponse = fileservicesClient.readFile(entityId, filepath, ifNoneMatch)
} catch (MindsphereException e) {
    // Exception handling
}

Delete a File¶

Delete a file for the specified entity and path.

//Construct FileservicesClient object as shown above

boolean isFileDeleted;
try {
    isFileDeleted = fileservicesClient.deleteFile(entityId, filepath)
} catch (MindsphereException e) {
    // Exception handling
}

Search a File¶

Search one or multiple files for the specified entity and path.

//Construct FileservicesClient object as shown above

FileSearchResponse fileSearchResponse;
try {
    fileSearchResponse = fileservicesClient.searchFiles(entityId, offset, limit, count, order, filter);
} catch (MindsphereException e) {
    // Exception handling
}