MCPcopy Create free account
hub / github.com/BaseXdb/basex / run

Method run

basex-core/src/main/java/org/basex/core/cmd/BinaryGet.java:31–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29 }
30
31 @Override
32 protected boolean run() {
33 final String path = MetaData.normPath(args[0]);
34 if(path == null) return error(PATH_INVALID_X, args[0]);
35
36 final Data data = context.data();
37 if(data.inMemory()) return error(NO_MAINMEM);
38
39 final IOFile bin = data.meta.file(path, ResourceType.BINARY);
40 if(!bin.exists() || bin.isDir()) return error(RES_NOT_FOUND_X, path);
41
42 try(BufferInput bi = BufferInput.get(bin)) {
43 for(int b; (b = bi.read()) != -1;) out.write(b);
44 } catch(final IOException ex) {
45 return error(ex.toString());
46 }
47 return info(QUERY_EXECUTED_X_X, "", jc().performance);
48 }
49
50 @Override
51 public void addLocks() {

Callers

nothing calls this directly

Calls 13

normPathMethod · 0.95
inMemoryMethod · 0.95
existsMethod · 0.95
isDirMethod · 0.95
getMethod · 0.95
jcMethod · 0.80
readMethod · 0.65
toStringMethod · 0.65
infoMethod · 0.65
errorMethod · 0.45
dataMethod · 0.45
fileMethod · 0.45

Tested by

no test coverage detected