From 6e998efd15d0c0c85b8b605d84518cb7197a9086 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Sat, 23 May 2015 18:29:16 -0700 Subject: fixing up data store stuff --- java/src/com/zerotier/one/AndroidFileProvider.java | 9 ++++++--- java/src/com/zerotier/one/DataStore.java | 4 ++-- java/src/com/zerotier/sdk/VirtualNetworkFrameListener.java | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) (limited to 'java') diff --git a/java/src/com/zerotier/one/AndroidFileProvider.java b/java/src/com/zerotier/one/AndroidFileProvider.java index 9979001a..0988f9df 100644 --- a/java/src/com/zerotier/one/AndroidFileProvider.java +++ b/java/src/com/zerotier/one/AndroidFileProvider.java @@ -6,25 +6,28 @@ import java.io.FileOutputStream; import java.io.IOException; import android.content.Context; +import android.util.Log; public class AndroidFileProvider implements DataStoreFileProvider { + private static final String TAG = "AndroidFileProvider"; + Context _ctx; - AndroidFileProvider(Context ctx) { + public AndroidFileProvider(Context ctx) { this._ctx = ctx; } @Override public FileInputStream getInputFileStream(String name) throws FileNotFoundException { - // TODO Auto-generated method stub + Log.d(TAG, "Returning FileInputStream for: " + name); return _ctx.openFileInput(name); } @Override public FileOutputStream getOutputFileStream(String name) throws FileNotFoundException { - // TODO Auto-generated method stub + Log.d(TAG, "Returning FileOutputStream for: " + name); return _ctx.openFileOutput(name, Context.MODE_PRIVATE); } diff --git a/java/src/com/zerotier/one/DataStore.java b/java/src/com/zerotier/one/DataStore.java index 1604e93e..d15b2d3d 100644 --- a/java/src/com/zerotier/one/DataStore.java +++ b/java/src/com/zerotier/one/DataStore.java @@ -12,7 +12,7 @@ public class DataStore implements DataStoreGetListener, DataStorePutListener { private DataStoreFileProvider _provider; - DataStore(DataStoreFileProvider provider) { + public DataStore(DataStoreFileProvider provider) { this._provider = provider; } @@ -23,7 +23,7 @@ public class DataStore implements DataStoreGetListener, DataStorePutListener { FileOutputStream fos = _provider.getOutputFileStream(name); fos.write(buffer); fos.close(); - return buffer.length; + return 0; } catch (FileNotFoundException fnf) { fnf.printStackTrace(); return -1; diff --git a/java/src/com/zerotier/sdk/VirtualNetworkFrameListener.java b/java/src/com/zerotier/sdk/VirtualNetworkFrameListener.java index 17c6540d..9ad32282 100644 --- a/java/src/com/zerotier/sdk/VirtualNetworkFrameListener.java +++ b/java/src/com/zerotier/sdk/VirtualNetworkFrameListener.java @@ -38,7 +38,7 @@ public interface VirtualNetworkFrameListener { * @param vlanId * @param frameData data to send */ - void onVirtualNetworkFrame( + public void onVirtualNetworkFrame( long nwid, long srcMac, long destMac, -- cgit v1.2.3