LocalhostFileService implements GridFileService { public Path getLocalhostFilePath(String path) { path = removePrefix(path); Path pathObj = null; pathObj = Paths.get(path); logger.debug("constructed path: " + pathObj); return pathObj; } LocalhostFileService(GridTransportConnection transportConnection); void setUserDirIsRoot(boolean isRoot); @Override void put(File localFile, String remoteFile); @Override void get(String remoteFile, File localFile); @Override boolean exists(String remoteFile); @Override void touch(String remoteFile); @Override void mkdir(String remoteDir); @Override void delete(String remoteFile); @Override void move(String origin, String destination); @Override void copy(String origin, String destination); @Override URI remoteFileRepresentationToLocalURI(String file); Path getLocalhostFilePath(String path);  }
@Test(groups = "unit-tests") public void testGetLocalhostFileURI1(){ String path = "foo/bar.txt"; Path pathObj = lfs.getLocalhostFilePath(path); String userHome = System.getProperty("user.home"); logger.debug(pathObj.toString()); Assert.assertEquals(pathObj.toString(), userHome + "/" + path); }
@Test(groups = "unit-tests") public void testGetLocalhostFileURI2(){ String path = "/foo/bar.txt"; Path pathObj = lfs.getLocalhostFilePath(path); String userHome = System.getProperty("user.home"); logger.debug(pathObj.toString()); Assert.assertEquals(pathObj.toString(), userHome + path); }