Skip to content

Commit 7baf99c

Browse files
committed
refactor(core): 🐛 allow empty files and directories within a ZIP file
1 parent d165b58 commit 7baf99c

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

rocrate_validator/rocrate.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,7 @@ def is_available(self) -> bool:
195195
logger.debug("Skipping the check for the presence of the Data Entity '%s' within the RO-Crate "
196196
"as it is the root of a ZIP archive", self.id)
197197
return True
198-
entry = self.ro_crate.get_entry(str(self.id))
199-
if not entry:
200-
return False
201-
if entry.is_dir():
202-
return True
203-
# If the entry is a file, check if it exists and has a size greater than 0
204-
return self.ro_crate.get_file_size(Path(self.id)) > 0
198+
return self.ro_crate.get_entry(str(self.id)) is not None
205199

206200
# check if the entity is part of the remote RO-Crate
207201
if self.ro_crate.uri.is_remote_resource():

0 commit comments

Comments
 (0)