0

There is a third party application which drops three kind of CSV file on the windows server every night.

I need my java application to go and check for the files next day morning . if all the files are there it will read the files and insert the data into the database.

Here I know how to read the file and copy the data into db but the problem is what java libraries i can use to check if the files are present on the network drive?

COuld you please help on this?

2 Answers2

0

Java doesn't know that the directories are network mounts.

Just use the standard Java File class to open the directory and examine its contents.

slim
  • 40,215
  • 13
  • 94
  • 127
0

slim answer is quite simple to implement and deploy: map the window server share as a drive and access it as you would access a normal folder

if you do not want/cannot do that for permission or any other reason, look into this library which allow java to operate directly on window shares: jCIFS

see this answer for a short sample: access to file using Java with Samba JCIFS

Community
  • 1
  • 1
Lorenzo Boccaccia
  • 6,041
  • 2
  • 19
  • 29