diff options
author | Grant Limberg <glimberg@gmail.com> | 2015-05-23 18:29:16 -0700 |
---|---|---|
committer | Grant Limberg <glimberg@gmail.com> | 2015-05-23 18:29:16 -0700 |
commit | 6e998efd15d0c0c85b8b605d84518cb7197a9086 (patch) | |
tree | 5cfd71f8cae73323d900bfc5aaeb9fe116ae5102 /java | |
parent | 5c2aaad365b5f4d575d4cc40d7808db990a7f680 (diff) | |
download | infinitytier-6e998efd15d0c0c85b8b605d84518cb7197a9086.tar.gz infinitytier-6e998efd15d0c0c85b8b605d84518cb7197a9086.zip |
fixing up data store stuff
Diffstat (limited to 'java')
-rw-r--r-- | java/src/com/zerotier/one/AndroidFileProvider.java | 9 | ||||
-rw-r--r-- | java/src/com/zerotier/one/DataStore.java | 4 | ||||
-rw-r--r-- | java/src/com/zerotier/sdk/VirtualNetworkFrameListener.java | 2 |
3 files changed, 9 insertions, 6 deletions
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, |