Back to project page AndroidDBManageLibrary.
The source code is released under:
Apache License
If you think the Android project AndroidDBManageLibrary listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.bitsatom.dbmanage.parser; //w ww . j av a 2 s . c om import java.io.IOException; import android.content.res.AssetManager; import android.util.Log; import com.bitsatom.dbmanage.android.DBManageException; import com.example.dbmanage.data.VersionMetaStructure; public class DBAssetParser { public static final String DB_ASSET_FOLDER = "db"; private Object lock = new Object(); public VersionMetaStructure parse(AssetManager assetManager) throws DBManageException { return parse(DB_ASSET_FOLDER, assetManager); } public VersionMetaStructure parse(String baseDBAssetFolder, AssetManager assetManager) throws DBManageException { VersionMetaStructure versions = new VersionMetaStructure(baseDBAssetFolder); try { synchronized (lock) { String[] assetList = assetManager.list(baseDBAssetFolder); for (String strVersion : assetList) { Log.d(DBAssetParser.class.toString(), "Version : " + strVersion); versions.addVersion(strVersion); } } } catch (IOException e) { throw new DBManageException("Error getting assets under '" + baseDBAssetFolder + "'"); } catch (NumberFormatException e) { throw new DBManageException("Invalid version number"); } return versions; } }