Skip to content

Commit

Permalink
Remove route dumping
Browse files Browse the repository at this point in the history
  • Loading branch information
shinovon committed Jun 23, 2023
1 parent 2a16ff7 commit 4c4d096
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions src/mahomaps/overlays/RouteOverlay.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package mahomaps.overlays;

import java.io.IOException;
import java.io.OutputStream;
import java.util.Vector;

import javax.microedition.io.Connector;
import javax.microedition.io.file.FileConnection;
import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.AlertType;
import javax.microedition.lcdui.Command;
Expand All @@ -14,8 +11,6 @@
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Item;

import cc.nnproject.json.JSONObject;

import mahomaps.MahoMapsApp;
import mahomaps.Settings;
import mahomaps.api.Http403Exception;
Expand Down Expand Up @@ -67,9 +62,7 @@ public boolean OnPointTap(Geopoint p) {

public void run() {
try {
JSONObject jo = MahoMapsApp.api.Route(a, b, method);
Dump(jo);
route = new Route(jo);
route = new Route(MahoMapsApp.api.Route(a, b, method));
LoadRoute();
} catch (IOException e) {
content = new FillFlowContainer(new UIElement[] { new SimpleText(MahoMapsApp.text[111]),
Expand Down Expand Up @@ -205,28 +198,4 @@ public void commandAction(Command c, Displayable d) {
MahoMapsApp.BringMap();
}

public static void Dump(JSONObject j) {
FileConnection fc = null;
try {
// String base = "file:///root/";
String base = System.getProperty("fileconn.dir.photos");
fc = (FileConnection) Connector.open(base + "route" + System.currentTimeMillis() + ".json");
if (!fc.exists())
fc.create();
else
fc.truncate(0);
OutputStream stream = fc.openOutputStream();
stream.write(j.toString().getBytes("UTF-8"));
stream.flush();
stream.close();
} catch (Exception e) {
} finally {
try {
if (fc != null)
fc.close();
} catch (IOException e) {
}
}
}

}

0 comments on commit 4c4d096

Please sign in to comment.