mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-08-17 20:35:40 +02:00
Reduce code reuse
This commit is contained in:
@@ -367,15 +367,7 @@ class SqliteCache(CacheManagerInterface):
|
||||
timestamp = stored_timestamp # Default to requiring update
|
||||
|
||||
# See if the file is a local URL type we can handle:
|
||||
parsed = urllib.parse.urlparse(location)
|
||||
pathname = None
|
||||
if parsed.scheme == "file":
|
||||
pathname = parsed.path
|
||||
if parsed.scheme == "jar":
|
||||
inner_url = urllib.parse.urlparse(parsed.path)
|
||||
if inner_url.scheme == "file":
|
||||
pathname = inner_url.path.split("!")[0]
|
||||
|
||||
pathname = self._get_local_filepath(location)
|
||||
if pathname and os.path.exists(pathname):
|
||||
timestamp = datetime.datetime.fromtimestamp(
|
||||
os.stat(pathname).st_mtime
|
||||
|
||||
Reference in New Issue
Block a user