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

Side by Side Diff: pkg/analyzer/lib/src/generated/java_io.dart

Issue 913513003: Handle exception while getting modification stamp (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
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/src/generated/source.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library java.io; 1 library java.io;
2 2
3 import "dart:io"; 3 import "dart:io";
4 4
5 import 'package:path/path.dart' as pathos; 5 import 'package:path/path.dart' as pathos;
6 6
7 import 'java_core.dart' show JavaIOException; 7 import 'java_core.dart' show JavaIOException;
8 8
9 class JavaFile { 9 class JavaFile {
10 static final String separator = Platform.pathSeparator; 10 static final String separator = Platform.pathSeparator;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 bool isDirectory() { 64 bool isDirectory() {
65 return _newDirectory().existsSync(); 65 return _newDirectory().existsSync();
66 } 66 }
67 bool isExecutable() { 67 bool isExecutable() {
68 return _newFile().statSync().mode & 0x111 != 0; 68 return _newFile().statSync().mode & 0x111 != 0;
69 } 69 }
70 bool isFile() { 70 bool isFile() {
71 return _newFile().existsSync(); 71 return _newFile().existsSync();
72 } 72 }
73 int lastModified() { 73 int lastModified() {
74 if (!_newFile().existsSync()) return 0; 74 try {
75 return _newFile().lastModifiedSync().millisecondsSinceEpoch; 75 return _newFile().lastModifiedSync().millisecondsSinceEpoch;
76 76 } catch (exception) {
77 return -1;
78 }
77 } 79 }
78 List<JavaFile> listFiles() { 80 List<JavaFile> listFiles() {
79 var files = <JavaFile>[]; 81 var files = <JavaFile>[];
80 var entities = _newDirectory().listSync(); 82 var entities = _newDirectory().listSync();
81 for (FileSystemEntity entity in entities) { 83 for (FileSystemEntity entity in entities) {
82 files.add(new JavaFile(entity.path)); 84 files.add(new JavaFile(entity.path));
83 } 85 }
84 return files; 86 return files;
85 } 87 }
86 String readAsStringSync() => _newFile().readAsStringSync(); 88 String readAsStringSync() => _newFile().readAsStringSync();
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 } 134 }
133 } 135 }
134 return null; 136 return null;
135 } 137 }
136 static String setProperty(String name, String value) { 138 static String setProperty(String name, String value) {
137 String oldValue = _properties[name]; 139 String oldValue = _properties[name];
138 _properties[name] = value; 140 _properties[name] = value;
139 return oldValue; 141 return oldValue;
140 } 142 }
141 } 143 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/src/generated/source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698