#57 Caching jar resource in temp folder

Next Release
open
nobody
General (39)
5
2011-02-22
2011-02-22
mijanek
No

My application is being launched from (windows) network share. Since there are sometimes troubles with resetting the network connection and java looses the resource reference witch leads to unresponsive application, I would appreciate, if there could be added new feature to copy the resource into temp folder and after exiting delete it.

Something like (in head.c -> prepare() ):

char temppath[_MAX_PATH] = {0};
char tempfile[_MAX_PATH] = {0};
GetTempPath(_MAX_PATH, temppath);
GetTempFileName(temppath,"l4j",0, tempfile); //generate random temp filename
CopyFile(exePath,tempfile, true); //copy the file (exe or Jar) into local temp file
CreateFile(tempfile,GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_DELETE_ON_CLOSE, NULL); //mark the file for deletion after closing the application
appendAppClasspath(args, tempfile, exp);

Of course this option can be done only if the application remains open until the java process exits..

Thx miro

Discussion