Skip to content

Commit

Permalink
Readd path to entity
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Aug 15, 2024
1 parent 887fb98 commit 5215af1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/lw_file_system_api/lib/src/entity.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,25 @@ sealed class FileSystemEntity<T> {

FileSystemEntity(this.location);

String get fileName => location.fileName;
String get path => location.path;

String get remote => location.remote;

bool get isEmpty => location.isEmpty;

bool get isRemote => location.isRemote;

bool get isLocal => location.isLocal;

String get identifier => location.identifier;

String get fileExtension => location.fileExtension;

String get fileName => location.fileName;

String get fileNameWithoutExtension => location.fileNameWithoutExtension;

String get parent => location.parent;

String get pathWithoutLeadingSlash => location.pathWithoutLeadingSlash;
}

class FileSystemFile<T> extends FileSystemEntity<T> {
Expand Down
2 changes: 2 additions & 0 deletions packages/lw_file_system_api/lib/src/location.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class AssetLocation with AssetLocationMappable {

bool get isRemote => remote.isNotEmpty;

bool get isLocal => !isRemote;

String get identifier => isRemote ? '$path@$remote' : path;

String get fileExtension => p.extension(path);
Expand Down

0 comments on commit 5215af1

Please sign in to comment.