This is an automated email from the ASF dual-hosted git repository.
fmariani pushed a commit to branch camel-4.10.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-4.10.x by this push:
new 9f6bec56c10 Update smb-component.adoc
9f6bec56c10 is described below
commit 9f6bec56c10b4f80ba327073c5bb0629e6ac1a32
Author: Federico Mariani <[email protected]>
AuthorDate: Thu Apr 17 14:47:29 2025 +0200
Update smb-component.adoc
Remove old smbj implementations, now Camel SmbFile is used instead.
---
components/camel-smb/src/main/docs/smb-component.adoc | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/components/camel-smb/src/main/docs/smb-component.adoc
b/components/camel-smb/src/main/docs/smb-component.adoc
index 51a98eded5e..97a08949a08 100644
--- a/components/camel-smb/src/main/docs/smb-component.adoc
+++ b/components/camel-smb/src/main/docs/smb-component.adoc
@@ -79,16 +79,14 @@ NOTE: you may also get the file contents as an InputStream
using `exchange.getMe
=== Polling files (advanced)
-You can also get access to the file using the underlying `File` implementation
provided by smbj. In that case, polling all the
+You can also get access to the file using the underlying `File` implementation
provided by Camel. In that case, polling all the
files from an SMB file share and reading their contents would look like this:
[source,java]
----
private void process(Exchange exchange) throws IOException {
- final com.hierynomus.smbj.share.File file =
exchange.getMessage().getBody(com.hierynomus.smbj.share.File.class);
- try (InputStream inputStream = file.getInputStream()) {
- LOG.debug("Read exchange: {}, with contents: {}",
file.getFileInformation(), new String(inputStream.readAllBytes()));
- }
+ final org.apache.camel.component.smb.SmbFile file =
exchange.getMessage().getBody(org.apache.camel.component.smb.SmbFile.class);
+ LOG.debug("Read exchange: {}, with contents: {}", file.getFile(), new
String((byte[]) file.getBody()));
}
public void configure() {
@@ -100,7 +98,7 @@ public void configure() {
[NOTE]
====
-Beware that the File object provided is not a `java.io.File` instance, but,
instead a `com.hierynomus.smbj.share.File` instance.
+Beware that the File object provided is not a `java.io.File` instance, but,
instead a `org.apache.camel.component.smb.SmbFile` instance that extends
Camel's `GenericFile`.
Relying on the underlying implementation may make your code more susceptible
to problems between version upgrades of the library
used to implement this component.
====