public String read(String path) throws IOException { final RepoFile repo = new RepoFile(dir, path); return FileUtils.readFileToString(repo.file()); }
public Long findInDb(final String path, final boolean scriptsOnly) { RepoFile repoFile = new RepoFile(dir, path); return findInDb(repoFile, scriptsOnly); }
public RepoFile write(String path, String text) throws IOException { RepoFile repo = new RepoFile(dir, path); return write(repo, text); }
@SuppressWarnings("unchecked") public LutProviderImpl( ScriptRepoHelper scriptRepoHelper, ScriptFileType lutType) { File root = new File(scriptRepoHelper.getScriptDir()); Iterator<File> scripts = FileUtils.iterateFiles( root, lutType.getFileFilter(), TrueFileFilter.TRUE); while (scripts.hasNext()) { RepoFile script = new RepoFile(root, scripts.next()); String basename = script.basename(); try { lutReaders.put( basename, LutReaderFactory.read(script.file())); log.debug("Successfully added LUT '{}'", basename); } catch (Exception e) { log.warn("Cannot read lookup table: '{}'", script.fullname(), e); } } log.info("Successfully added {} LUTs", lutReaders.size()); }
file = new RepoFile(dir, f); Long id = findInDb(sqlAction, file, false); // non-scripts count String hash = null;