xebialabs/overthere — pull request #28 by demobox (2011-12-03 00:54:26+00:00)
Title: [issue 27] Support drive->share name mappings for Windows path -> SMB path and UNC path -> Windows path conversion

After creating a share "Boing" pointing to C:\Users\aphillips\Temp on my local machine, the following snippet

ConnectionOptions options = new ConnectionOptions();
options.set(ADDRESS, "nb-aphillips");
options.set(USERNAME, "aphillips");
options.set(PASSWORD, "yeah...right");
options.set(OPERATING_SYSTEM, WINDOWS);
options.set(CONNECTION_TYPE, TELNET);
options.set(CIFS_DRIVE_MAPPINGS, ImmutableMap.of("x", "Boing"));
OverthereConnection connection = Overthere.getConnection("cifs", options);

try {
// will use mapping
OverthereFile file = connection.getFile("x:\\nexus_repos.txt");
System.out.println(((CifsFile) file).getSmbFile().getUncPath());
// reverse mapping
System.out.println(file.getPath());
System.out.println(file.exists());
} finally {
connection.close();
}

produces the output:

\\nb-aphillips\Boing\nexus_repos.txt // UNC path
x:\nexus_repos.txt // reverse mapped path
true