@Test public void updateTypeInvalidatesOnDelete() { LocalChangeEvent event = new LocalChangeEvent(file, true, mtime, UPDATE); file.toFile().delete(); assertFalse(event.isValid()); }
@Override public boolean isValid() { try { long currentMtime = Files.getLastModifiedTime(getPath()).toMillis(); boolean valid = currentMtime == getMtime(); if (!valid) { LoggerFactory.getLogger(getClass()).debug("event invalid: mtime " + currentMtime + " != " + getMtime() + " on " + getPath()); } return valid; } catch (IOException e) { return type == DELETE; } }
LocalChangeEvent extends AbstractChangeEvent { @Override public boolean isValid() { try { long currentMtime = Files.getLastModifiedTime(getPath()).toMillis(); boolean valid = currentMtime == getMtime(); if (!valid) { LoggerFactory.getLogger(getClass()).debug("event invalid: mtime " + currentMtime + " != " + getMtime() + " on " + getPath()); } return valid; } catch (IOException e) { return type == DELETE; } } }
LocalChangeEvent extends AbstractChangeEvent { @Override public boolean isValid() { try { long currentMtime = Files.getLastModifiedTime(getPath()).toMillis(); boolean valid = currentMtime == getMtime(); if (!valid) { LoggerFactory.getLogger(getClass()).debug("event invalid: mtime " + currentMtime + " != " + getMtime() + " on " + getPath()); } return valid; } catch (IOException e) { return type == DELETE; } } LocalChangeEvent(Path path, ChangeEvent.TYPE type);  LocalChangeEvent(Path path, boolean isDir, Long mtime, ChangeEvent.TYPE type); }
LocalChangeEvent extends AbstractChangeEvent { @Override public boolean isValid() { try { long currentMtime = Files.getLastModifiedTime(getPath()).toMillis(); boolean valid = currentMtime == getMtime(); if (!valid) { LoggerFactory.getLogger(getClass()).debug("event invalid: mtime " + currentMtime + " != " + getMtime() + " on " + getPath()); } return valid; } catch (IOException e) { return type == DELETE; } } LocalChangeEvent(Path path, ChangeEvent.TYPE type);  LocalChangeEvent(Path path, boolean isDir, Long mtime, ChangeEvent.TYPE type); @Override boolean isValid(); @Override long getSize(); }
LocalChangeEvent extends AbstractChangeEvent { @Override public boolean isValid() { try { long currentMtime = Files.getLastModifiedTime(getPath()).toMillis(); boolean valid = currentMtime == getMtime(); if (!valid) { LoggerFactory.getLogger(getClass()).debug("event invalid: mtime " + currentMtime + " != " + getMtime() + " on " + getPath()); } return valid; } catch (IOException e) { return type == DELETE; } } LocalChangeEvent(Path path, ChangeEvent.TYPE type);  LocalChangeEvent(Path path, boolean isDir, Long mtime, ChangeEvent.TYPE type); @Override boolean isValid(); @Override long getSize();  }