MCPcopy Create free account
hub / github.com/alibaba/GraphScope / _pack_jar

Method _pack_jar

python/graphscope/analytical/app/java_app.py:283–298  ·  view source on GitHub ↗
(self, full_jar_path: str)

Source from the content-addressed store, hash-verified

281 )
282
283 def _pack_jar(self, full_jar_path: str):
284 garfile = InMemoryZip()
285 if not os.path.exists(full_jar_path):
286 raise FileNotFoundError("Jar file not found in {}.".format(full_jar_path))
287 if not full_jar_path.endswith(".jar") or not zipfile.is_zipfile(full_jar_path):
288 raise KeyError(
289 "{} is not a jar file, please feed your packed jar file to JavaApp.".format(
290 full_jar_path
291 )
292 )
293 tmp_jar_file = open(full_jar_path, "rb")
294 jar_bytes = tmp_jar_file.read()
295 if len(jar_bytes) <= 0:
296 raise KeyError("Expect a non-empty Jar.")
297 garfile.append("{}".format(full_jar_path.split("/")[-1]), jar_bytes)
298 return garfile
299
300 def signature(self):
301 s = hashlib.sha256()

Callers 1

__init__Method · 0.95

Calls 7

appendMethod · 0.95
InMemoryZipClass · 0.90
openFunction · 0.85
splitMethod · 0.80
existsMethod · 0.65
readMethod · 0.65
formatMethod · 0.45

Tested by

no test coverage detected