@Test public void getURIRespectingUsernameChanges() throws FileSystemException, URISyntaxException { JScpWorker worker = new JScpWorker("uname"); URI uri = worker.getURIRespectingUsername(URI.create("sftp: Assert.assertEquals(uri, URI.create("sftp: }
URI getURIRespectingUsername(URI uri) throws URISyntaxException { if (userName != null && uri.getUserInfo() == null) { uri = new URI(uri.getScheme(), userName, uri.getHost(), uri.getPort(), uri.getPath(), uri.getQuery(), uri.getFragment()); } return uri; }
JScpWorker { URI getURIRespectingUsername(URI uri) throws URISyntaxException { if (userName != null && uri.getUserInfo() == null) { uri = new URI(uri.getScheme(), userName, uri.getHost(), uri.getPort(), uri.getPath(), uri.getQuery(), uri.getFragment()); } return uri; } }
JScpWorker { URI getURIRespectingUsername(URI uri) throws URISyntaxException { if (userName != null && uri.getUserInfo() == null) { uri = new URI(uri.getScheme(), userName, uri.getHost(), uri.getPort(), uri.getPath(), uri.getQuery(), uri.getFragment()); } return uri; } JScpWorker(String userName); }
JScpWorker { URI getURIRespectingUsername(URI uri) throws URISyntaxException { if (userName != null && uri.getUserInfo() == null) { uri = new URI(uri.getScheme(), userName, uri.getHost(), uri.getPort(), uri.getPath(), uri.getQuery(), uri.getFragment()); } return uri; } JScpWorker(String userName); FileObject getFileObjectByUri(String file); FileObject getFileObjectByUri(URI file); FileSystemOptions getSftpDefaultOptions(); }
JScpWorker { URI getURIRespectingUsername(URI uri) throws URISyntaxException { if (userName != null && uri.getUserInfo() == null) { uri = new URI(uri.getScheme(), userName, uri.getHost(), uri.getPort(), uri.getPath(), uri.getQuery(), uri.getFragment()); } return uri; } JScpWorker(String userName); FileObject getFileObjectByUri(String file); FileObject getFileObjectByUri(URI file); FileSystemOptions getSftpDefaultOptions();  }