net.sourceforge.plantuml.file.FileWatcher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plantuml-mit Show documentation
Show all versions of plantuml-mit Show documentation
PlantUML is a component that allows to quickly write diagrams from text.
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.file;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
public class FileWatcher {
// ::remove file when __CORE__
private final Map modified2 = new HashMap();
public FileWatcher(Set files) {
if (files.size() == 0)
throw new IllegalArgumentException();
for (File f : files)
modified2.put(f, f.lastModified());
}
@Override
public String toString() {
return modified2.toString();
}
public boolean hasChanged() {
for (Map.Entry ent : modified2.entrySet()) {
final long nowModified = ent.getKey().lastModified();
if (ent.getValue().longValue() != nowModified)
return true;
}
return false;
}
}