本文整理汇总了Java中com.android.vending.expansion.zipfile.ZipResourceFile类的典型用法代码示例。如果您正苦于以下问题:Java ZipResourceFile类的具体用法?Java ZipResourceFile怎么用?Java ZipResourceFile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ZipResourceFile类属于com.android.vending.expansion.zipfile包,在下文中一共展示了ZipResourceFile类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: copyExpansion
import com.android.vending.expansion.zipfile.ZipResourceFile; //导入依赖的package包/类
private void copyExpansion() throws IOException, PackageManager.NameNotFoundException {
ZipResourceFile zipFile = APKExpansionSupport.getAPKExpansionZipFile(this, Constants.EXPANSION_MAIN_VERSION, 0);
if (zipFile == null) {
Log.e(TAG, "no expansion file. download chaindata from other nodes.");
copyExpansionComplete();
return;
}
Set<String> fileNames = zipFile.getFileNames();
int currentIndex = 1;
for (String fileName : fileNames) {
InputStream inputStream = zipFile.getInputStream(fileName);
copyFile(inputStream, fileName);
progressPublisher.onNext((currentIndex * 100) / fileNames.size());
currentIndex++;
}
File completeFile = new File(dataDir + File.separator + "complete");
completeFile.createNewFile();
copyExpansionComplete();
}
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:21,代码来源:LandingPageActivity.java
示例2: parseOXZ
import com.android.vending.expansion.zipfile.ZipResourceFile; //导入依赖的package包/类
private void parseOXZ(String fileName) throws IOException {
ZipResourceFile zip = new ZipResourceFile(fileName);
InputStream manifestStream = zip.getInputStream("manifest.plist");
if (manifestStream == null) {
throw new FileNotFoundException("Cannot read manifest file of " + fileName + ".");
}
NSDictionary manifest = PListParser.parseFile(manifestStream);
if (manifest.isEmpty()) {
throw new FileNotFoundException("Cannot parse manifest file of " + fileName + ".");
}
identifier = readRequiredString(manifest, "identifier", fileName);
name = readRequiredString(manifest, "title", fileName);
version = readRequiredString(manifest, "version", fileName);
category = readString(manifest, "category");
description = readString(manifest, "description");
author = readString(manifest, "author");
license = readString(manifest, "license");
}
开发者ID:CmdrStardust,项目名称:Alite,代码行数:19,代码来源:OXPParser.java
示例3: getFileInputStreamFromFiles
import com.android.vending.expansion.zipfile.ZipResourceFile; //导入依赖的package包/类
@Nullable
public static InputStream getFileInputStreamFromFiles(ArrayList<String> zipPaths, String filePath, Context context) {
try {
ZipResourceFile resourceFile = APKExpansionSupport.getResourceZipFile(zipPaths.toArray(new String[zipPaths.size()]));
if (resourceFile == null) {
return null;
}
// file path must be relative to the root of the resource file
InputStream resourceStream = resourceFile.getInputStream(filePath);
if (resourceStream == null) {
Timber.d("Could not find file " + filePath + " within resource file (main version " + Constants.MAIN_VERSION + ", patch version " + Constants.PATCH_VERSION + ")");
} else {
Timber.d("Found file " + filePath + " within resource file (main version " + Constants.MAIN_VERSION + ", patch version " + Constants.PATCH_VERSION + ")");
}
return resourceStream;
} catch (IOException ioe) {
Timber.e("Could not find file " + filePath + " within resource file (main version " + Constants.MAIN_VERSION + ", patch version " + Constants.PATCH_VERSION + ")");
return null;
}
}
开发者ID:StoryMaker,项目名称:storypath,代码行数:24,代码来源:ZipHelper.java
示例4: loadTempateIndex
import com.android.vending.expansion.zipfile.ZipResourceFile; //导入依赖的package包/类
public static HashMap<String, String> loadTempateIndex (Context context) {
HashMap<String, String> templateMap = new HashMap<String, String>();
ZipResourceFile zrf = ZipHelper.getResourceFile(context);
ArrayList<ZipResourceFile.ZipEntryRO> zipEntries = new ArrayList<ZipResourceFile.ZipEntryRO>(Arrays.asList(zrf.getAllEntries()));
for (ZipResourceFile.ZipEntryRO zipEntry : zipEntries) {
// Timber.d("GOT ITEM: " + zipEntry.mFileName);
templateMap.put(zipEntry.mFileName.substring(zipEntry.mFileName.lastIndexOf(File.separator) + 1), zipEntry.mFileName);
}
return templateMap;
}
开发者ID:StoryMaker,项目名称:storypath,代码行数:13,代码来源:IndexManager.java
示例5: getResourceFile
import com.android.vending.expansion.zipfile.ZipResourceFile; //导入依赖的package包/类
@Nullable
public static ZipResourceFile getResourceFile(Context context) {
try {
// resource file contains main file and patch file
ArrayList<String> paths = getExpansionPaths(context);
ZipResourceFile resourceFile = APKExpansionSupport.getResourceZipFile(paths.toArray(new String[paths.size()]));
return resourceFile;
} catch (IOException ioe) {
Timber.e("Could not open resource file (main version " + Constants.MAIN_VERSION + ", patch version " + Constants.PATCH_VERSION + ")");
return null;
}
}
开发者ID:StoryMaker,项目名称:storypath,代码行数:16,代码来源:ZipHelper.java
示例6: getThumbnailInputStreamForItem
import com.android.vending.expansion.zipfile.ZipResourceFile; //导入依赖的package包/类
@Nullable
public static InputStream getThumbnailInputStreamForItem(@NonNull ExpansionIndexItem item, @NonNull Context context) {
ZipResourceFile resourceFile = null;
try {
resourceFile = APKExpansionSupport.getResourceZipFile(new String[]{IndexManager.buildFileAbsolutePath(item, Constants.MAIN, context)});
return resourceFile.getInputStream(item.getThumbnailPath());
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
开发者ID:StoryMaker,项目名称:storypath,代码行数:13,代码来源:ZipHelper.java
示例7: getAssetsPathInputStream
import com.android.vending.expansion.zipfile.ZipResourceFile; //导入依赖的package包/类
public static InputStream getAssetsPathInputStream(Context context, String internalPath) throws IOException {
// Get a ZipResourceFile representing a merger of both the main and patch files
ZipResourceFile expansionFile = APKExpansionSupport.getAPKExpansionZipFile(context, MAIN_VERSION, PATCH_VERSION);
internalPath = "assets/" + internalPath;
// Get an input stream for a known file inside the expansion file ZIPs
return getAssetInputStream(context, internalPath);
}
开发者ID:museumsvictoria,项目名称:mv-fieldguide-android,代码行数:10,代码来源:Utilities.java
示例8: getAssetsFileDescriptor
import com.android.vending.expansion.zipfile.ZipResourceFile; //导入依赖的package包/类
public static AssetFileDescriptor getAssetsFileDescriptor(Context context, String internalPath) throws IOException {
// Get a ZipResourceFile representing a merger of both the main and patch files
ZipResourceFile expansionFile = APKExpansionSupport.getAPKExpansionZipFile(context, MAIN_VERSION, PATCH_VERSION);
internalPath = "assets/" + internalPath;
// Get an input stream for a known file inside the expansion file ZIPs
return expansionFile.getAssetFileDescriptor(internalPath);
}
开发者ID:museumsvictoria,项目名称:mv-fieldguide-android,代码行数:10,代码来源:Utilities.java
示例9: getAssetsPathInputStream
import com.android.vending.expansion.zipfile.ZipResourceFile; //导入依赖的package包/类
public static InputStream getAssetsPathInputStream(Context context,
String internalPath) throws IOException {
// Get a ZipResourceFile representing a merger of both the main and
// patch files
ZipResourceFile expansionFile = APKExpansionSupport
.getAPKExpansionZipFile(context, MAIN_VERSION, PATCH_VERSION);
internalPath = "assets/" + internalPath;
// Get an input stream for a known file inside the expansion file ZIPs
return getAssetInputStream(context, internalPath);
}
开发者ID:museumsvictoria,项目名称:bunurong-fieldguide-Android,代码行数:13,代码来源:Utilities.java
示例10: getAssetsFileDescriptor
import com.android.vending.expansion.zipfile.ZipResourceFile; //导入依赖的package包/类
public static AssetFileDescriptor getAssetsFileDescriptor(Context context,
String internalPath) throws IOException {
// Get a ZipResourceFile representing a merger of both the main and
// patch files
ZipResourceFile expansionFile = APKExpansionSupport
.getAPKExpansionZipFile(context, MAIN_VERSION, PATCH_VERSION);
internalPath = "assets/" + internalPath;
// Get an input stream for a known file inside the expansion file ZIPs
return expansionFile.getAssetFileDescriptor(internalPath);
}
开发者ID:museumsvictoria,项目名称:bunurong-fieldguide-Android,代码行数:13,代码来源:Utilities.java
示例11: getAssetsZipResourceFile
import com.android.vending.expansion.zipfile.ZipResourceFile; //导入依赖的package包/类
public static ZipResourceFile getAssetsZipResourceFile(Context context)
throws IOException {
// Get a ZipResourceFile representing a merger of both the main and
// patch files
ZipResourceFile expansionFile = APKExpansionSupport
.getAPKExpansionZipFile(context, MAIN_VERSION, PATCH_VERSION);
return expansionFile;
}
开发者ID:museumsvictoria,项目名称:bunurong-fieldguide-Android,代码行数:9,代码来源:Utilities.java
示例12: BaseImageDownloaderImpl
import com.android.vending.expansion.zipfile.ZipResourceFile; //导入依赖的package包/类
public BaseImageDownloaderImpl(Context context, ZipResourceFile apkExpansionZipFile) {
super(context);
this.mApkExpansionZipFile = apkExpansionZipFile;
}
开发者ID:carlosefonseca,项目名称:CEFCommon,代码行数:5,代码来源:BaseImageDownloaderImpl.java
示例13: getAssetsZipResourceFile
import com.android.vending.expansion.zipfile.ZipResourceFile; //导入依赖的package包/类
public static ZipResourceFile getAssetsZipResourceFile(Context context) throws IOException {
// Get a ZipResourceFile representing a merger of both the main and patch files
ZipResourceFile expansionFile = APKExpansionSupport.getAPKExpansionZipFile(context, MAIN_VERSION, PATCH_VERSION);
return expansionFile;
}
开发者ID:museumsvictoria,项目名称:mv-fieldguide-android,代码行数:6,代码来源:Utilities.java
注:本文中的com.android.vending.expansion.zipfile.ZipResourceFile类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论