API Reference

FileReader

Method Description

CompletionStage<InputStream> toInputStream(FileDescriptor fileDescriptor)

Converts a FileDescriptor to an InputStream, returned asynchronously as a CompletionStage<InputStream>

Flux<ByteBuffer> toByteBufferFlux(FileDescriptor fileDescriptor)

Reads a file specified by the FileDescriptor and converts it into a reactive stream of byte buffers. It’s essentially creating a reactive representation of the file’s content, allowing the file to be processed in a non-blocking, chunk-by-chunk manner.

FileManagerFileSystem getFileSystem()

Returns the applicable file system. Currently supported values are:

* S3 * LOCAL

String getName()

DEPRECATED: Returns the name of the reader implementation

FileWriter

Method Description

CompletionStage<WriteResponse> write(InputStream inputStream, FileDescriptor fileDescriptor)

Writes an InputStream to a file identified by a FileDescriptor, returns a CompletionStage<WriteResponse> to indicate completion

CompletionStage<WriteResponse> write(Flux<ByteBuffer> source, FileDescriptor fileDescriptor)

Write data from a reactive stream Flux<ByteBuffer> to a file specified by the FileDescriptor, returns a CompletionStage<WriteResponse> to indicate completion

Mono<WriteResponse> reactiveWrite(Flux<ByteBuffer> source, FileDescriptor fileDescriptor)

Write data from a reactive stream Flux<ByteBuffer> to a file specified by the FileDescriptor. Returns a Mono<WriteResponse> to indicate completion

FileManagerFileSystem getFileSystem()

Returns the applicable file system. Currently supported values are:

  • S3

  • LOCAL

String getName()

DEPRECATED: Returns the name of the reader implementation

FileDeleter

Method Description

CompletionStage<Void> delete(FileDescriptor fileDescriptor)

Deletes a file identified by a FileDescriptor, returns a CompletionStage<Void> to indicate completion

CompletionStage<Void> deleteFilesOlderThanDays(String path, long days)

Deletes files older than a specified number of days in a given path, returns a CompletionStage<Void> to indicate completion

Mono<Void> reactiveDelete(FileDescriptor fileDescriptor)

Deletes a file identified by a FileDescriptor, returns a Mono<Void> to indicate completion

Mono<Void> reactiveDeleteFilesOlderThanDays(String path, long days)

Deletes files older than a specified number of days in a given path, returns a Mono<Void> to indicate completion

FileManagerFileSystem getFileSystem()

Returns the applicable file system. Currently supported values are:

  • S3

  • LOCAL

String getName()

DEPRECATED: Returns the name of the reader implementation

Model

FileDescriptor

FileDescriptor is used to specify details of the file to be processed

Method Description

String path()

Returns the absolute path of the file to be processed as a String

String fileName()

Returns the file name of the file to be processed as a String

Path getFilePath()

Returns the absolute path of the file including the file name to be processed as a Path

String getFilePathAsString()

Returns the path of the file including the file name to be processed as a String

WriteResponse

WriteResponse contains information pertinent to the file processed that may be of use to the API consumer

Method Description

String version()

Returns the version of the document written as a String. Can return null if versioning is not enabled.