0

I have the following pipeline:

from("sftp:....")
        .to("file://ftp_files");

I need to check mime type and stop it, in case if mime type is not as expected and send email.

I know a way to check mime type: https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#probeContentType(java.nio.file.Path)

How can I achieve it?

gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
  • 1
    Use a processor between the STP and FIle. – Namphibian Oct 26 '17 at 20:53
  • Mind that the JDK probe api only works for Java files, and not FTP files - they are not the same. Maybe if only the file extension name is fine, then you can use that to know if its xml, txt, etc. If not then do as Namphibian says, write some java code and check yourself. – Claus Ibsen Oct 27 '17 at 06:59
  • @Claus Ibsen but how can I interrupt a pipeline if check returns false ? – gstackoverflow Oct 27 '17 at 07:13

0 Answers0