### Question:
ResourceUtils { private InputStream getResourceViaSftp(String url) throws IOException { assert url.startsWith("sftp: String subUrl = url.substring("sftp: String user; String address; String path; int atIndex = subUrl.indexOf("@"); int colonIndex = subUrl.indexOf(":", (atIndex > 0 ? atIndex : 0)); if (colonIndex <= 0 || colonIndex <= atIndex) { throw new IllegalArgumentException("Invalid sftp url ("+url+"); IP or hostname must be specified, such as sftp: } if (subUrl.length() <= (colonIndex+1)) { throw new IllegalArgumentException("Invalid sftp url ("+url+"); must specify path of remote file, such as sftp: } if (atIndex >= 0) { user = subUrl.substring(0, atIndex); } else { user = null; } address = subUrl.substring(atIndex + 1, colonIndex); path = subUrl.substring(colonIndex+1); SshMachineLocation machine = new SshMachineLocation(MutableMap.builder() .putIfNotNull("user", user) .put("address", InetAddress.getByName(address)) .build()); try { final File tempFile = Os.newTempFile("brooklyn-sftp", "tmp"); tempFile.setReadable(true, true); machine.copyFrom(path, tempFile.getAbsolutePath()); return new FileInputStream(tempFile) { @Override public void close() throws IOException { super.close(); tempFile.delete(); } }; } finally { Streams.closeQuietly(machine); } } ResourceUtils(ClassLoader loader, Object contextObject, String contextMessage);  ResourceUtils(BrooklynClassLoadingContext loader, Object contextObject, String contextMessage);  ResourceUtils(Object contextObject, String contextMessage);  ResourceUtils(Object contextObject); static final ResourceUtils create(ClassLoader loader, Object contextObject, String contextMessage); static final ResourceUtils create(BrooklynClassLoadingContext loader, Object contextObject, String contextMessage); static final ResourceUtils create(Object contextObject, String contextMessage); static final ResourceUtils create(Object contextObject); static final ResourceUtils create(); static void addClassLoaderProvider(Function<Object,BrooklynClassLoadingContext> provider); Iterable<URL> getResources(String name); InputStream getResourceFromUrl(String url); static URL tidy(URL url); static String tidyFileUrl(String url); @Deprecated static String mergeFilePaths(String... items); @Deprecated static String tidyFilePath(String path); @Deprecated static String getProtocol(String url); String getResourceAsString(String url); String checkUrlExists(String url); String checkUrlExists(String url, String message); boolean doesUrlExist(String url); Optional<String> firstAvailableUrl(String ...urls); String getClassLoaderDir(); String getClassLoaderDir(String resourceInThatDir); static URL getContainerUrl(URL url, String resourceInThatDir); @Deprecated static String readFullyString(InputStream is); @Deprecated static byte[] readFullyBytes(InputStream is); @Deprecated static void copy(InputStream input, OutputStream output); @Deprecated static File mkdirs(File dir); @Deprecated static File writeToTempFile(InputStream is, String prefix, String suffix); @Deprecated static File writeToTempFile(InputStream is, File tempDir, String prefix, String suffix); @Deprecated static File writeToTempFile(Properties props, String prefix, String suffix); @Deprecated static File writeToTempFile(Properties props, File tempDir, String prefix, String suffix); @Deprecated static Thread addShutdownHook(final Runnable task); @Deprecated static boolean removeShutdownHook(Thread hook); @Deprecated static String mergePaths(String ...items);  }### Answer:
@Test(groups="Integration") public void testGetResourceViaSftp() throws Exception { InputStream stream = utils.getResourceFromUrl("sftp: assertEquals(Streams.readFullyString(stream), tempFileContents); }