isLcpProtected method

  1. @override
Future<bool> isLcpProtected(
  1. FileSystemEntity file
)
override

Returns if the publication is protected by LCP.

Implementation

@override
Future<bool> isLcpProtected(FileSystemEntity file) async {
  try {
    return (await LicenseContainer.createLicenseContainer(file.path))
        .read()
        .then((data) => true)
        .onError((error, stackTrace) => false);
  } on Exception catch (e, stacktrace) {
    Fimber.d("createLicenseContainer ERROR", ex: e, stacktrace: stacktrace);
    return false;
  }
}