Fix javadoc in org.eclipse.jgit.http.apache

Change-Id: I38a4854856b0103790a410b48c1c3d708b6500c1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
Matthias Sohn 2017-12-17 00:04:11 +01:00
parent 32022e9764
commit 53891d4eda
4 changed files with 52 additions and 7 deletions

View File

@ -96,7 +96,8 @@
import org.eclipse.jgit.util.TemporaryBuffer.LocalFile; import org.eclipse.jgit.util.TemporaryBuffer.LocalFile;
/** /**
* A {@link HttpConnection} which uses {@link HttpClient} * A {@link org.eclipse.jgit.transport.http.HttpConnection} which uses
* {@link org.apache.http.client.HttpClient}
* *
* @since 3.3 * @since 3.3
*/ */
@ -188,6 +189,8 @@ public void setBuffer(TemporaryBuffer buffer) {
} }
/** /**
* Constructor for HttpClientConnection.
*
* @param urlStr * @param urlStr
* @throws MalformedURLException * @throws MalformedURLException
*/ */
@ -196,6 +199,8 @@ public HttpClientConnection(String urlStr) throws MalformedURLException {
} }
/** /**
* Constructor for HttpClientConnection.
*
* @param urlStr * @param urlStr
* @param proxy * @param proxy
* @throws MalformedURLException * @throws MalformedURLException
@ -206,6 +211,8 @@ public HttpClientConnection(String urlStr, Proxy proxy)
} }
/** /**
* Constructor for HttpClientConnection.
*
* @param urlStr * @param urlStr
* @param proxy * @param proxy
* @param cl * @param cl
@ -218,17 +225,20 @@ public HttpClientConnection(String urlStr, Proxy proxy, HttpClient cl)
this.proxy = proxy; this.proxy = proxy;
} }
/** {@inheritDoc} */
@Override @Override
public int getResponseCode() throws IOException { public int getResponseCode() throws IOException {
execute(); execute();
return resp.getStatusLine().getStatusCode(); return resp.getStatusLine().getStatusCode();
} }
/** {@inheritDoc} */
@Override @Override
public URL getURL() { public URL getURL() {
return url; return url;
} }
/** {@inheritDoc} */
@Override @Override
public String getResponseMessage() throws IOException { public String getResponseMessage() throws IOException {
execute(); execute();
@ -257,6 +267,7 @@ private void execute() throws IOException, ClientProtocolException {
} }
} }
/** {@inheritDoc} */
@Override @Override
public Map<String, List<String>> getHeaderFields() { public Map<String, List<String>> getHeaderFields() {
Map<String, List<String>> ret = new HashMap<>(); Map<String, List<String>> ret = new HashMap<>();
@ -269,11 +280,13 @@ public Map<String, List<String>> getHeaderFields() {
return ret; return ret;
} }
/** {@inheritDoc} */
@Override @Override
public void setRequestProperty(String name, String value) { public void setRequestProperty(String name, String value) {
req.addHeader(name, value); req.addHeader(name, value);
} }
/** {@inheritDoc} */
@Override @Override
public void setRequestMethod(String method) throws ProtocolException { public void setRequestMethod(String method) throws ProtocolException {
this.method = method; this.method = method;
@ -291,21 +304,25 @@ public void setRequestMethod(String method) throws ProtocolException {
} }
} }
/** {@inheritDoc} */
@Override @Override
public void setUseCaches(boolean usecaches) { public void setUseCaches(boolean usecaches) {
// not needed // not needed
} }
/** {@inheritDoc} */
@Override @Override
public void setConnectTimeout(int timeout) { public void setConnectTimeout(int timeout) {
this.timeout = Integer.valueOf(timeout); this.timeout = Integer.valueOf(timeout);
} }
/** {@inheritDoc} */
@Override @Override
public void setReadTimeout(int readTimeout) { public void setReadTimeout(int readTimeout) {
this.readTimeout = Integer.valueOf(readTimeout); this.readTimeout = Integer.valueOf(readTimeout);
} }
/** {@inheritDoc} */
@Override @Override
public String getContentType() { public String getContentType() {
HttpEntity responseEntity = resp.getEntity(); HttpEntity responseEntity = resp.getEntity();
@ -317,18 +334,21 @@ public String getContentType() {
return null; return null;
} }
/** {@inheritDoc} */
@Override @Override
public InputStream getInputStream() throws IOException { public InputStream getInputStream() throws IOException {
return resp.getEntity().getContent(); return resp.getEntity().getContent();
} }
// will return only the first field // will return only the first field
/** {@inheritDoc} */
@Override @Override
public String getHeaderField(String name) { public String getHeaderField(String name) {
Header header = resp.getFirstHeader(name); Header header = resp.getFirstHeader(name);
return (header == null) ? null : header.getValue(); return (header == null) ? null : header.getValue();
} }
/** {@inheritDoc} */
@Override @Override
public int getContentLength() { public int getContentLength() {
Header contentLength = resp.getFirstHeader("content-length"); //$NON-NLS-1$ Header contentLength = resp.getFirstHeader("content-length"); //$NON-NLS-1$
@ -344,16 +364,19 @@ public int getContentLength() {
} }
} }
/** {@inheritDoc} */
@Override @Override
public void setInstanceFollowRedirects(boolean followRedirects) { public void setInstanceFollowRedirects(boolean followRedirects) {
this.followRedirects = Boolean.valueOf(followRedirects); this.followRedirects = Boolean.valueOf(followRedirects);
} }
/** {@inheritDoc} */
@Override @Override
public void setDoOutput(boolean dooutput) { public void setDoOutput(boolean dooutput) {
// TODO: check whether we can really ignore this. // TODO: check whether we can really ignore this.
} }
/** {@inheritDoc} */
@Override @Override
public void setFixedLengthStreamingMode(int contentLength) { public void setFixedLengthStreamingMode(int contentLength) {
if (entity != null) if (entity != null)
@ -362,6 +385,7 @@ public void setFixedLengthStreamingMode(int contentLength) {
entity.setContentLength(contentLength); entity.setContentLength(contentLength);
} }
/** {@inheritDoc} */
@Override @Override
public OutputStream getOutputStream() throws IOException { public OutputStream getOutputStream() throws IOException {
if (entity == null) if (entity == null)
@ -369,6 +393,7 @@ public OutputStream getOutputStream() throws IOException {
return entity.getBuffer(); return entity.getBuffer();
} }
/** {@inheritDoc} */
@Override @Override
public void setChunkedStreamingMode(int chunklen) { public void setChunkedStreamingMode(int chunklen) {
if (entity == null) if (entity == null)
@ -376,26 +401,31 @@ public void setChunkedStreamingMode(int chunklen) {
entity.setChunked(true); entity.setChunked(true);
} }
/** {@inheritDoc} */
@Override @Override
public String getRequestMethod() { public String getRequestMethod() {
return method; return method;
} }
/** {@inheritDoc} */
@Override @Override
public boolean usingProxy() { public boolean usingProxy() {
return isUsingProxy; return isUsingProxy;
} }
/** {@inheritDoc} */
@Override @Override
public void connect() throws IOException { public void connect() throws IOException {
execute(); execute();
} }
/** {@inheritDoc} */
@Override @Override
public void setHostnameVerifier(final HostnameVerifier hostnameverifier) { public void setHostnameVerifier(final HostnameVerifier hostnameverifier) {
this.hostnameverifier = hostnameverifier; this.hostnameverifier = hostnameverifier;
} }
/** {@inheritDoc} */
@Override @Override
public void configure(KeyManager[] km, TrustManager[] tm, public void configure(KeyManager[] km, TrustManager[] tm,
SecureRandom random) throws KeyManagementException { SecureRandom random) throws KeyManagementException {

View File

@ -50,16 +50,19 @@
import org.eclipse.jgit.transport.http.HttpConnectionFactory; import org.eclipse.jgit.transport.http.HttpConnectionFactory;
/** /**
* A factory returning instances of {@link HttpClientConnection} * A factory returning instances of
* {@link org.eclipse.jgit.transport.http.apache.HttpClientConnection}
* *
* @since 3.3 * @since 3.3
*/ */
public class HttpClientConnectionFactory implements HttpConnectionFactory { public class HttpClientConnectionFactory implements HttpConnectionFactory {
/** {@inheritDoc} */
@Override @Override
public HttpConnection create(URL url) throws IOException { public HttpConnection create(URL url) throws IOException {
return new HttpClientConnection(url.toString()); return new HttpClientConnection(url.toString());
} }
/** {@inheritDoc} */
@Override @Override
public HttpConnection create(URL url, Proxy proxy) public HttpConnection create(URL url, Proxy proxy)
throws IOException { throws IOException {

View File

@ -46,12 +46,12 @@
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import org.apache.http.HttpEntity;
import org.apache.http.entity.AbstractHttpEntity; import org.apache.http.entity.AbstractHttpEntity;
import org.eclipse.jgit.util.TemporaryBuffer; import org.eclipse.jgit.util.TemporaryBuffer;
/** /**
* A {@link HttpEntity} which takes it's content from a {@link TemporaryBuffer} * A {@link org.apache.http.HttpEntity} which takes its content from a
* {@link org.eclipse.jgit.util.TemporaryBuffer}
* *
* @since 3.3 * @since 3.3
*/ */
@ -62,8 +62,8 @@ public class TemporaryBufferEntity extends AbstractHttpEntity
private Integer contentLength; private Integer contentLength;
/** /**
* Construct a new {@link HttpEntity} which will contain the content stored * Construct a new {@link org.apache.http.HttpEntity} which will contain the
* in the specified buffer * content stored in the specified buffer
* *
* @param buffer * @param buffer
*/ */
@ -72,17 +72,21 @@ public TemporaryBufferEntity(TemporaryBuffer buffer) {
} }
/** /**
* Get the <code>buffer</code> containing the content
*
* @return buffer containing the content * @return buffer containing the content
*/ */
public TemporaryBuffer getBuffer() { public TemporaryBuffer getBuffer() {
return buffer; return buffer;
} }
/** {@inheritDoc} */
@Override @Override
public boolean isRepeatable() { public boolean isRepeatable() {
return true; return true;
} }
/** {@inheritDoc} */
@Override @Override
public long getContentLength() { public long getContentLength() {
if (contentLength != null) if (contentLength != null)
@ -90,23 +94,28 @@ public long getContentLength() {
return buffer.length(); return buffer.length();
} }
/** {@inheritDoc} */
@Override @Override
public InputStream getContent() throws IOException, IllegalStateException { public InputStream getContent() throws IOException, IllegalStateException {
return buffer.openInputStream(); return buffer.openInputStream();
} }
/** {@inheritDoc} */
@Override @Override
public void writeTo(OutputStream outstream) throws IOException { public void writeTo(OutputStream outstream) throws IOException {
// TODO: dont we need a progressmonitor // TODO: dont we need a progressmonitor
buffer.writeTo(outstream, null); buffer.writeTo(outstream, null);
} }
/** {@inheritDoc} */
@Override @Override
public boolean isStreaming() { public boolean isStreaming() {
return false; return false;
} }
/** /**
* Set the <code>contentLength</code>
*
* @param contentLength * @param contentLength
*/ */
public void setContentLength(int contentLength) { public void setContentLength(int contentLength) {
@ -114,8 +123,9 @@ public void setContentLength(int contentLength) {
} }
/** /**
* Close destroys the associated buffer used to buffer the entity * {@inheritDoc}
* *
* Close destroys the associated buffer used to buffer the entity
* @since 4.5 * @since 4.5
*/ */
@Override @Override

View File

@ -51,6 +51,8 @@
*/ */
public class HttpApacheText extends TranslationBundle { public class HttpApacheText extends TranslationBundle {
/** /**
* Get an instance of this translation bundle.
*
* @return an instance of this translation bundle * @return an instance of this translation bundle
*/ */
public static HttpApacheText get() { public static HttpApacheText get() {