// TODO(cgdecker): Investigate whether WatchServices should keep a reference to the actual
// directory when SecureDirectoryStream is supported rather than looking up the directory
// each time the WatchService polls
public ImmutableMap<Name, Long> snapshotModifiedTimes(JimfsPath path) throws IOException {
    ImmutableMap.Builder<Name, Long> modifiedTimes = ImmutableMap.builder();
    store.readLock().lock();
    try {
      Directory dir = (Directory) lookUp(path, Options.FOLLOW_LINKS).requireDirectory(path).file();
      // TODO(cgdecker): Investigate whether WatchServices should keep a reference to the actual
      // directory when SecureDirectoryStream is supported rather than looking up the directory
      // each time the WatchService polls
      for (DirectoryEntry entry : dir) {
        if (!entry.name().equals(Name.SELF) && !entry.name().equals(Name.PARENT)) {
          modifiedTimes.put(entry.name(), entry.file().getLastModifiedTime());
        }
      }
      return modifiedTimes.build();
    } finally {
      store.readLock().unlock();
    }
  }
try {
Directory dir = (Directory) lookUp(path, Options.FOLLOW_LINKS).requireDirectory(path).file();
// TODO(cgdecker): Investigate whether WatchServices should keep a reference to the actual
// directory when SecureDirectoryStream is supported rather than looking up the directory
// each time the WatchService polls
for (DirectoryEntry entry : dir) {
if (!entry.name().equals(Name.SELF) && !entry.name().equals(Name.PARENT)) {
public ImmutableMap<Name, Long> snapshotModifiedTimes(JimfsPath path) throws IOException {
ImmutableMap.Builder<Name, Long> modifiedTimes = ImmutableMap.builder();
store.readLock().lock();
try {
Directory dir = (Directory) lookUp(path, Options.FOLLOW_LINKS).requireDirectory(path).file();
// TODO(cgdecker): Investigate whether WatchServices should keep a reference to the actual
// directory when SecureDirectoryStream is supported rather than looking up the directory
// each time the WatchService polls
for (DirectoryEntry entry : dir) {
if (!entry.name().equals(Name.SELF) && !entry.name().equals(Name.PARENT)) {
modifiedTimes.put(entry.name(), entry.file().getLastModifiedTime());
}
}
return modifiedTimes.build();
} finally {
store.readLock().unlock();
}
}
public ImmutableMap<Name, Long> snapshotModifiedTimes(JimfsPath path) throws IOException {
ImmutableMap.Builder<Name, Long> modifiedTimes = ImmutableMap.builder();
store.readLock().lock();
try {
Directory dir = (Directory) lookUp(path, Options.FOLLOW_LINKS).requireDirectory(path).file();
// TODO(cgdecker): Investigate whether WatchServices should keep a reference to the actual
// directory when SecureDirectoryStream is supported rather than looking up the directory
// each time the WatchService polls
for (DirectoryEntry entry : dir) {
if (!entry.name().equals(Name.SELF) && !entry.name().equals(Name.PARENT)) {
modifiedTimes.put(entry.name(), entry.file().getLastModifiedTime());
}
}
return modifiedTimes.build();
} finally {
store.readLock().unlock();
}
}