@Test public void getAppXmlStream() throws IOException { savePlainApp(); InputStream stream = aar.getApplicationInputStream(APP_NAME); byte[] orig = ByteStreams.toByteArray(getClass().getResourceAsStream("app.xml")); byte[] loaded = ByteStreams.toByteArray(stream); assertArrayEquals("incorrect stream", orig, loaded); stream.close(); }
public synchronized InputStream getApplicationInputStream(String appName) { try { 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"); } }
ApplicationArchive extends AbstractStore<ApplicationEvent, ApplicationStoreDelegate> { public synchronized InputStream getApplicationInputStream(String appName) { try { 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"); } } }
ApplicationArchive extends AbstractStore<ApplicationEvent, ApplicationStoreDelegate> { public synchronized InputStream getApplicationInputStream(String appName) { try { 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"); } }  }
ApplicationArchive extends AbstractStore<ApplicationEvent, ApplicationStoreDelegate> { public synchronized InputStream getApplicationInputStream(String appName) { try { 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"); } }  String getRootPath(); Set<String> getApplicationNames(); long getUpdateTime(String appName); ApplicationDescription getApplicationDescription(String appName); synchronized ApplicationDescription saveApplication(InputStream stream); synchronized void purgeApplication(String appName); synchronized InputStream getApplicationInputStream(String appName); ApplicationRole getRole(String value); }
ApplicationArchive extends AbstractStore<ApplicationEvent, ApplicationStoreDelegate> { public synchronized InputStream getApplicationInputStream(String appName) { try { 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"); } }  String getRootPath(); Set<String> getApplicationNames(); long getUpdateTime(String appName); ApplicationDescription getApplicationDescription(String appName); synchronized ApplicationDescription saveApplication(InputStream stream); synchronized void purgeApplication(String appName); synchronized InputStream getApplicationInputStream(String appName); ApplicationRole getRole(String value);  }