Skip to content

Commit

Permalink
Merge pull request #798 from caelum/ot-downloadbuilderimprovements
Browse files Browse the repository at this point in the history
Reducing constr visibility to enforce to use factory methods
  • Loading branch information
garcia-jj committed Sep 16, 2014
2 parents 98d9505 + 99f7ccc commit 378fca8
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static FileDownloadBuilder of(File file) {
* .build();
* </code>
*
* @param file The input InputStream to process.
* @param input The input InputStream to process.
* @throws NullPointerException If the {@code input} argument is {@code null}
*/
public static InputStreamDownloadBuilder of(InputStream input) {
Expand All @@ -66,14 +66,14 @@ public static InputStreamDownloadBuilder of(InputStream input) {
* .build();
* </code>
*
* @param file The input byte array.
* @param input The input byte array.
* @throws NullPointerException If the {@code input} argument is {@code null}
*/
public static ByteArrayDownloadBuilder of(byte[] input) {
return new ByteArrayDownloadBuilder(input);
}

public static abstract class AbstractDownloadBuilder<T> {
static abstract class AbstractDownloadBuilder<T> {
protected String fileName;
protected String contentType;
protected boolean doDownload;
Expand All @@ -97,7 +97,7 @@ public T downloadable() {
public static class FileDownloadBuilder extends AbstractDownloadBuilder<FileDownloadBuilder> {
private final File file;

public FileDownloadBuilder(File file) {
FileDownloadBuilder(File file) {
this.file = requireNonNull(file, "File can't be null");
}

Expand All @@ -111,7 +111,7 @@ public static class InputStreamDownloadBuilder extends AbstractDownloadBuilder<I
private final InputStream input;
private long size;

public InputStreamDownloadBuilder(InputStream input) {
InputStreamDownloadBuilder(InputStream input) {
this.input = requireNonNull(input, "InputStream can't be null");
}

Expand All @@ -128,7 +128,7 @@ public InputStreamDownload build() {
public static class ByteArrayDownloadBuilder extends AbstractDownloadBuilder<ByteArrayDownloadBuilder> {
private final byte[] buff;

public ByteArrayDownloadBuilder(byte[] buff) {
ByteArrayDownloadBuilder(byte[] buff) {
this.buff = requireNonNull(buff, "byte[] can't be null");
}

Expand Down

0 comments on commit 378fca8

Please sign in to comment.