org.labkey.remoteapi.storage.BaseStorageCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of labkey-client-api Show documentation
Show all versions of labkey-client-api Show documentation
The client-side library for Java developers is a separate JAR from the LabKey Server code base. It can be used by any Java program, including another Java web application.
package org.labkey.remoteapi.storage;
import org.json.JSONObject;
import org.labkey.remoteapi.PostCommand;
public abstract class BaseStorageCommand extends PostCommand
{
private final StorageRow _storageRow;
public BaseStorageCommand(String action, StorageRow storageRow)
{
super("storage", action);
_storageRow = storageRow;
}
@Override
public double getRequiredVersion()
{
return -1;
}
@Override
protected StorageCommandResponse createResponse(String text, int status, String contentType, JSONObject json)
{
return new StorageCommandResponse(text, status, contentType, json, this);
}
/**
* Dynamically builds the JSON object to send based on the storageRow.
* @return The JSON object to send.
*/
@Override
public JSONObject getJsonObject()
{
return _storageRow.toJsonObject();
}
}