John said:
We have a java application that runs on windows servers and accessing remote
files using a UNC path name. We have been asked to move the application to a
solaris machine. Will the UNC file access work the same we are creating
simple File objects to do this.
Thanks
Jon
UNC names look like this:
\\servername\sharename\path\file
or: //servername/sharename/path/file
The servername may be a NetBIOS name of the form: domain.host.
This can (usually) be looked up in DNS to get an IP address (or0
real DNS hostname) for the server. The sharename maps to some
directory on that server.
Given all that you should be able to write some simple
code to convert a UNC name to a URI that can be used with
class File, something like:
file://server-hostname-or-IP/path-to-share/path/file
Of course you'd have to maintain all the mappings; if they change
on the windows servers you'd have to change them here too. An
easier way is to install the Samba package and use the client tools
available, with cron, to maintain that stuff in a local file/DB that
your Java application can access to do the translations.
-Wayne