Reputation: 63
I have an access 97 server on windows that crashes if it's file size grows to be 1GB. I need to either find a software or write something(in java) that checks the directory and notifies us by email if the file size grows to 900MB so we can fix it. Does anyone have any ideas on sofrware or ways to go about this? I'm pretty rusty at programming so any points or tips would help greatly.
Edit1: The growth rate is relatively slow(last time we had a problem was about 3 months ago), so I believe we want it to check every 15 min, if that changes anything.
Upvotes: 0
Views: 157
Reputation: 7608
You can periodically check the size of the file using size() from the Files class in Java. http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html
If you have more files to check you can cycle and add up their total size. Within your while you want to put a sleep()
or something similar to avoid using up all your CPU.
To send an email, the package http://javamail.kenai.com/nonav/javadocs/com/sun/mail/smtp/package-summary.html provides an implementation of smtp client.
Upvotes: 2