Browse Source

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

Change-Id: I38a4854856b0103790a410b48c1c3d708b6500c1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-4.10
Matthias Sohn 7 years ago
parent
commit
53891d4eda
  1. 32
      org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java
  2. 5
      org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnectionFactory.java
  3. 20
      org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/TemporaryBufferEntity.java
  4. 2
      org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/internal/HttpApacheText.java

32
org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java

@ -96,7 +96,8 @@ import org.eclipse.jgit.util.TemporaryBuffer;
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 class HttpClientConnection implements HttpConnection {
} }
/** /**
* Constructor for HttpClientConnection.
*
* @param urlStr * @param urlStr
* @throws MalformedURLException * @throws MalformedURLException
*/ */
@ -196,6 +199,8 @@ public class HttpClientConnection implements HttpConnection {
} }
/** /**
* Constructor for HttpClientConnection.
*
* @param urlStr * @param urlStr
* @param proxy * @param proxy
* @throws MalformedURLException * @throws MalformedURLException
@ -206,6 +211,8 @@ public class HttpClientConnection implements HttpConnection {
} }
/** /**
* Constructor for HttpClientConnection.
*
* @param urlStr * @param urlStr
* @param proxy * @param proxy
* @param cl * @param cl
@ -218,17 +225,20 @@ public class HttpClientConnection implements HttpConnection {
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 @@ public class HttpClientConnection implements HttpConnection {
} }
} }
/** {@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 class HttpClientConnection implements HttpConnection {
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 class HttpClientConnection implements HttpConnection {
} }
} }
/** {@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 class HttpClientConnection implements HttpConnection {
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 class HttpClientConnection implements HttpConnection {
} }
} }
/** {@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 class HttpClientConnection implements HttpConnection {
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 class HttpClientConnection implements HttpConnection {
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 class HttpClientConnection implements HttpConnection {
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 {

5
org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnectionFactory.java

@ -50,16 +50,19 @@ import org.eclipse.jgit.transport.http.HttpConnection;
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 {

20
org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/TemporaryBufferEntity.java

@ -46,12 +46,12 @@ import java.io.IOException;
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 class TemporaryBufferEntity extends AbstractHttpEntity
} }
/** /**
* 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 class TemporaryBufferEntity extends AbstractHttpEntity
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 class TemporaryBufferEntity extends AbstractHttpEntity
} }
/** /**
* 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

2
org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/internal/HttpApacheText.java

@ -51,6 +51,8 @@ import org.eclipse.jgit.nls.TranslationBundle;
*/ */
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() {

Loading…
Cancel
Save