Search code examples
javatomcatsymlinkfilenotfoundexceptionmount

FileNotFoundException after folder mount?


I get the java.io.FileNotFoundException when uploading new files in C:\folders

the C:\folders is a mount created like so:

mklink /D C:\folders \\IP_ADDRESS\folders 

PS: the network access between the local server and the distant server (having IP_ADDRESS) is granted, also by using only the normal folders (C:\folders) without a mount it works.

OS : Windows

Server : Apache Tomcat

Please is it a question of permissions? or the creation of the link?


Solution

  • You do not mount a folder with mklink, you create a link. You should really map a netwrok drive instead:

    net use u: \\IP_ADDRESS\folders 
    

    and tell your app to upload files to u:.

    You might want to add the switch /persistent:Yes to make sure the mapping will persist after a reboot. Use net use /? to see all options.