Spring Boot and Sftp - Avoid ftp and ftps if possible

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ก.ค. 2024
  • Ftp, ftps and sftp what is it and how is it used in a Spring Boot application. I use Spring Integration to show how easy it is to connect to a sftp server. Im using a docker image to setup the sftp-server. Im using Filezilla as the sftp-client to prove that files has been updated. Enjoy! :-) Feel free to leave me a comment below. The code is located here: github.com/ekim197711/springb...
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 50

  • @HossHopf-Annekdoten
    @HossHopf-Annekdoten 8 หลายเดือนก่อน +1

    Thank you for this amazing Video! ^^ You were a great help!

    • @MikesTechCorner
      @MikesTechCorner  8 หลายเดือนก่อน

      No problem 😊 Thanks for watching

  • @anug14
    @anug14 4 ปีที่แล้ว +1

    How do we deal with scanning the files we upload into server? We basically uploaded the file and antivirus was running continuously and we would sort of wait for few seconds and if they were still present, the file is good and if they were not we would mark the file entry in db as invalid and user has to upload again.

    • @MikesTechCorner
      @MikesTechCorner  4 ปีที่แล้ว

      You dont scan the "uploading"-folder. Then the client moves the file from "uploading" to "done" and then you scan the "done" directory.

  • @selvasun4491
    @selvasun4491 ปีที่แล้ว +1

    This is very useful to understand.

    • @MikesTechCorner
      @MikesTechCorner  ปีที่แล้ว

      Thank you for watching and commenting:)

  • @arnabmukherjee4513
    @arnabmukherjee4513 4 ปีที่แล้ว +2

    This is very helpful to understand the concept. How do I download multiple files from the SFTP folder? Can I do a loop over filenames after fetching them from the remote folder?

    • @MikesTechCorner
      @MikesTechCorner  4 ปีที่แล้ว +1

      Yes thats quite easy. Ill see if I have time to create a video about that soon.

    • @arnabmukherjee4513
      @arnabmukherjee4513 4 ปีที่แล้ว +1

      @@MikesTechCorner Thanks for your response!!

    • @MikesTechCorner
      @MikesTechCorner  4 ปีที่แล้ว

      @@arnabmukherjee4513 ill make another video when I have time

  • @solaima5425
    @solaima5425 4 ปีที่แล้ว

    Thank you! Do I need to use the same process to use spring-integration-ftp?

    • @MikesTechCorner
      @MikesTechCorner  4 ปีที่แล้ว +1

      Hi Solai. When I have time I will show an example with spring integration sftp and the annotation like @Gateway and @MessagingGateway. :-) Thank you for watching.

  • @xavierangeles3828
    @xavierangeles3828 ปีที่แล้ว +1

    It’s ok, but what if I have the spring boot project and deploy it in a server than doesn’t reach the dev sftp server in junit test, how can i mock a sftp server connection in junit tests?

  • @ganeshcbhanage
    @ganeshcbhanage 4 ปีที่แล้ว +1

    how about streaming a large file from sftp server. Don't want to download entire file locally

  • @superman-yb3gi
    @superman-yb3gi 8 หลายเดือนก่อน +1

    Hi,
    What about the session closure is that handled by spring itself

    • @MikesTechCorner
      @MikesTechCorner  8 หลายเดือนก่อน

      Yes it is. If you want to control it your self then use Apache Common FTPClient commons.apache.org/proper/commons-net/apidocs/org/apache/commons/net/ftp/FTPClient.html

  • @krishnachavhan655
    @krishnachavhan655 4 ปีที่แล้ว +1

    Thanks for good example :)

    • @MikesTechCorner
      @MikesTechCorner  4 ปีที่แล้ว

      You are welcome. Thank you for watching my video. :)

  • @adermaulana9286
    @adermaulana9286 3 ปีที่แล้ว +1

    Hi sir, how to connect filezilla before running project, i'm so confused ?

    • @MikesTechCorner
      @MikesTechCorner  3 ปีที่แล้ว

      Filezilla is the client / GUI to connect to a sftp server. Just like my Spring app is a client of a sftp server. I spin up a sftp server using docker.

  • @alanmangroo3656
    @alanmangroo3656 ปีที่แล้ว

    Great video. Thanks!

    • @MikesTechCorner
      @MikesTechCorner  ปีที่แล้ว

      Glad you liked it! Thanks for commenting:)

  • @eimaisklhros
    @eimaisklhros 4 ปีที่แล้ว +1

    Getting an error at return from gimmeFactory()
    The error is NoSuchMethodError: org.springframework.integration.util.Javautils.acceptIfHasText(etc etc)
    Basically acceptIfHasText throws the error inside the DefaultSftpSessionFactory.class
    I wonder if it has something to do about jschSession::setConfig.
    I use maven and I have installed the dependency as seen in the official spring doc, SFTP Adapters.
    If you could help it would be great.
    You have awesome content in your channel!

    • @MikesTechCorner
      @MikesTechCorner  4 ปีที่แล้ว

      Try to clone my project and run the code again.

  • @AdamGiri514
    @AdamGiri514 2 ปีที่แล้ว +1

    How to implement expect-ct header in spring with report-uri
    Please make on video

    • @MikesTechCorner
      @MikesTechCorner  2 ปีที่แล้ว

      I have quite a long back log... But... Added to backlog.

  • @kunteajit
    @kunteajit 3 ปีที่แล้ว +1

    Any example of connecting sftp server using private key file using camel.

    • @MikesTechCorner
      @MikesTechCorner  3 ปีที่แล้ว +1

      Excellent idea! I will dig into Camel soon. Added to backlog.

  • @sudarshanshere
    @sudarshanshere 3 ปีที่แล้ว

    I am facing a problem the file is getting partially written. Only 32.6 Kb is getting written to the remote server.. The written file is corrupted.. How do we resolve this?
    Is there a file size limit?

    • @MikesTechCorner
      @MikesTechCorner  3 ปีที่แล้ว

      If you get the exception MaxUploadSizeExceed then here's a good article: www.baeldung.com/spring-maxuploadsizeexceeded

    • @sudarshanshere
      @sudarshanshere 3 ปีที่แล้ว +1

      It's not a maxUploadSizeExceeded exception...
      It is truncating characters after 32kb..Its basically a problem with the jcraft jar which spring uses internally.. ChannelSftp.put... after the sessiontimeout of 30s u get an IOException Stream Closed..
      Not sure how to resolve this..

  • @denisr.8248
    @denisr.8248 2 ปีที่แล้ว +1

    Can you please 1 video how we setup this demo surver as well ty

    • @MikesTechCorner
      @MikesTechCorner  2 ปีที่แล้ว

      Clone the project and use the docker-compose file to start up filezilla sftp server.

  • @pankajjaiswal7874
    @pankajjaiswal7874 3 ปีที่แล้ว

    Will this work to connect to IBM mainframe server ?

  • @saravanajagan418
    @saravanajagan418 4 ปีที่แล้ว +2

    how to download the file and store in a location? instead of reading the content...

    • @MikesTechCorner
      @MikesTechCorner  4 ปีที่แล้ว

      Try to watch the other sftp videos. "... Storage..."

    • @bestksd
      @bestksd 4 ปีที่แล้ว

      @@MikesTechCorner where is video you mean Mr @Mike

    • @MikesTechCorner
      @MikesTechCorner  3 ปีที่แล้ว

      Search in my channel :) sftp

  • @JedColina
    @JedColina 4 ปีที่แล้ว +2

    DO you have an example connecting through FTPS?

    • @MikesTechCorner
      @MikesTechCorner  4 ปีที่แล้ว

      No. Use sftp instead! Ill make an example with Spring Integration soon.

    • @JedColina
      @JedColina 4 ปีที่แล้ว +1

      you dont recommend using FTPS?
      it could be nice if you also have an example with FTPS. thanks for the video Mike!

    • @MikesTechCorner
      @MikesTechCorner  4 ปีที่แล้ว +1

      @@JedColina ok ill make a ftps video

    • @denisr.8248
      @denisr.8248 2 ปีที่แล้ว

      @@MikesTechCorner DId you made with FTPS as well ? i am interested in it

  • @ainisofea515
    @ainisofea515 2 ปีที่แล้ว +1

    Thanks!

  • @gulshannayak5458
    @gulshannayak5458 2 ปีที่แล้ว +1

    thank you