Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update package names and function calls for gobind #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
2 changes: 1 addition & 1 deletion app/src/main/java/io/upspin/upspin/DirEntryAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import java.util.Date;
import java.util.Locale;

import go.gobind.Gobind.DirEntry;
import gobind.DirEntry;

/**
* DirEntryAdapter is a recycler view adapter for displaying cards on the UI that contain directory
Expand Down
21 changes: 10 additions & 11 deletions app/src/main/java/io/upspin/upspin/ListDir.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@
import java.io.FileNotFoundException;
import java.io.IOException;

import go.gobind.Gobind;
import go.gobind.Gobind.Client;
import go.gobind.Gobind.ClientConfig;
import go.gobind.Gobind.DirEntry;
import gobind.Client;
import gobind.ClientConfig;
import gobind.DirEntry;

/**
* ListDir is an Activity for listing and navigating the contents of a user directory.
Expand Down Expand Up @@ -116,7 +115,7 @@ private ClientConfig reloadPreferences() {
if (pubKey.length() > 0 && pubKey.charAt(pubKey.length() - 1) != '\n') {
pubKey = pubKey + "\n";
}
ClientConfig cfg = Gobind.NewClientConfig();
ClientConfig cfg = new ClientConfig();
cfg.setUserName(userName);
cfg.setPublicKey(pubKey);
cfg.setPrivateKey(privKey);
Expand Down Expand Up @@ -210,7 +209,7 @@ public void navigateToDir(final String dir) {
protected DirEntry doInBackground(Void... params) {
DirEntry entry = null;
try {
entry = mClient.Glob(dir + "/*");
entry = mClient.glob(dir + "/*");
} catch (java.lang.Exception e) {
opException = e;
return null;
Expand Down Expand Up @@ -238,7 +237,7 @@ private void refresh() {

// This does not do networking operations hence it is suitable for the main thread.
try {
mClient = Gobind.NewClient(mClientConfig);
mClient = new Client(mClientConfig);
} catch (java.lang.Exception e) {
showModalErrorMessage(e.getLocalizedMessage(), "Error Connecting Client");
return;
Expand All @@ -256,7 +255,7 @@ private void refresh() {
}

@Override
public void onClick(Gobind.DirEntry de) {
public void onClick(DirEntry de) {
if (de.getIsDir()) {
navigateToDir(de.getName());
} else {
Expand All @@ -273,7 +272,7 @@ protected byte[] doInBackground(Void... voids) {
// TODO: show a spinner while loading.
byte[] data = null;
try {
data = mClient.Get(fullFilename);
data = mClient.get(fullFilename);
} catch (java.lang.Exception e) {
opException = e;
return null;
Expand Down Expand Up @@ -389,7 +388,7 @@ protected Void doInBackground(Void... voids) {
// TODO: Use the size to choose between reading all into memory and the streaming API.
byte[] data = readAll(uri);
try {
String ref = mClient.Put(fname, data);
String ref = mClient.put(fname, data);
Log.i("ListDir.Put", "ref: " + ref + " fname:" + fname);
} catch (Exception e) {
opException = e;
Expand All @@ -413,4 +412,4 @@ public void onPostExecute(Void voids) {
}
}
}
}
}