| OLD | NEW |
| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 @override | 47 @override |
| 48 Folder getStateLocation(String pluginId) { | 48 Folder getStateLocation(String pluginId) { |
| 49 String home; | 49 String home; |
| 50 if (io.Platform.isWindows) { | 50 if (io.Platform.isWindows) { |
| 51 home = io.Platform.environment['LOCALAPPDATA']; | 51 home = io.Platform.environment['LOCALAPPDATA']; |
| 52 } else { | 52 } else { |
| 53 home = io.Platform.environment['HOME']; | 53 home = io.Platform.environment['HOME']; |
| 54 } | 54 } |
| 55 if (home != null && io.FileSystemEntity.isDirectorySync(home)) { | 55 if (home != null && io.FileSystemEntity.isDirectorySync(home)) { |
| 56 io.Directory directory = new io.Directory(join(home, SERVER_DIR, pluginId)
); | 56 io.Directory directory = |
| 57 new io.Directory(join(home, SERVER_DIR, pluginId)); |
| 57 directory.createSync(recursive: true); | 58 directory.createSync(recursive: true); |
| 58 return new _PhysicalFolder(directory); | 59 return new _PhysicalFolder(directory); |
| 59 } | 60 } |
| 60 return null; | 61 return null; |
| 61 } | 62 } |
| 62 } | 63 } |
| 63 | 64 |
| 64 | 65 |
| 65 /** | 66 /** |
| 66 * A `dart:io` based implementation of [File]. | 67 * A `dart:io` based implementation of [File]. |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 bool operator ==(other) { | 171 bool operator ==(other) { |
| 171 if (runtimeType != other.runtimeType) { | 172 if (runtimeType != other.runtimeType) { |
| 172 return false; | 173 return false; |
| 173 } | 174 } |
| 174 return path == other.path; | 175 return path == other.path; |
| 175 } | 176 } |
| 176 | 177 |
| 177 @override | 178 @override |
| 178 String toString() => path; | 179 String toString() => path; |
| 179 } | 180 } |
| OLD | NEW |