You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by fm...@apache.org on 2025/04/17 14:21:50 UTC
(camel) branch main updated: Update smb-component.adoc
This is an automated email from the ASF dual-hosted git repository.
fmariani pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new a0b0c7e5f8f Update smb-component.adoc
a0b0c7e5f8f is described below
commit a0b0c7e5f8f25102d4645167ef9a1430e4a7a504
Author: Federico Mariani <34...@users.noreply.github.com>
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.
====