Пример #1
0
 @Override
 public void setTimeStamp(@NotNull final VirtualFile file, final long modStamp)
     throws IOException {
   final int id = getFileId(file);
   FSRecords.setTimestamp(id, modStamp);
   getDelegate(file).setTimeStamp(file, modStamp);
 }
Пример #2
0
  private static void executeTouch(
      @NotNull VirtualFile file, boolean reloadContentFromDelegate, long newModificationStamp) {
    if (reloadContentFromDelegate) {
      setFlag(file, MUST_RELOAD_CONTENT, true);
    }

    final NewVirtualFileSystem delegate = getDelegate(file);
    final FileAttributes attributes = delegate.getAttributes(file);
    FSRecords.setLength(getFileId(file), attributes != null ? attributes.length : DEFAULT_LENGTH);
    FSRecords.setTimestamp(
        getFileId(file), attributes != null ? attributes.lastModified : DEFAULT_TIMESTAMP);

    ((VirtualFileSystemEntry) file).setModificationStamp(newModificationStamp);
  }