Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Trigger an email when something is found

 
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's say I've a following directory structure on RHEL server. Different users related folders are there inside  Files folder.

Files
     \_User1
     \_User2
     \_User3

There is some springboot related stuff that is writing files in zip format at some point of time (depending upon when it finishes). This may not be relevant to what I'm going to ask below but I thought of sharing this.

Here's my question:

Let's say if that springboot application writes a file inside User1 then is it a good idea to have a separate Java application which could send an email to the user notifying that their files are ready and also include a link to download the file from the server. I've a separate servlet which can be used to download files from the server using a URL.  I'm wondering what that thing could be becase Server Sent events are used to send push notification to the UI. Here, no UI interaction is needed.Please advise or share your thoughts on this.
 
Rancher
Posts: 833
19
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can easily make a small Java application that will run locally on the machine you wish to monitor, have it poll the folder(s) you wish  it to monitor, then send an email to the appropriate location.
 
Ranch Hand
Posts: 201
5
MS IE Notepad Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if possible: implement the user notification in the main application creating the files
 
Sheriff
Posts: 24632
56
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jack Tauson wrote:Let's say if that springboot application writes a file inside User1 then is it a good idea to have a separate Java application which could send an email to the user notifying that their files are ready and also include a link to download the file from the server.



Like Matt said, why would you want a separate application for that? Now if the files in question were being created by numerous applications, then a centralized notifier application might be useful. But if the workflow is "1. Create files 2. Notify customer" then having the same code do those two things seems reasonable enough to me.
 
If tomatoes are a fruit, then ketchup must be a jam. Taste this tiny ad:
professionally read, modify and write PDF files from Java
https://products.aspose.com/pdf/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!