This content has been marked as final. Show 2 replies
You're asking how your Java program could bypass the user access rules which are imposed by the operating system?
Well, you seem to be asking about a Windows-based network, so conceivably you would be able to use JCIFS to do that. But you would have to have it access that network drive with an administrator's ID and password, which would have to be built into the program in some way. There are some definite security issues with doing that.
Or I believe there's a "Run As..." option in Windows. I don't know how this works but I expect it would require the user to input an administrator's password at some point. Which of course makes the whole exercise pointless if the user already knows an admin password. I could be wrong about how it works though. After all this isn't a Windows forum... that's my excuse...
Talk to your NetAdmins as see if they can create a special group account that will have only one user. Ask them to password protect the network share and supply the password to you, as well as the one user that belongs to that special group. Once you have this information, you could then program the user name and password into your program. I would use a char array to hold it and create a temporary String on the fly to log into the folder to access the documents your program needs to access.
Now, I come from the Linux world, where entire file systems, folders and individual files can be set to belong to a specific owner and group. Also, in Linux, the access rights to a file system, folder or individual file can be set for the owner, group and world, independently of each other. It has been so long since I've even looked at Windows that I don't know if (though I don't believe) this is possible, but talk to your NetAdmins anyway. Who knows, maybe they can actually help you out here.