}
public String getCurrentUserDisplayNameOrID() {
- final String displayName = userCatalogs.getUserDisplayName(getUserID());
+ final String displayName = userCatalogs.getDisplayName(getUserID());
return displayName == null ? getUserID() : displayName;
}
public boolean hasUserDisplayNameForID(String userID) {
- return userCatalogs.getUserDisplayName(userID) != null;
- }
-
- public boolean hasUserIDForDisplayName(String displayName) {
- return userCatalogs.getUserID(displayName) != null;
+ return userCatalogs.getDisplayName(userID) != null;
}
public String getUserDisplayNameForID(String userID) {
- return userCatalogs.getUserDisplayName(userID);
+ return userCatalogs.getDisplayName(userID);
}
public String getUserIDForDisplayName(String displayName) {
}
final List<String> filtered = new ArrayList<String>();
for(String userID : userIDs) {
- if(!this.userCatalogs.hasUserID(userID)) {
+ if(!this.userCatalogs.hasID(userID)) {
filtered.add(userID);
}
}
}
}-*/;
- public static void LOG(Object ...args) {
+ public static void LOG(String ...args) {
final StringBuilder sb = new StringBuilder();
- for(Object arg : args) {
+ for(String arg : args) {
sb.append(arg);
}
if(sb.length() > 0) {
return true;
}
- HeadRequest<Folder> head = new HeadRequest<Folder>(Pithos.this, Folder.class, getApiPath(), f.getOwnerID(), "/" + f.getContainer()) {
+ HeadRequest<Folder> head = new HeadRequest<Folder>(Folder.class, getApiPath(), f.getOwnerID(), "/" + f.getContainer()) {
@Override
public void onSuccess(Folder _result) {
}
public void fetchAccount(final Command callback) {
- LOG("Pithos::fetchAccount(), callback = ", callback);
String path = "?format=json";
- GetRequest<AccountResource> getAccount = new GetRequest<AccountResource>(this, AccountResource.class, getApiPath(), userID, path) {
+ GetRequest<AccountResource> getAccount = new GetRequest<AccountResource>(AccountResource.class, getApiPath(), userID, path) {
@Override
public void onSuccess(AccountResource _result) {
account = _result;
}
public void updateStatistics() {
- HeadRequest<AccountResource> headAccount = new HeadRequest<AccountResource>(this, AccountResource.class, getApiPath(), userID, "", account) {
+ HeadRequest<AccountResource> headAccount = new HeadRequest<AccountResource>(AccountResource.class, getApiPath(), userID, "", account) {
@Override
public void onSuccess(AccountResource _result) {
protected void createHomeContainer(final AccountResource _account, final Command callback) {
String path = "/" + Const.HOME_CONTAINER;
- PutRequest createPithos = new PutRequest(this, getApiPath(), getUserID(), path) {
+ PutRequest createPithos = new PutRequest(getApiPath(), getUserID(), path) {
@Override
public void onSuccess(Resource result) {
if(!_account.hasTrashContainer()) {
protected void createTrashContainer(final Command callback) {
String path = "/" + Const.TRASH_CONTAINER;
- PutRequest createPithos = new PutRequest(this, getApiPath(), getUserID(), path) {
+ PutRequest createPithos = new PutRequest(getApiPath(), getUserID(), path) {
@Override
public void onSuccess(Resource result) {
fetchAccount(callback);
final PleaseWaitPopup pwp = new PleaseWaitPopup();
pwp.center();
String path = "/" + folder.getContainer() + "/" + folder.getPrefix() + "?delimiter=/" + "&t=" + System.currentTimeMillis();
- DeleteRequest deleteFolder = new DeleteRequest(this, getApiPath(), folder.getOwnerID(), path) {
+ DeleteRequest deleteFolder = new DeleteRequest(getApiPath(), folder.getOwnerID(), path) {
@Override
protected void onUnauthorized(Response response) {
if(iter.hasNext()) {
File file = iter.next();
String path = targetUri + "/" + file.getName();
- PutRequest copyFile = new PutRequest(this, getApiPath(), targetUsername, path) {
+ PutRequest copyFile = new PutRequest(getApiPath(), targetUsername, path) {
@Override
public void onSuccess(Resource result) {
copyFiles(iter, targetUsername, targetUri, callback);
public void copyFolder(final Folder f, final String targetUsername, final String targetUri, boolean move, final Command callback) {
String path = targetUri + "?delimiter=/";
- PutRequest copyFolder = new PutRequest(this, getApiPath(), targetUsername, path) {
+ PutRequest copyFolder = new PutRequest(getApiPath(), targetUsername, path) {
@Override
public void onSuccess(Resource result) {
if(callback != null) {
groupTreeView.updateGroupNode(null);
}
- public Group addGroup(String groupName) {
- final Group group = new Group(groupName);
- account.addGroup(group);
+ public Group addGroup(String groupname) {
+ Group newGroup = new Group(groupname);
+ account.addGroup(newGroup);
groupTreeView.updateGroupNode(null);
- return group;
+ return newGroup;
}
public void removeGroup(Group group) {
}
}
else {
- HeadRequest<Folder> headFolder = new HeadRequest<Folder>(this, Folder.class, getApiPath(), folder.getOwnerID(), folder.getUri(), folder) {
+ HeadRequest<Folder> headFolder = new HeadRequest<Folder>(Folder.class, getApiPath(), folder.getOwnerID(), folder.getUri(), folder) {
@Override
public void onSuccess(Folder _result) {
if(t instanceof RestException) {
if(((RestException) t).getHttpStatusCode() == Response.SC_NOT_FOUND) {
final String path = folder.getUri();
- PutRequest newFolder = new PutRequest(Pithos.this, getApiPath(), folder.getOwnerID(), path) {
+ PutRequest newFolder = new PutRequest(getApiPath(), folder.getOwnerID(), path) {
@Override
public void onSuccess(Resource _result) {
scheduleFolderHeadCommand(folder, callback);
}
public void scheduleFileHeadCommand(File f, final Command callback) {
- HeadRequest<File> headFile = new HeadRequest<File>(this, File.class, getApiPath(), f.getOwnerID(), f.getUri(), f) {
+ HeadRequest<File> headFile = new HeadRequest<File>(File.class, getApiPath(), f.getOwnerID(), f.getUri(), f) {
@Override
public void onSuccess(File _result) {
public void emptyContainer(final Folder container) {
String path = "/" + container.getName() + "?delimiter=/";
- DeleteRequest delete = new DeleteRequest(this, getApiPath(), getUserID(), path) {
+ DeleteRequest delete = new DeleteRequest(getApiPath(), getUserID(), path) {
@Override
protected void onUnauthorized(Response response) {