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 ...@@ -278,7 +278,10 @@ public final class DirectoryScanningTimerTask extends TimerTask
} }
try try
{ {
handler.handle(item); if (handler.mayHandle(item))
{
handler.handle(item);
}
} finally } finally
{ {
// If the item still exists, we assume that it has not been handled. So it should be // 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; ...@@ -25,4 +25,6 @@ package ch.systemsx.cisd.common.utilities;
public interface IStoreHandler public interface IStoreHandler
{ {
void handle(StoreItem item); void handle(StoreItem item);
boolean mayHandle(StoreItem item);
} }
...@@ -40,17 +40,23 @@ public class PathHandlerAdapter implements IStoreHandler ...@@ -40,17 +40,23 @@ public class PathHandlerAdapter implements IStoreHandler
return new PathHandlerAdapter(handler, directory); return new PathHandlerAdapter(handler, directory);
} }
private final File asFile(final StoreItem item)
{
return StoreItem.asFile(directory, item);
}
// //
// IStoreHandler // 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); pathHandler.handle(asFile(item));
if (pathHandler.mayHandle(path))
{
pathHandler.handle(path);
}
} }
} }
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