Тёмный

Spring Boot and Sftp - Avoid ftp and ftps if possible 

Mike Møller Nielsen
Подписаться 11 тыс.
Просмотров 21 тыс.
50% 1

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...

Наука

Опубликовано:

 

17 авг 2019

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 50   
@HossHopf-Annekdoten
@HossHopf-Annekdoten 8 месяцев назад
Thank you for this amazing Video! ^^ You were a great help!
@MikesTechCorner
@MikesTechCorner 8 месяцев назад
No problem 😊 Thanks for watching
@selvasun4491
@selvasun4491 Год назад
This is very useful to understand.
@MikesTechCorner
@MikesTechCorner Год назад
Thank you for watching and commenting:)
@krishnachavhan655
@krishnachavhan655 4 года назад
Thanks for good example :)
@MikesTechCorner
@MikesTechCorner 4 года назад
You are welcome. Thank you for watching my video. :)
@anug14
@anug14 4 года назад
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.
@alanmangroo3656
@alanmangroo3656 Год назад
Great video. Thanks!
@MikesTechCorner
@MikesTechCorner Год назад
Glad you liked it! Thanks for commenting:)
@solaima5425
@solaima5425 4 года назад
Thank you! Do I need to use the same process to use spring-integration-ftp?
@MikesTechCorner
@MikesTechCorner 4 года назад
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.
@ganeshcbhanage
@ganeshcbhanage 4 года назад
how about streaming a large file from sftp server. Don't want to download entire file locally
@MikesTechCorner
@MikesTechCorner 4 года назад
Added to backlog
@arnabmukherjee4513
@arnabmukherjee4513 4 года назад
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 года назад
Yes thats quite easy. Ill see if I have time to create a video about that soon.
@arnabmukherjee4513
@arnabmukherjee4513 4 года назад
@@MikesTechCorner Thanks for your response!!
@MikesTechCorner
@MikesTechCorner 4 года назад
@@arnabmukherjee4513 ill make another video when I have time
@xavierangeles3828
@xavierangeles3828 Год назад
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?
@MikesTechCorner
@MikesTechCorner Год назад
Use Mockito. I have a video on that.
@superman-yb3gi
@superman-yb3gi 8 месяцев назад
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
@adermaulana9286
@adermaulana9286 3 года назад
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.
@kunteajit
@kunteajit 3 года назад
Any example of connecting sftp server using private key file using camel.
@MikesTechCorner
@MikesTechCorner 3 года назад
Excellent idea! I will dig into Camel soon. Added to backlog.
@AdamGiri514
@AdamGiri514 2 года назад
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.
@pankajjaiswal7874
@pankajjaiswal7874 3 года назад
Will this work to connect to IBM mainframe server ?
@MikesTechCorner
@MikesTechCorner 3 года назад
Does the MF support SFTP?
@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 года назад
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 года назад
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.
@eimaisklhros
@eimaisklhros 4 года назад
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.
@saravanajagan418
@saravanajagan418 4 года назад
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
@ainisofea515
@ainisofea515 2 года назад
Thanks!
@MikesTechCorner
@MikesTechCorner 2 года назад
You are welcome
@JedColina
@JedColina 4 года назад
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 года назад
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 года назад
@@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
@gulshannayak5458
@gulshannayak5458 2 года назад
thank you
@MikesTechCorner
@MikesTechCorner 2 года назад
Happy to help :)
Далее
SFTP Spring download multiple files
37:27
Просмотров 4 тыс.
Украшаю чехлы 🎀
00:51
Просмотров 79 тыс.
ЧУТЬ НЕ УТОНУЛ #shorts
00:27
Просмотров 7 млн
This or That 🛍️
00:52
Просмотров 6 млн
FTP (File Transfer Protocol), SFTP, TFTP Explained.
7:54
Let's code: Apache FtpServer
2:13:26
Просмотров 1,7 тыс.
Creating a Service Registry | Microservice
9:19
Просмотров 23 тыс.
Spring Integration @ServiceActivator @Gateway
27:37
Просмотров 8 тыс.
SFTP File Transfer using Java JSch
11:05
Просмотров 17 тыс.
SLF4j VS LOG4j VS LOGBACK | Tech Primers
8:52
Просмотров 38 тыс.
How to Soldering wire in Factory ?
0:10
Просмотров 1,5 млн