Package org.jivesoftware.smack.util
Class FileUtils
java.lang.Object
org.jivesoftware.smack.util.FileUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic List<ClassLoader>Returns default classloaders.static InputStreamstatic InputStreamgetInputStreamForClasspathFile(String path, ClassLoader loader) static InputStreamgetStreamForClasspathFile(String path, ClassLoader loader) static InputStreamgetStreamForUri(URI uri, ClassLoader loader) static voidstatic voidmaybeDeleteFileOrThrow(File file) static FileInputStreamprepareFileInputStream(File file) static FileOutputStreamprepareFileOutputStream(File file) static Stringstatic StringreadFileOrThrow(File file) Reads the contents of a File.static booleanwriteFile(File file, CharSequence content) static voidwriteFileOrThrow(File file, CharSequence content)
-
Constructor Details
-
FileUtils
public FileUtils()
-
-
Method Details
-
getInputStreamForClasspathFile
-
getInputStreamForClasspathFile
-
getStreamForClasspathFile
public static InputStream getStreamForClasspathFile(String path, ClassLoader loader) throws IOException - Throws:
IOException
-
getStreamForUri
- Throws:
IOException
-
getClassLoaders
Returns default classloaders.- Returns:
- a List of ClassLoader instances.
-
addLines
public static boolean addLines(String uriString, Set<String> set) throws MalformedURLException, IOException - Throws:
MalformedURLExceptionIOException
-
readFileOrThrow
Reads the contents of a File.- Parameters:
file- TODO javadoc me please- Returns:
- the content of file or null in case of an error
- Throws:
IOException- if an I/O error occurred.
-
readFile
-
writeFileOrThrow
- Throws:
IOException
-
writeFile
-
prepareFileOutputStream
- Throws:
IOException
-
prepareFileInputStream
- Throws:
IOException
-
maybeDeleteFileOrThrow
- Throws:
IOException
-
maybeCreateFileWithParentDirectories
- Throws:
IOException
-