LocalhostFileService implements GridFileService { @Override public void get(String remoteFile, File localFile) throws IOException { Path remote = getLocalhostFilePath(remoteFile); Path localFileAbsolutePath = Paths.get(localFile.getAbsolutePath()); logger.debug("get called: " + remote + " from localhost as " + localFileAbsolutePath); Files.copy(remote, localFileAbsolutePath, StandardCopyOption.REPLACE_EXISTING); logger.debug(remote + " from localhost copied to " + localFileAbsolutePath); } 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 testGet() throws IOException{ Path localPath = testPath.resolve("bar.txt"); Path remotePath = testPath.resolve("baz.txt"); remotePath = Files.createFile(remotePath); File localFile = localPath.toFile(); lfs.get(testFolder + "/baz.txt", localFile); Assert.assertTrue(Files.exists(localPath)); Files.delete(localPath); Files.delete(remotePath); }