All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.plantuml.file.FileWatcher Maven / Gradle / Ivy

There is a newer version: 1.2024.8
Show newest version
// 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;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy