opt.: sftp home & back (#533)
This commit is contained in:
@@ -2,12 +2,14 @@ import 'package:fl_lib/fl_lib.dart';
|
||||
|
||||
class AbsolutePath {
|
||||
String _path;
|
||||
final _prePath = <String>[];
|
||||
|
||||
AbsolutePath(this._path);
|
||||
|
||||
String get path => _path;
|
||||
final List<String> _prePath;
|
||||
|
||||
AbsolutePath(this._path) : _prePath = ['/'];
|
||||
|
||||
void update(String newPath) {
|
||||
/// Update path, not set path
|
||||
set path(String newPath) {
|
||||
_prePath.add(_path);
|
||||
if (newPath == '..') {
|
||||
_path = _path.substring(0, _path.lastIndexOf('/'));
|
||||
@@ -16,10 +18,6 @@ class AbsolutePath {
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (newPath == '/') {
|
||||
_path = '/';
|
||||
return;
|
||||
}
|
||||
if (newPath.startsWith('/')) {
|
||||
_path = newPath;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user