File class authentication.

I am trying to programmatically read the contents of a remote shared directory. I know i can use the File class to do this but my question is, is it possible to do it this way when authentication is required to access the directory? Thanks.
[254 byte] By [javanuia] at [2007-11-26 23:41:51]
# 1

jdk (java.io.File) does not need any authentication information.

Unless you're only going to be using 'GUEST' or 'null' credentials you

will always need credentials to be entered regardless of what type of

application you're using wheather it be Java, .NET, or whatever. It's

just a matter of *when* you supply the credentials. Windows is nice

because you can enter the credentials, establish a logon session, and

delegate those credentials to other threads and servers. So once you

enter your creds they're inherited by children and can be deligated to

other servers that that process logs into.

So the java.io.File class simply calls the underlying file system

operations which use whatever credentials are associated with the current

process. Those credentials need to be entered at some point (e.g. when

the user logs in).

Note that that has a severe disadvantage that the process must run under the credentials required to access the network resource.

roaha at 2007-7-11 15:10:11 > top of Java-index,Java Essentials,Java Programming...