File tree Expand file tree Collapse file tree 1 file changed +26
-24
lines changed
volatility3/framework/layers Expand file tree Collapse file tree 1 file changed +26
-24
lines changed Original file line number Diff line number Diff line change 88
99try :
1010 import s3fs
11+
1112 HAS_S3FS = True
1213except ImportError :
1314 HAS_S3FS = False
1415
1516try :
1617 import gcsfs
18+
1719 HAS_GCSFS = True
1820except ImportError :
1921 HAS_GCSFS = False
2628if HAS_S3FS :
2729
2830 class S3FileSystemHandler (resources .VolatilityHandler ):
29-
30- @ classmethod
31- def non_cached_schemes ( cls ) -> List [ str ]:
32- return [ "s3" ]
33-
34- @ staticmethod
35- def default_open ( req : urllib . request . Request ) -> Optional [ Any ]:
36- """Handles the request if it's the s3 scheme."""
37- if req . type == "s3" :
38- object_uri = "://" . join ( req . full_url . split ( "://" )[ 1 :] )
39- return s3fs . S3FileSystem (). open ( object_uri )
40- return None
31+ @ classmethod
32+ def non_cached_schemes ( cls ) -> List [ str ]:
33+ return [ "s3" ]
34+
35+ @ staticmethod
36+ def default_open ( req : urllib . request . Request ) -> Optional [ Any ]:
37+ """Handles the request if it's the s3 scheme."""
38+ if req . type == "s3" :
39+ object_uri = "://" . join ( req . full_url . split ( "://" )[ 1 :])
40+ return s3fs . S3FileSystem (). open ( object_uri )
41+ return None
42+
4143
4244if HAS_GCSFS :
43-
45+
4446 class GSFileSystemHandler (resources .VolatilityHandler ):
45- @classmethod
46- def non_cached_schemes (cls ) -> List [str ]:
47- return ["gs" ]
48-
49- @staticmethod
50- def default_open (req : urllib .request .Request ) -> Optional [Any ]:
51- """Handles the request if it's the gs scheme."""
52- if req .type == "gs" :
53- object_uri = "://" .join (req .full_url .split ("://" )[1 :])
54- return gcsfs .GCSFileSystem ().open (object_uri )
55- return None
47+ @classmethod
48+ def non_cached_schemes (cls ) -> List [str ]:
49+ return ["gs" ]
50+
51+ @staticmethod
52+ def default_open (req : urllib .request .Request ) -> Optional [Any ]:
53+ """Handles the request if it's the gs scheme."""
54+ if req .type == "gs" :
55+ object_uri = "://" .join (req .full_url .split ("://" )[1 :])
56+ return gcsfs .GCSFileSystem ().open (object_uri )
57+ return None
You can’t perform that action at this time.
0 commit comments