Package com.cognite.client.servicesV1
Class ConnectorServiceV1.FileBinaryReader
- java.lang.Object
-
- com.cognite.client.servicesV1.ConnectorServiceV1.FileBinaryReader
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- ConnectorServiceV1
public abstract static class ConnectorServiceV1.FileBinaryReader extends Object
Reads file binaries from the Cognite API.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FileBinaryReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectorServiceV1.FileBinaryReaderenableForceTempStorage(boolean enable)Forces the use of temp storage for all binaries--not just the >200MiB ones.List<ResponseItems<com.cognite.client.dto.FileBinary>>readFileBinaries(Request items)Executes an item-based request to get file binaries and blocks the thread until all files have been downloaded.CompletableFuture<List<ResponseItems<com.cognite.client.dto.FileBinary>>>readFileBinariesAsync(Request items)Executes an item-based request to get file binaries asynchronously.ConnectorServiceV1.FileBinaryReaderwithTempStoragePath(URI path)Sets the temporary storage path for storing large file binaries.
-
-
-
Method Detail
-
enableForceTempStorage
public ConnectorServiceV1.FileBinaryReader enableForceTempStorage(boolean enable)
Forces the use of temp storage for all binaries--not just the >200MiB ones.- Parameters:
enable-- Returns:
-
withTempStoragePath
public ConnectorServiceV1.FileBinaryReader withTempStoragePath(URI path)
Sets the temporary storage path for storing large file binaries. If the binary is >200 MiB it will be stored in temp storage instead of in memory. The following storage providers are supported: - Google Cloud Storage. Specify the temp path asgs://<my-storage-bucket>/<my-path>/. - Local (network) storage:file://localhost/home/files/, file:///home/files/, file:///c:/temp/- Parameters:
path- The URI to the temp storage- Returns:
- a with temp storage configured.
-
readFileBinaries
public List<ResponseItems<com.cognite.client.dto.FileBinary>> readFileBinaries(Request items) throws Exception
Executes an item-based request to get file binaries and blocks the thread until all files have been downloaded. We recommend reading a limited set of files per request, between 1 and 10--depending on the file size. If the request fails due to missing items, it will return a singleResultsItems.- Parameters:
items-- Returns:
- Throws:
Exception
-
readFileBinariesAsync
public CompletableFuture<List<ResponseItems<com.cognite.client.dto.FileBinary>>> readFileBinariesAsync(Request items) throws Exception
Executes an item-based request to get file binaries asynchronously. We recommend reading a limited set of files per request, between 1 and 10--depending on the file size. If the request fails due to missing items, it will return a singleResultsItems.- Parameters:
items-- Returns:
- Throws:
Exception
-
-