doc touch up

This commit is contained in:
Kohsuke Kawaguchi
2013-11-09 15:11:02 -08:00
parent 6632da34c0
commit ff9b538a49
4 changed files with 26 additions and 8 deletions

View File

@@ -3,6 +3,11 @@ package org.kohsuke.github;
import java.io.IOException;
import java.util.Date;
/**
* Asset in a release.
*
* @see GHRelease#getAssets()
*/
public class GHAsset {
GitHub root;
GHRepository owner;

View File

@@ -3,10 +3,18 @@ package org.kohsuke.github;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import static java.lang.String.format;
/**
* Release in a github repository.
*
* @see GHRepository#getReleases()
* @see GHRepository#createRelease(String)
*/
public class GHRelease {
GitHub root;
GHRepository owner;
@@ -176,12 +184,12 @@ public class GHRelease {
.to(url, GHAsset.class).wrap(this);
}
public GHAsset[] getAssets() throws IOException {
public List<GHAsset> getAssets() throws IOException {
Requester builder = new Requester(owner.root);
GHAsset[] assets = (GHAsset[]) builder
GHAsset[] assets = builder
.method("GET")
.to(owner.getApiTailUrl(format("releases/%d/assets", id)), GHAsset[].class);
return GHAsset.wrap(assets, this);
return Arrays.asList(GHAsset.wrap(assets, this));
}
}

View File

@@ -2,6 +2,11 @@ package org.kohsuke.github;
import java.io.IOException;
/**
* Builder pattern for creating a {@link GHRelease}
*
* @see GHRepository#createRelease(String)
*/
public class GHReleaseBuilder {
private final GHRepository repo;
private final Requester builder;