Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: pkg/analyzer/lib/file_system/physical_file_system.dart

Issue 940313003: Add File.modificationStamp accessor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library physical_file_system; 5 library physical_file_system;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io' as io; 8 import 'dart:io' as io;
9 9
10 import 'package:analyzer/src/generated/java_io.dart'; 10 import 'package:analyzer/src/generated/java_io.dart';
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 71 }
72 72
73 73
74 /** 74 /**
75 * A `dart:io` based implementation of [File]. 75 * A `dart:io` based implementation of [File].
76 */ 76 */
77 class _PhysicalFile extends _PhysicalResource implements File { 77 class _PhysicalFile extends _PhysicalResource implements File {
78 _PhysicalFile(io.File file) : super(file); 78 _PhysicalFile(io.File file) : super(file);
79 79
80 @override 80 @override
81 int get modificationStamp {
82 try {
83 io.File file = _entry as io.File;
84 return file.lastModifiedSync().millisecondsSinceEpoch;
85 } on io.FileSystemException catch (exception) {
86 throw new FileSystemException(path, exception.message);
87 }
88 }
89
90 @override
81 Source createSource([Uri uri]) { 91 Source createSource([Uri uri]) {
82 io.File file = _entry as io.File; 92 io.File file = _entry as io.File;
83 JavaFile javaFile = new JavaFile(file.absolute.path); 93 JavaFile javaFile = new JavaFile(file.absolute.path);
84 if (uri == null) { 94 if (uri == null) {
85 uri = javaFile.toURI(); 95 uri = javaFile.toURI();
86 } 96 }
87 return new FileBasedSource.con2(uri, javaFile); 97 return new FileBasedSource.con2(uri, javaFile);
88 } 98 }
89 99
90 @override 100 @override
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 bool operator ==(other) { 189 bool operator ==(other) {
180 if (runtimeType != other.runtimeType) { 190 if (runtimeType != other.runtimeType) {
181 return false; 191 return false;
182 } 192 }
183 return path == other.path; 193 return path == other.path;
184 } 194 }
185 195
186 @override 196 @override
187 String toString() => path; 197 String toString() => path;
188 } 198 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698