Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use file:// protocol #144

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ public static class Http {
public static void download(String fileName, File destination) throws IOException {
try {
Arguments arg = Arguments.get();
FileUtils.copyInputStreamToFile(new URL("http://localhost:" + arg.port + "?name=" + fileName).openStream(), destination);
URL url = new URL("http://localhost:" + arg.port + "?name=" + fileName);
Log.i("Host: " + url);
FileUtils.copyInputStreamToFile(url.openStream(), destination);
} catch (Throwable e) {
checkAppStarted();
checkRheaTraceIntegration();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private static void showBufferUsage() {
long currentSize = appTraceBuffer.optLong("currentSize");
long maxSize = appTraceBuffer.optLong("maxSize");
if (currentSize <= maxSize) {
Log.blue("MaxAppTraceBufferSize usage " + currentSize + "/" + maxSize + " (" + (currentSize * 100 / maxSize) + "%)");
Log.blue("MaxAppTraceBufferSize usage " + currentSize + "/" + maxSize + " (" + (currentSize * 100f / maxSize) + "%)");
} else {
Log.red("MaxAppTraceBufferSize is too small. Expected " + currentSize + " Actual " + maxSize + ". Add `-maxAppTraceBufferSize " + currentSize + "` to your command");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private static File selectMapping() throws IOException {
version = version.substring(1);
File file = new File(MAPPING_DIR, version);
if (file.exists()) {
Log.i("reuse cached mapping:" + file);
Log.i("reuse cached mapping: " + file.toPath().toUri());
} else {
// 3. mapping in apk
Log.i("downloading mapping");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static void clear() {
throw new TraceError("can not create dir " + workspace, "you can retry or create the directory by your self:" + workspace);
}
FileUtils.cleanDirectory(workspace);
Log.i("workspace clear: " + workspace.getAbsolutePath());
Log.i("workspace clear: " + workspace.toPath().toUri());
} catch (IOException e) {
throw new TraceError(e.getMessage(), "you can retry or create the directory by your self:" + Workspace.root());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ protected void merge(List<Frame> binaryFrame, List<ATrace> aTrace) throws IOExce
TraceAssembler.assemble(systemTrace, binaryFrame, aTrace);
File output = Workspace.output();
try (FileOutputStream out = new FileOutputStream(output)) {
Log.red("writing trace:" + output);
Log.red("writing trace: " + output.toPath().toUri());
systemTrace.build().writeTo(out);
}
}
}
}