SshFileService implements GridFileService { @Override public URI remoteFileRepresentationToLocalURI(String file) { String fileURI; if (file.startsWith("sftp: if (file.contains("@")) { fileURI = "file: } else { fileURI = file.replace("sftp: } } else { logger.debug("creating host-based file url of: " + file.toString()); fileURI = "file: } URI result = URI.create(fileURI).normalize(); logger.debug("remote file URI: " + result.toString()); return result; } SshFileService(GridTransportConnection transportConnection); void setTimeout(int millis); void setRetries(int retries); void setUserDirIsRoot(boolean isRoot); @Override void put(File localFile, String remoteFile); void put(File localFile, String remoteFile, int attempts, int delayMillis); @Override void get(String remoteFile, File localFile); void get(String remoteFile, File localFile, int attempts, int delayMillis); @Override boolean exists(String remoteFile); @Override void delete(String remoteFile); void delete(String remoteFile, int attempts, int delayMillis); void setHostKeyChecking(String s); void setIdentityFile(String s); @Override void touch(String remoteFile); void touch(String remoteFile, int attempts, int delayMillis); @Override URI remoteFileRepresentationToLocalURI(String file); @Override void mkdir(String remoteDir); void mkdir(String remoteDir, int attempts, int delayMillis); @Override void move(String origin, String destination); void move(String origin, String destination, int attempts, int delayMillis); @Override void copy(String origin, String destination); void copy(String origin, String destination, int attempts, int delayMillis);  }
@Test public void testURI() throws Exception { URI remotefile = gfs.remoteFileRepresentationToLocalURI("/illumina/test.txt"); URI remoteuri = gfs.remoteFileRepresentationToLocalURI("sftp: Assert.assertEquals(remotefile.toString(), "file: Assert.assertEquals(remoteuri.toString(), "file: }