/**
* This code was auto-generated by a Codezu.
*
* Changes to this file may cause incorrect behavior and will be lost if
* the code is regenerated.
*/
package com.mozu.api.resources.platform.appdev;
import com.mozu.api.ApiContext;
import java.util.List;
import java.util.ArrayList;
import com.mozu.api.MozuClient;
import com.mozu.api.MozuClientFactory;
import com.mozu.api.MozuUrl;
import com.mozu.api.Headers;
import org.joda.time.DateTime;
import com.mozu.api.AsyncCallback;
import java.util.concurrent.CountDownLatch;
import com.mozu.api.security.AuthTicket;
import org.apache.commons.lang.StringUtils;
/** <summary>
* platform/appdev/filebasedpackage related resources. DOCUMENT_HERE
* </summary>
*/
public class PackageResource {
///
/// <see cref="Mozu.Api.ApiContext"/>
///
private ApiContext _apiContext;
public PackageResource()
{
_apiContext = null;
}
public PackageResource(ApiContext apiContext)
{
_apiContext = apiContext;
}
/**
* appdev-filebasedpackage Get GetFile description DOCUMENT_HERE
* <p><pre><code>
* Package package = new Package();
* Stream stream = package.getFile( applicationKey, fileName);
* </code></pre></p>
* @param applicationKey The application key uniquely identifies the developer namespace, application ID, version, and package in Dev Center. The format is {Dev Account namespace}.{Application ID}.{Application Version}.{Package name}.
* @param fileName
* @return Stream
* @see Stream
*/
public java.io.InputStream getFile(String applicationKey, String fileName) throws Exception
{
MozuClient<java.io.InputStream> client = com.mozu.api.clients.platform.appdev.PackageClient.getFileClient( applicationKey, fileName);
client.setContext(_apiContext);
client.executeRequest();
return client.getResult();
}
/**
* appdev-filebasedpackage Get GetFile description DOCUMENT_HERE
* <p><pre><code>
* Package package = new Package();
* CountDownLatch latch = package.getFile( applicationKey, fileName, callback );
* latch.await() * </code></pre></p>
* @param applicationKey The application key uniquely identifies the developer namespace, application ID, version, and package in Dev Center. The format is {Dev Account namespace}.{Application ID}.{Application Version}.{Package name}.
* @param fileName
* @param callback callback handler for asynchronous operations
* @return Stream
* @see Stream
*/
public CountDownLatch getFileAsync(String applicationKey, String fileName, AsyncCallback<java.io.InputStream> callback) throws Exception
{
MozuClient<java.io.InputStream> client = com.mozu.api.clients.platform.appdev.PackageClient.getFileClient( applicationKey, fileName);
client.setContext(_apiContext);
return client.executeRequest(callback);
}
}