Helper functions related to String manipulation.
More...
|
static void | unZip (String zipFilePath, String destinationFolder) throws IOException |
| Unzips a compressed file (.zip, .apk) More...
|
|
static void | unZip (InputStream zipInputStream, String destinationFolder) |
| Unzips a compressed file (.zip, .apk) More...
|
|
static void | copyAssets (Context context, String assetFileName, String destinationDirectory) |
| Copies a file from assets folder to a folder on device memory. More...
|
|
static boolean | equalContent (File file1, File file2) |
|
static void | saveXmlFile (String destinationFolder, String fileName, Document doc) |
| Converts a given Document object to xml format file. More...
|
|
static void | zipFolder (String directoryToZipPath) throws IOException |
| Archives a folder into .zip compressed file. More...
|
|
static void | copy (File src, File dst) throws IOException |
| Copies the content from one file to another. More...
|
|
|
static void | copyFile (InputStream in, OutputStream out) throws IOException |
|
static void | getAllFiles (File dir, List< File > fileList) |
| Add all the files in a given folder into a list. More...
|
|
static void | writeZipFile (File directoryToZip, List< File > fileList) |
|
static void | addToZip (File directoryToZip, File file, ZipOutputStream zos) throws IOException |
|
Helper functions related to String manipulation.
Created by Abhishek on 23-05-2015.
static void org.buildmlearn.toolkit.utilities.FileUtils.addToZip |
( |
File |
directoryToZip, |
|
|
File |
file, |
|
|
ZipOutputStream |
zos |
|
) |
| throws IOException |
|
staticprivate |
static void org.buildmlearn.toolkit.utilities.FileUtils.copy |
( |
File |
src, |
|
|
File |
dst |
|
) |
| throws IOException |
|
static |
Copies the content from one file to another.
- Parameters
-
src | Source file |
dst | Destination file |
- Exceptions
-
IOException | Exception thrown in case of error |
static void org.buildmlearn.toolkit.utilities.FileUtils.copyAssets |
( |
Context |
context, |
|
|
String |
assetFileName, |
|
|
String |
destinationDirectory |
|
) |
| |
|
static |
Copies a file from assets folder to a folder on device memory.
- Parameters
-
context | Application context |
assetFileName | Name of the file stored in assets |
destinationDirectory | Destination folder for saving the file |
static void org.buildmlearn.toolkit.utilities.FileUtils.copyFile |
( |
InputStream |
in, |
|
|
OutputStream |
out |
|
) |
| throws IOException |
|
staticprivate |
static boolean org.buildmlearn.toolkit.utilities.FileUtils.equalContent |
( |
File |
file1, |
|
|
File |
file2 |
|
) |
| |
|
static |
static void org.buildmlearn.toolkit.utilities.FileUtils.getAllFiles |
( |
File |
dir, |
|
|
List< File > |
fileList |
|
) |
| |
|
staticprivate |
Add all the files in a given folder into a list.
- Parameters
-
dir | Source directory |
fileList | Referenced list. Files are added to this list |
static void org.buildmlearn.toolkit.utilities.FileUtils.saveXmlFile |
( |
String |
destinationFolder, |
|
|
String |
fileName, |
|
|
Document |
doc |
|
) |
| |
|
static |
Converts a given Document object to xml format file.
- Parameters
-
destinationFolder | Destination folder for saving the file |
fileName | Destination file name |
doc | Document object to be converted to xml formatted file |
- Returns
- Returns true if successfully converted
static void org.buildmlearn.toolkit.utilities.FileUtils.unZip |
( |
String |
zipFilePath, |
|
|
String |
destinationFolder |
|
) |
| throws IOException |
|
static |
Unzips a compressed file (.zip, .apk)
- Parameters
-
zipFilePath | Path of the source zip file |
destinationFolder | Destination folder for stroing the uncompresses files. |
- Exceptions
-
IOException | Exception thrown in case of some error. |
static void org.buildmlearn.toolkit.utilities.FileUtils.unZip |
( |
InputStream |
zipInputStream, |
|
|
String |
destinationFolder |
|
) |
| |
|
static |
Unzips a compressed file (.zip, .apk)
- Parameters
-
zipInputStream | InputStream of Zip file |
destinationFolder | Destination folder for stroing the uncompresses files. |
- Exceptions
-
IOException | Exception thrown in case of some error. |
static void org.buildmlearn.toolkit.utilities.FileUtils.writeZipFile |
( |
File |
directoryToZip, |
|
|
List< File > |
fileList |
|
) |
| |
|
staticprivate |
static void org.buildmlearn.toolkit.utilities.FileUtils.zipFolder |
( |
String |
directoryToZipPath | ) |
throws IOException |
|
static |
Archives a folder into .zip compressed file.
- Parameters
-
directoryToZipPath | Source folder to be converted. |
- Exceptions
-
final int org.buildmlearn.toolkit.utilities.FileUtils.BUFFER_SIZE = 2048 |
|
staticprivate |
The documentation for this class was generated from the following file:
- source-code/app/src/main/java/org/buildmlearn/toolkit/utilities/FileUtils.java