Maikel Geelen wrote:Can anyone help me with this.
I hope my question was clear enough.
Perfectly; however, we don't like to simply hand out code on this site.
What you need to do is to break down the problem, which, as I see it, has at least three parts:
1. How do you get a date String.
2. How do you get a time String.
3. How you you plug that into your FileHandler.
For the first two, I suggest you look at SimpleDateFormat.
For the last, read the API documentation for FileHandler carefully. It actually specifies a pattern, which contains some other stuff that you might find useful.
If you can write:
Handler fh = new FileHandler("someDrive:someDirectory/test.html"); Surely it's pretty straightforward to do what you want.
PS: Unless you really need it, or you've been told to do it that way, I'd suggest that directories by time is overdoing it a bit. Why not just make it a prefix to your filename?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
posted 6 years ago
So far i have created it like this.
I also left away the folder for the time and implemented it in the file itself.
The first filehandler works but the second doesn't because the filehandler can't create the "date" folder.
Here's the error i'm getting.
Is there some sort of argument i'm forgetting or maybe a property of the filehandler? Or is it something with permissions?