Skip to content
Snippets Groups Projects
Commit 01546820 authored by ribeaudc's avatar ribeaudc
Browse files

[DMV-12] add: - 'mayHandle' to 'IStoreHandler'.

- 'FileScannedStore' (extracted from 'IncomingProcessor').
change: - More property keys moved to 'PropertyNames'.

SVN: 6060
parent 392e37c0
No related branches found
No related tags found
No related merge requests found
......@@ -278,7 +278,10 @@ public final class DirectoryScanningTimerTask extends TimerTask
}
try
{
handler.handle(item);
if (handler.mayHandle(item))
{
handler.handle(item);
}
} finally
{
// If the item still exists, we assume that it has not been handled. So it should be
......
......@@ -25,4 +25,6 @@ package ch.systemsx.cisd.common.utilities;
public interface IStoreHandler
{
void handle(StoreItem item);
boolean mayHandle(StoreItem item);
}
......@@ -40,17 +40,23 @@ public class PathHandlerAdapter implements IStoreHandler
return new PathHandlerAdapter(handler, directory);
}
private final File asFile(final StoreItem item)
{
return StoreItem.asFile(directory, item);
}
//
// IStoreHandler
//
public void handle(final StoreItem item)
public final boolean mayHandle(final StoreItem item)
{
return pathHandler.mayHandle(asFile(item));
}
public final void handle(final StoreItem item)
{
final File path = StoreItem.asFile(directory, item);
if (pathHandler.mayHandle(path))
{
pathHandler.handle(path);
}
pathHandler.handle(asFile(item));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment