I have searched for a long time, but found nothing.
I would like to read a file with Java from a specific UNC filename (\\\) and have to enter a user and a password. I do not want to use ftp or something on ssh (or better can't).
Something like this (pseudo code):
public static void readFile(File filename, URL fileURL, User userName, Password password){
FileReader fr = new FileReader(filename, fileURL, userName, password);
... do something with the file ....
}
Is there a way to do this with Java? Thanks for your help.
[Edit] I would like to access a folder from a user in an other domain. So i have to submit the user and the password for this domain user.
Another case is to access the folder of an foreign user in unix systems. eg. my user ist located in /home/me and i want to access the folder of /home/you so i need to submit the passwort from the user "you".