public class DownloadService extends GitHubService
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
UPLOAD_ACL
UPLOAD_ACL
|
static java.lang.String |
UPLOAD_AWS_ACCESS_KEY_ID
UPLOAD_AWS_ACCESS_KEY_ID
|
static java.lang.String |
UPLOAD_CONTENT_TYPE
UPLOAD_CONTENT_TYPE
|
static java.lang.String |
UPLOAD_FILE
UPLOAD_FILE
|
static java.lang.String |
UPLOAD_FILENAME
UPLOAD_FILENAME
|
static java.lang.String |
UPLOAD_KEY
UPLOAD_KEY
|
static java.lang.String |
UPLOAD_POLICY
UPLOAD_POLICY
|
static java.lang.String |
UPLOAD_SIGNATURE
UPLOAD_SIGNATURE
|
static java.lang.String |
UPLOAD_SUCCESS_ACTION_STATUS
UPLOAD_SUCCESS_ACTION_STATUS
|
ACCEPT_FULL, ACCEPT_HTML, ACCEPT_PREVIEW_DRAX, ACCEPT_PREVIEW_IRONMAN, ACCEPT_PREVIEW_LOKI, ACCEPT_RAW, ACCEPT_TEXT, client| Constructor and Description |
|---|
DownloadService()
Create download service
|
DownloadService(GitHubClient client)
Create download service
|
| Modifier and Type | Method and Description |
|---|---|
DownloadResource |
createDownload(IRepositoryIdProvider repository,
Download download,
java.io.File file)
Create download from content of given file.
|
DownloadResource |
createDownload(IRepositoryIdProvider repository,
Download download,
java.io.InputStream content,
long size)
Create download and set the content to be the content of given input
stream.
|
protected PagedRequest<Download> |
createDownloadsRequest(IRepositoryIdProvider repository,
int start,
int size)
Create paged downloads request
|
DownloadResource |
createResource(IRepositoryIdProvider repository,
Download download)
Create a new resource for download associated with the given repository
|
void |
deleteDownload(IRepositoryIdProvider repository,
int id)
Delete download with given id from given repository
|
Download |
getDownload(IRepositoryIdProvider repository,
int id)
Get download metadata for given repository and id
|
java.util.List<Download> |
getDownloads(IRepositoryIdProvider repository)
Get metadata for all downloads for given repository
|
PageIterator<Download> |
pageDownloads(IRepositoryIdProvider repository)
Page metadata for downloads for given repository
|
PageIterator<Download> |
pageDownloads(IRepositoryIdProvider repository,
int size)
Page downloads for given repository
|
PageIterator<Download> |
pageDownloads(IRepositoryIdProvider repository,
int start,
int size)
Page downloads for given repository
|
void |
uploadResource(DownloadResource resource,
java.io.InputStream content,
long size)
Upload a resource to be available as the download described by the given
resource.
|
check, createPagedRequest, createPagedRequest, createPageIterator, createRequest, getAll, getAll, getClient, getId, verifyRepositorypublic static final java.lang.String UPLOAD_KEY
public static final java.lang.String UPLOAD_ACL
public static final java.lang.String UPLOAD_SUCCESS_ACTION_STATUS
public static final java.lang.String UPLOAD_FILENAME
public static final java.lang.String UPLOAD_AWS_ACCESS_KEY_ID
public static final java.lang.String UPLOAD_POLICY
public static final java.lang.String UPLOAD_SIGNATURE
public static final java.lang.String UPLOAD_FILE
public static final java.lang.String UPLOAD_CONTENT_TYPE
public DownloadService()
public DownloadService(GitHubClient client)
client - public Download getDownload(IRepositoryIdProvider repository, int id) throws java.io.IOException
repository - id - java.io.IOExceptionprotected PagedRequest<Download> createDownloadsRequest(IRepositoryIdProvider repository, int start, int size)
repository - start - size - public java.util.List<Download> getDownloads(IRepositoryIdProvider repository) throws java.io.IOException
repository - java.io.IOExceptionpublic PageIterator<Download> pageDownloads(IRepositoryIdProvider repository)
repository - public PageIterator<Download> pageDownloads(IRepositoryIdProvider repository, int size)
repository - size - public PageIterator<Download> pageDownloads(IRepositoryIdProvider repository, int start, int size)
repository - start - size - public void deleteDownload(IRepositoryIdProvider repository, int id) throws java.io.IOException
repository - id - java.io.IOExceptionpublic DownloadResource createResource(IRepositoryIdProvider repository, Download download) throws java.io.IOException
repository - download - java.io.IOExceptionpublic void uploadResource(DownloadResource resource, java.io.InputStream content, long size) throws java.io.IOException
resource - content - size - java.io.IOExceptionpublic DownloadResource createDownload(IRepositoryIdProvider repository, Download download, java.io.InputStream content, long size) throws java.io.IOException
createResource(IRepositoryIdProvider, Download) followed by a
uploadResource(DownloadResource, InputStream, long) with the
results.repository - download - metadata about the downloadcontent - raw content of the downloadsize - size of content in the input streamjava.io.IOExceptionpublic DownloadResource createDownload(IRepositoryIdProvider repository, Download download, java.io.File file) throws java.io.IOException
repository - download - metadata about the downloadfile - must be non-nulljava.io.IOExceptioncreateDownload(IRepositoryIdProvider, Download, InputStream, long)