public Long call() { Long id = scripts.findInDb(scriptPath, true); if (id == null) { return -1L; } else { return id; } }
@Transactional(readOnly = false) public Object doWork(Session session, ServiceFactory sf) { OriginalFile ofile = load(id, session, getSqlAction(), true); return update(session, repoFile, getSqlAction(), sf, ofile); } });
/** * Checks if */ public void modificationCheck() { loadAll(true); }
@Transactional(readOnly = false) public Object doWork(Session session, ServiceFactory sf) { return addOrReplace(session, getSqlAction(), sf, repoFile, old); } });
@Transactional(readOnly = true) public Object doWork(Session session, ServiceFactory sf) { return load(id, session, getSqlAction(), check); } });
/** * Find an "omero.launcher..." property string for the given mimetype or * return "" if none is found. */ public String getLauncher(String mimetype) { Map.Entry<String, ScriptFileType> entry = findByMimetype(mimetype); if (entry == null) { log.warn("No mimetype equals to {}", mimetype); return ""; } return entry.getValue().getLauncher(); }
/** * Find an "omero.process..." property string for the given mimetype or * return "" if none is found. */ public String getProcess(String mimetype) { Map.Entry<String, ScriptFileType> entry = findByMimetype(mimetype); if (entry == null) { log.warn("No mimetype equals to {}", mimetype); return ""; } return entry.getValue().getProcess(); }
public List<OriginalFile> loadAll(final boolean modificationCheck, final String mimetype, final Principal pp) { return loadAllScripts(modificationCheck, mimetype, pp); }
@Override public String generateRepoUuid() { return this.helper.getUuid(); }
public ChecksumAlgorithm hasher() { return fs.hasher(); }
public long length() { return fs.length(); }
public String hash() { return fs.hash(); }
@Transactional(readOnly = true) public Object doWork(SqlAction sql) { return countInDb(sql); } });
/** * Assumes that path is relative under root, and constructs a new {@link File} * and calls {@link #RepoFile(File, File)} */ public RepoFile(File root, String path) { this(root, new File(root, norm(path))); }
/** * Walks all files in the repository (via {@link #iterate()} and adds them * if not found in the database. * * If modificationCheck is true, then a change in the hash for a file in * the repository will cause the old file to be removed from the repository * <pre>(uuid == null)</pre> and a new file created in its place. * * @param modificationCheck * @return See above. */ public List<OriginalFile> loadAll(final boolean modificationCheck) { return loadAll(modificationCheck, null); }
/** * Walks all files in the repository (via {@link #iterate()} and adds them * if not found in the database. * * If modificationCheck is true, then a change in the hash for a file in * the repository will cause the old file to be removed from the repository * <pre>(uuid == null)</pre> and a new file created in its place. * * @param modificationCheck * @param mimetype the mimetype of the scripts or <code>null</code>. * @return See above. */ public List<OriginalFile> loadAll(final boolean modificationCheck, final String mimetype) { return loadAllScripts(modificationCheck, mimetype, p); }
public Object call() throws Exception { List<OriginalFile> files = scripts.loadAll(true, mimetype); IceMapper mapper = new IceMapper(); return mapper.map(files); } });
public Object call() throws Exception { List<OriginalFile> files = scripts.loadAll(true); // FIXME IceMapper mapper = new IceMapper(); return mapper.map(files); } });