blob: ce200d57db2f6a080155785a7d8691dd5d221aab [file] [log] [blame]
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:async';
import 'dart:convert';
import 'file_system_entity.dart';
import '../io.dart' as io;
/// A reference to a file on the file system.
abstract class File implements FileSystemEntity, io.File {
// Override method definitions to codify the return type covariance.
Future<File> create({bool recursive: false});
Future<File> rename(String newPath);
File renameSync(String newPath);
Future<File> copy(String newPath);
File copySync(String newPath);
File get absolute;
Future<File> writeAsBytes(List<int> bytes,
{io.FileMode mode: io.FileMode.WRITE, bool flush: false});
Future<File> writeAsString(String contents,
{io.FileMode mode: io.FileMode.WRITE,
Encoding encoding: UTF8,
bool flush: false});