Search in sources :

Example 1 with ResourceFilter

use of net.sourceforge.processdash.tool.bridge.ResourceFilter in project processdash by dtuma.

the class BridgedWorkingDirectory method syncTimestampIsRecent.

private boolean syncTimestampIsRecent() {
    try {
        String timestamp = getMetadata(SYNC_TIMESTAMP);
        if (timestamp == null)
            return false;
        ResourceFilter filter = ResourceFilterFactory.getForRequest(Collections.singletonMap(ResourceFilterFactory.LAST_MOD_PARAM, timestamp));
        ResourceCollectionInfo changedFiles = new ResourceListing(client.localCollection, filter);
        return changedFiles.listResourceNames().isEmpty();
    } catch (Exception e) {
        return false;
    }
}
Also used : ResourceFilter(net.sourceforge.processdash.tool.bridge.ResourceFilter) ResourceCollectionInfo(net.sourceforge.processdash.tool.bridge.ResourceCollectionInfo) ResourceListing(net.sourceforge.processdash.tool.bridge.ResourceListing) LockFailureException(net.sourceforge.processdash.util.lock.LockFailureException) LockUncertainException(net.sourceforge.processdash.util.lock.LockUncertainException) OfflineLockLostException(net.sourceforge.processdash.util.lock.OfflineLockLostException) IOException(java.io.IOException) AlreadyLockedException(net.sourceforge.processdash.util.lock.AlreadyLockedException)

Aggregations

IOException (java.io.IOException)1 ResourceCollectionInfo (net.sourceforge.processdash.tool.bridge.ResourceCollectionInfo)1 ResourceFilter (net.sourceforge.processdash.tool.bridge.ResourceFilter)1 ResourceListing (net.sourceforge.processdash.tool.bridge.ResourceListing)1 AlreadyLockedException (net.sourceforge.processdash.util.lock.AlreadyLockedException)1 LockFailureException (net.sourceforge.processdash.util.lock.LockFailureException)1 LockUncertainException (net.sourceforge.processdash.util.lock.LockUncertainException)1 OfflineLockLostException (net.sourceforge.processdash.util.lock.OfflineLockLostException)1