BuildmLearn-Toolkit-Android  2.0.0
The Android version of the BuildmLearn Toolkit. BuildmLearn Toolkit is an easy-to-use program that helps the users make mobile apps without any knowledge of application development.
Static Public Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
org.buildmlearn.toolkit.utilities.FileUtils Class Reference

Helper functions related to String manipulation. More...

Static Public Member Functions

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 Private Member Functions

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
 

Static Private Attributes

static final int BUFFER_SIZE = 2048
 

Detailed Description

Helper functions related to String manipulation.

Created by Abhishek on 23-05-2015.

Member Function Documentation

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
srcSource file
dstDestination file
Exceptions
IOExceptionException 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
contextApplication context
assetFileNameName of the file stored in assets
destinationDirectoryDestination 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
dirSource directory
fileListReferenced 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
destinationFolderDestination folder for saving the file
fileNameDestination file name
docDocument 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
zipFilePathPath of the source zip file
destinationFolderDestination folder for stroing the uncompresses files.
Exceptions
IOExceptionException 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
zipInputStreamInputStream of Zip file
destinationFolderDestination folder for stroing the uncompresses files.
Exceptions
IOExceptionException 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
directoryToZipPathSource folder to be converted.
Exceptions
IOException

Member Data Documentation

final int org.buildmlearn.toolkit.utilities.FileUtils.BUFFER_SIZE = 2048
staticprivate

The documentation for this class was generated from the following file: