URL createSnapshot() throws MalformedURLException { flush(); final Requisition pending = getPendingForeignSourceRepository().getRequisition(getForeignSource()); final Requisition deployed = getDeployedForeignSourceRepository().getRequisition(getForeignSource()); final URL activeUrl = pending == null || (deployed != null && deployed.getDateStamp().compare(pending.getDateStamp()) > -1) ? getDeployedForeignSourceRepository().getRequisitionURL(getForeignSource()) : RequisitionFileUtils.createSnapshot( getPendingForeignSourceRepository(), getForeignSource(), pending.getDate()) .toURI() .toURL(); return activeUrl; }