Package org.jivesoftware.smack.util
Class FileUtils
- java.lang.Object
-
- org.jivesoftware.smack.util.FileUtils
-
public final class FileUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description FileUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanaddLines(java.lang.String uriString, java.util.Set<java.lang.String> set)static java.util.List<java.lang.ClassLoader>getClassLoaders()Returns default classloaders.static java.io.InputStreamgetInputStreamForClasspathFile(java.lang.String path)static java.io.InputStreamgetInputStreamForClasspathFile(java.lang.String path, java.lang.ClassLoader loader)static java.io.InputStreamgetStreamForClasspathFile(java.lang.String path, java.lang.ClassLoader loader)static java.io.InputStreamgetStreamForUri(java.net.URI uri, java.lang.ClassLoader loader)static voidmaybeCreateFileWithParentDirectories(java.io.File file)static voidmaybeDeleteFileOrThrow(java.io.File file)static java.io.FileInputStreamprepareFileInputStream(java.io.File file)static java.io.FileOutputStreamprepareFileOutputStream(java.io.File file)static java.lang.StringreadFile(java.io.File file)static java.lang.StringreadFileOrThrow(java.io.File file)Reads the contents of a File.static booleanwriteFile(java.io.File file, java.lang.CharSequence content)static voidwriteFileOrThrow(java.io.File file, java.lang.CharSequence content)
-
-
-
Method Detail
-
getInputStreamForClasspathFile
public static java.io.InputStream getInputStreamForClasspathFile(java.lang.String path)
-
getInputStreamForClasspathFile
public static java.io.InputStream getInputStreamForClasspathFile(java.lang.String path, java.lang.ClassLoader loader)
-
getStreamForClasspathFile
public static java.io.InputStream getStreamForClasspathFile(java.lang.String path, java.lang.ClassLoader loader) throws java.io.IOException- Throws:
java.io.IOException
-
getStreamForUri
public static java.io.InputStream getStreamForUri(java.net.URI uri, java.lang.ClassLoader loader) throws java.io.IOException- Throws:
java.io.IOException
-
getClassLoaders
public static java.util.List<java.lang.ClassLoader> getClassLoaders()
Returns default classloaders.- Returns:
- a List of ClassLoader instances.
-
addLines
public static boolean addLines(java.lang.String uriString, java.util.Set<java.lang.String> set) throws java.net.MalformedURLException, java.io.IOException- Throws:
java.net.MalformedURLExceptionjava.io.IOException
-
readFileOrThrow
public static java.lang.String readFileOrThrow(java.io.File file) throws java.io.IOExceptionReads the contents of a File.- Parameters:
file- TODO javadoc me please- Returns:
- the content of file or null in case of an error
- Throws:
java.io.IOException- if an I/O error occurred.
-
readFile
public static java.lang.String readFile(java.io.File file)
-
writeFileOrThrow
public static void writeFileOrThrow(java.io.File file, java.lang.CharSequence content) throws java.io.IOException- Throws:
java.io.IOException
-
writeFile
public static boolean writeFile(java.io.File file, java.lang.CharSequence content)
-
prepareFileOutputStream
public static java.io.FileOutputStream prepareFileOutputStream(java.io.File file) throws java.io.IOException- Throws:
java.io.IOException
-
prepareFileInputStream
public static java.io.FileInputStream prepareFileInputStream(java.io.File file) throws java.io.IOException- Throws:
java.io.IOException
-
maybeDeleteFileOrThrow
public static void maybeDeleteFileOrThrow(java.io.File file) throws java.io.IOException- Throws:
java.io.IOException
-
maybeCreateFileWithParentDirectories
public static void maybeCreateFileWithParentDirectories(java.io.File file) throws java.io.IOException- Throws:
java.io.IOException
-
-