Created
December 10, 2015 21:59
-
-
Save akuafif/63ed02370e5f44430896 to your computer and use it in GitHub Desktop.
[Java/Android] BaasBox - Delete a File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BaasFile oldFile = new BaasFile(); | |
// Fetch the file from server | |
oldFile.fetch(oldFileID, new BaasHandler<BaasFile>() { | |
@Override | |
public void handle(BaasResult<BaasFile> baasResult) { // Successfully fetch file | |
if (baasResult.isSuccess()) { | |
Log.d(TAG, "Received old file"); | |
// Delete the file from server | |
baasResult.value().delete(new BaasHandler<Void>() { | |
@Override | |
public void handle(BaasResult<Void> baasResult) { | |
if (baasResult.isSuccess()) | |
Log.d(TAG, "Old File Deleted"); | |
else if (baasResult.isFailed()) | |
Log.d(TAG, "Error"); | |
} | |
}); | |
} else if (baasResult.isFailed()) { | |
Log.e(TAG, "Error"); | |
} else | |
Log.d(TAG, "Error"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment