Skip to content
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
4 changes: 2 additions & 2 deletions src/org/recompile/freej2me/Anbu.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ public void run()

private static String getFormattedLocation(String loc)
{
if (loc.startsWith("file://") || loc.startsWith("http://"))
if (loc.startsWith("file://") || loc.startsWith("http://") || loc.startsWith("https://"))
return loc;

File file = new File(loc);
if(!file.exists() || file.isDirectory())
if(!file.isFile())
{
System.out.println("File not found...");
System.exit(0);
Expand Down
17 changes: 16 additions & 1 deletion src/org/recompile/freej2me/FreeJ2ME.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void windowClosing(WindowEvent e)
String jarfile = "";
if(args.length>=1)
{
jarfile = args[0];
jarfile = getFormattedLocation(args[0]);
}
if(args.length>=3)
{
Expand Down Expand Up @@ -301,6 +301,21 @@ public boolean accept(File dir, String name)
}
}

private static String getFormattedLocation(String loc)
{
if (loc.startsWith("file://") || loc.startsWith("http://") || loc.startsWith("https://"))
return loc;

File file = new File(loc);
if(! file.isFile())
{
System.out.println("File not found...");
System.exit(0);
}

return "file://" + file.getAbsolutePath();
}

private void settingsChanged()
{
int w = Integer.parseInt(config.settings.get("width"));
Expand Down