Skip to content

Commit

Permalink
Merge pull request #650 from hieupham007/TIMOB-6095
Browse files Browse the repository at this point in the history
Correct path to absolute path for test.db.
  • Loading branch information
marshall committed Nov 9, 2011
2 parents f08b1e6 + 31d4dfb commit 8ced176
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import java.io.InputStream;
import java.io.OutputStream;

import org.appcelerator.kroll.KrollInvocation;
import org.appcelerator.kroll.KrollModule;
import org.appcelerator.kroll.annotations.Kroll;
import org.appcelerator.kroll.common.Log;
Expand All @@ -24,6 +25,7 @@
import org.appcelerator.titanium.io.TiBaseFile;
import org.appcelerator.titanium.io.TiFileFactory;
import org.appcelerator.titanium.util.TiConvert;
import org.appcelerator.titanium.util.TiUrl;

import android.content.Context;
import android.database.SQLException;
Expand Down Expand Up @@ -85,7 +87,7 @@ public TiDatabaseProxy open(Object file)
}

@Kroll.method
public TiDatabaseProxy install(String url, String name) throws IOException
public TiDatabaseProxy install(KrollInvocation invocation, String url, String name) throws IOException
{
try {
//TiContext tiContext = invocation.getTiContext();
Expand All @@ -105,7 +107,9 @@ public TiDatabaseProxy install(String url, String name) throws IOException
Log.d(LCAT,"db url is = "+url);
}

String path = resolveUrl(null, url);
TiUrl tiUrl = TiUrl.createProxyUrl(invocation.getSourceUrl());
String path = TiUrl.resolve(tiUrl.baseUrl, url, null);

TiBaseFile srcDb = TiFileFactory.createTitaniumFile(path, false);

if (DBG) {
Expand Down

0 comments on commit 8ced176

Please sign in to comment.