public static MProperties load(File f) { try { FileInputStream fis = new FileInputStream(f); MProperties out = load(fis); fis.close(); return out; } catch (IOException e) { return null; } // Properties p = new Properties(); // try { // if (f.exists() && f.isFile()) { // FileInputStream is = new FileInputStream(f); // p.load(is); // } // } catch (Throwable t) { // MLogUtil.log().d(f, t); // } // MProperties out = new MProperties(p); // return out; }
public static MProperties loadOrEmpty(File f) { MProperties out = load(f); if (out == null) out = new MProperties(); return out; }
@Override public IProperties getRenditionProperties(String rendition) { File contentFile = ((FdbCore)core).getContentFileFor(file, rendition); contentFile = new File(contentFile.getParent(), contentFile.getName() + ".meta"); if (contentFile == null || !contentFile.exists()) return null; return MProperties.load( contentFile ); }
@Override public void cleanupCache() { File f = new File("etc/de.mhus.cherry.reactive.model.ui.IEngineFactory.properties"); if (f.exists()) defaultProcessProperties = MProperties.load(f); synchronized (cache) { cache.cleanup(); } }
private MProperties loadConfiguration() { MProperties properties = MProperties.load(MApi.get().getSystemProperty(MConstants.PROP_TIMER_CONFIG_FILE, MConstants.DEFAULT_MHUS_TIMER_CONFIG_FILE)); // TODO configurable via mhu-config return properties; }
public void fillProperties(File file, MProperties p) { checkState(); File metaFile = getMetaFileFor(file); if (metaFile.exists() && metaFile.isFile()) { MProperties meta = MProperties.load(metaFile); p.putAll(meta); } p.setLong(CaoConst.MODIFIED, metaFile.lastModified()); }
public void fillProperties(File file, MProperties p) { checkState(); if (useMetaFile) { File metaFile = getMetaFileFor(file); if (metaFile.exists() && metaFile.isFile()) { MProperties meta = MProperties.load(metaFile); p.putAll(meta); } } p.setLong(CaoConst.MODIFIED, file.lastModified()); }
void indexFile(File f) throws IOException { File meta = getMetaFileFor(f); MProperties p = MProperties.load(meta); if (p == null) p = new MProperties(); String id = p.getString("_id", null); if (id == null) { id = UUID.randomUUID().toString(); p.setString("_id", id); p.save(meta); } rememberIndex(f,id); }
private void removeIds(File file) { File meta = ((FdbCore)core).getMetaFileFor(file); MProperties p = MProperties.load(meta); if (p == null) p = new MProperties(); p.remove("_id"); try { p.save(meta); } catch (IOException e) { log().e(file,e); } }