@Test public void testWriteStreamToTempFile() throws Exception { File tempFileLocal = Os.writeToTempFile(new ByteArrayInputStream("mycontents".getBytes()), "resourceutils-test", ".txt"); try { List<String> lines = Files.readLines(tempFileLocal, Charsets.UTF_8); assertEquals(lines, ImmutableList.of("mycontents")); } finally { tempFileLocal.delete(); } }
@Deprecated public static File writeToTempFile(InputStream is, String prefix, String suffix) { return Os.writeToTempFile(is, prefix, suffix); }
ResourceUtils { @Deprecated public static File writeToTempFile(InputStream is, String prefix, String suffix) { return Os.writeToTempFile(is, prefix, suffix); } }
ResourceUtils { @Deprecated public static File writeToTempFile(InputStream is, String prefix, String suffix) { return Os.writeToTempFile(is, prefix, suffix); } ResourceUtils(ClassLoader loader, Object contextObject, String contextMessage);  ResourceUtils(BrooklynClassLoadingContext loader, Object contextObject, String contextMessage);  ResourceUtils(Object contextObject, String contextMessage);  ResourceUtils(Object contextObject); }
ResourceUtils { @Deprecated public static File writeToTempFile(InputStream is, String prefix, String suffix) { return Os.writeToTempFile(is, prefix, suffix); } 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); }
ResourceUtils { @Deprecated public static File writeToTempFile(InputStream is, String prefix, String suffix) { return Os.writeToTempFile(is, prefix, suffix); } 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);  }