Interface WrappedFile<T>

Type Parameters:
T - the native file type wrapped by this instance

public interface WrappedFile<T>
Abstraction over a file-like object consumed by a file-oriented Consumer (such as camel-file, camel-ftp, or camel-sftp), providing uniform access to the underlying file handle, its content, and its length.

Implementations wrap different native file types (for example java.io.File for the local file system, or a library-specific remote file object for FTP/SFTP). The body returned by getBody() may be a stream, a byte array, or a string depending on the component configuration.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable Object
    Gets the content of the file.
    @Nullable T
    Gets the file.
    long
    Gets the file length in bytes.
  • Method Details

    • getFile

      @Nullable T getFile()
      Gets the file.
      Returns:
      the file.
    • getBody

      @Nullable Object getBody()
      Gets the content of the file.
      Returns:
      the content of the file.
    • getFileLength

      long getFileLength()
      Gets the file length in bytes.
      Returns:
      the length of the file in bytes.