/** * Gets a data file. * @param filename the file name. * @return the File object * @see org.osgi.framework.BundleContext#getDataFile(java.lang.String) */ public File getDataFile(String filename) { return m_bundleContext.getDataFile(filename); }
/** * Gets a data file. * @param filename the File name. * @return the File object * @see org.osgi.framework.BundleContext#getDataFile(java.lang.String) */ public File getDataFile(String filename) { return m_global.getDataFile(filename); }
/** * Get a data file. * @param filename : File name. * @return the File object * @see org.osgi.framework.BundleContext#getDataFile(java.lang.String) */ public File getDataFile(String filename) { return m_global.getDataFile(filename); }
/** * Get a data file. * @param filename : File name. * @return the File object * @see org.osgi.framework.BundleContext#getDataFile(java.lang.String) */ public File getDataFile(String filename) { return m_global.getDataFile(filename); }
@Override public File getDataFile(String fileName) { return ourBundleContext.getDataFile(fileName); }
private File getPropertiesFile() { try { return bundleContext.getDataFile("FeatureDeploymentListener.cfg"); } catch (Exception e){ logger.debug("Unable to get FeatureDeploymentListener.cfg", e); return null; } }
@Override protected OutputStream getOutputStream() throws IOException { File file = bundleContext.getDataFile(STATE_FILE); return new FileOutputStream(file); } };
private File getRepositoryFile( final BundleContext context ) throws IOException { File dataArea = context.getDataFile( "" ); if ( dataArea == null ) { throw new IOException( "No peristent storage supported..." ); } return new File( dataArea, "configs.repo" ); }
@Override protected InputStream getInputStream() throws IOException { File file = bundleContext.getDataFile(STATE_FILE); if (file.exists()) { return new FileInputStream(file); } else { return null; } }
private File getStoreDir() { String storeDirName = bc.getProperty(STORE_DIR_PROP); File storeDir = null; if (storeDirName == null || "".equals(storeDirName)) { storeDir = bc.getDataFile(DEFAULT_STORE_DIR); } else { storeDir = new File(storeDirName); } return storeDir; }
protected void activate(final ComponentContext componentContext) { weight = (Integer) componentContext.getProperties().get("weight"); dataFile = componentContext.getBundleContext(). getDataFile("data"); }
private static Properties loadProperties(BundleContext context) { Properties props = new Properties(); try { props.load(new FileInputStream(context.getDataFile(DATA_FILE_NAME))); } catch (FileNotFoundException e) { LoggerFactory.getLogger(BundleContextHistoryManager.class).warn("BundleContextHistoryManager data file does not exist yet"); } catch (IOException e) { LoggerFactory.getLogger(BundleContextHistoryManager.class).warn("IOException when reading BundleContextHistoryManager data file", e); } return props; }
private static void storeProperties(BundleContext context, Properties props) { try { props.store(new FileOutputStream(context.getDataFile(DATA_FILE_NAME)), BundleContextHistoryManager.class.getName() + " History Data"); } catch (FileNotFoundException e) { LoggerFactory.getLogger(BundleContextHistoryManager.class).warn("BundleContextHistoryManager data file does not exist"); } catch (IOException e) { LoggerFactory.getLogger(BundleContextHistoryManager.class).warn("IOException when writing to BundleContextHistoryManager data file", e); } } }
@Override public void start(BundleContext context) throws Exception { this.context = context; resolver = new StoredWiringResolver(context.getDataFile(WIRING_PATH).toPath()); context.addBundleListener(this); }
@Override public String getDataFile(long bundleId, String filename) throws IOException { BundleContext context = assertBundleContext(bundleId); File dataFile = context.getDataFile(filename); String result = dataFile != null ? dataFile.getCanonicalPath() : null; if (log.isTraceEnabled()) log.trace("getDataFile [bundleId=" + bundleId + ",filename=" + filename + "] => " + result); return result; }
public static URI getLocalRepositoryLocation(URI location) { BundleContext context = Activator.getContext(); String stateDirName = Integer.toString(location.toString().hashCode()); File bundleData = context.getDataFile(null); File stateDir = new File(bundleData, stateDirName); return stateDir.toURI(); }
public static URI getLocalRepositoryLocation(URI location) { BundleContext context = Activator.getContext(); String stateDirName = Integer.toString(location.toString().hashCode()); File bundleData = context.getDataFile(null); return new File(bundleData, stateDirName).toURI(); }
private File getRootDir() { if (this.rootDir == null && this.bundle.getBundleContext() != null) this.rootDir = this.bundle.getBundleContext().getDataFile("bpelData/" + getDUName()); return this.rootDir; }
public static URI getDefaultRepositoryLocation(Object object, String repositoryName) { PackageAdmin packageAdmin = (PackageAdmin) ServiceHelper.getService(context, PackageAdmin.class.getName()); Bundle bundle = packageAdmin.getBundle(object.getClass()); BundleContext context = bundle.getBundleContext(); File base = context.getDataFile(""); //$NON-NLS-1$ File result = new File(base, "listener_" + repositoryName.hashCode()); //$NON-NLS-1$ result.mkdirs(); return result.toURI(); } }
public void start(BundleContext context) throws Exception { m_store = new RoleRepositoryFileStore(context.getDataFile("")); m_store.start(); String[] interfaces = { RoleRepositoryStore.class.getName(), UserAdminListener.class.getName(), ManagedService.class.getName() }; Properties props = new Properties(); props.put(Constants.SERVICE_PID, RoleRepositoryFileStore.PID); context.registerService(interfaces, m_store, props); }