Converting builtin applications to be delivered in a self-contained manner via OAR files.
Change-Id: I5b7c6939aacc263248868fac2e0f69124c5f3609
diff --git a/core/common/src/main/java/org/onosproject/common/app/ApplicationArchive.java b/core/common/src/main/java/org/onosproject/common/app/ApplicationArchive.java
index 117195f..f8359fd 100644
--- a/core/common/src/main/java/org/onosproject/common/app/ApplicationArchive.java
+++ b/core/common/src/main/java/org/onosproject/common/app/ApplicationArchive.java
@@ -58,6 +58,8 @@
public class ApplicationArchive
extends AbstractStore<ApplicationEvent, ApplicationStoreDelegate> {
+ private static Logger log = LoggerFactory.getLogger(ApplicationArchive.class);
+
// Magic strings to search for at the beginning of the archive stream
private static final String XML_MAGIC = "<?xml ";
@@ -72,7 +74,7 @@
private static final String FEATURES = "[@features]";
private static final String DESCRIPTION = "description";
- private static Logger log = LoggerFactory.getLogger(ApplicationArchive.class);
+ private static final String OAR = ".oar";
private static final String APP_XML = "app.xml";
private static final String M2_PREFIX = "m2";
@@ -222,7 +224,7 @@
*/
public synchronized InputStream getApplicationInputStream(String appName) {
try {
- File appFile = appFile(appName, appName + ".zip");
+ File appFile = appFile(appName, appName + OAR);
return new FileInputStream(appFile.exists() ? appFile : appFile(appName, APP_XML));
} catch (FileNotFoundException e) {
throw new ApplicationException("Application " + appName + " not found");
@@ -304,7 +306,7 @@
// Saves the specified ZIP stream into a file under app-specific directory.
private void saveApplication(InputStream stream, ApplicationDescription desc)
throws IOException {
- Files.write(toByteArray(stream), appFile(desc.name(), desc.name() + ".zip"));
+ Files.write(toByteArray(stream), appFile(desc.name(), desc.name() + OAR));
}
// Installs application artifacts into M2 repository.