Remove deprecated `dart:io` constant uses. (#30)
diff --git a/lib/src/static_handler.dart b/lib/src/static_handler.dart
index ed96c82..afd42c8 100644
--- a/lib/src/static_handler.dart
+++ b/lib/src/static_handler.dart
@@ -70,9 +70,9 @@
File file;
- if (entityType == FileSystemEntityType.FILE) {
+ if (entityType == FileSystemEntityType.file) {
file = new File(fsPath);
- } else if (entityType == FileSystemEntityType.DIRECTORY) {
+ } else if (entityType == FileSystemEntityType.directory) {
file = _tryDefaultFile(fsPath, defaultDocument);
if (file == null && listDirectories) {
var uri = request.requestedUri;
@@ -97,7 +97,7 @@
// when serving the default document for a directory, if the requested
// path doesn't end with '/', redirect to the path with a trailing '/'
var uri = request.requestedUri;
- if (entityType == FileSystemEntityType.DIRECTORY &&
+ if (entityType == FileSystemEntityType.directory &&
!uri.path.endsWith('/')) {
return _redirectToAddTrailingSlash(uri);
}
diff --git a/pubspec.yaml b/pubspec.yaml
index 59efc1f..8a8ec3b 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -4,7 +4,7 @@
description: Static file server support for Shelf
homepage: https://github.com/dart-lang/shelf_static
environment:
- sdk: '>=2.0.0-dev.17.0 <2.0.0'
+ sdk: '>=2.0.0-dev.55.0 <2.0.0'
dependencies:
convert: '>=1.0.0 <3.0.0'
http_parser: '>=0.0.2+2 <4.0.0'