private final ArrayList<Value> mZipList = new ArrayList<Value>();
private final ArrayList<Value> mFileList = new ArrayList<Value>();
private final ArrayList<Value> mSourceList = new ArrayList<Value>();
- private final ArrayList<Value> mJarList = new ArrayList<Value>();
+ private final ArrayList<Value> mJarfolderList = new ArrayList<Value>();
+ private final ArrayList<Value> mJarfileList = new ArrayList<Value>();
private final ArrayList<Value> mNativeList = new ArrayList<Value>();
private final ArrayList<FileInputStream> mZipArchives = new ArrayList<FileInputStream>();
*/
public Object createJarfolder() {
Value file = new Value();
- mJarList.add(file);
+ mJarfolderList.add(file);
+ return file;
+ }
+
+ /**
+ * Returns an object representing a nested <var>jarfile</var> element.
+ */
+ public Object createJarfile() {
+ Value file = new Value();
+ mJarfileList.add(file);
return file;
}
}
// now go through the list of jar folders.
- for (Value v : mJarList) {
+ for (Value v : mJarfolderList) {
ApkBuilderImpl.processJarFolder(v.mPath, mResourcesJars);
}
+ // now go through the list of jar files.
+ for (Value v : mJarfileList) {
+ ApkBuilderImpl.processJarFile(v.mPath, mResourcesJars);
+ }
+
// now the native lib folder.
for (Value v : mNativeList) {
String parameter = v.mPath;
for (String file : files) {
String path = f.getAbsolutePath() + File.separator + file;
- FileInputStream input = new FileInputStream(path);
- resourcesJars.add(input);
+ processJarFile(parameter, resourcesJars);
}
} else {
- FileInputStream input = new FileInputStream(parameter);
- resourcesJars.add(input);
+ processJarFile(parameter, resourcesJars);
}
}
+ public static void processJarFile(String jarfilePath, Collection<FileInputStream> resourcesJars)
+ throws FileNotFoundException {
+ FileInputStream input = new FileInputStream(jarfilePath);
+ resourcesJars.add(input);
+ }
/**
* Processes a {@link File} that could be a {@link ApkFile}, or a folder containing