Package org.jivesoftware.smack.util
Class FileUtils
java.lang.Object
org.jivesoftware.smack.util.FileUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static List<ClassLoader>
Returns default classloaders.static InputStream
static InputStream
getInputStreamForClasspathFile
(String path, ClassLoader loader) static InputStream
getStreamForClasspathFile
(String path, ClassLoader loader) static InputStream
getStreamForUri
(URI uri, ClassLoader loader) static void
static void
maybeDeleteFileOrThrow
(File file) static FileInputStream
prepareFileInputStream
(File file) static FileOutputStream
prepareFileOutputStream
(File file) static String
static String
readFileOrThrow
(File file) Reads the contents of a File.static boolean
writeFile
(File file, CharSequence content) static void
writeFileOrThrow
(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:
MalformedURLException
IOException
-
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
-