Преглед на файлове

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

Change-Id: I38a4854856b0103790a410b48c1c3d708b6500c1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
tags/v4.10.0.201712302008-r
Matthias Sohn преди 6 години
родител
ревизия
53891d4eda

+ 31
- 1
org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java Целия файл

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
*/ */
} }


/** /**
* Constructor for HttpClientConnection.
*
* @param urlStr * @param urlStr
* @throws MalformedURLException * @throws MalformedURLException
*/ */
} }


/** /**
* Constructor for HttpClientConnection.
*
* @param urlStr * @param urlStr
* @param proxy * @param proxy
* @throws MalformedURLException * @throws MalformedURLException
} }


/** /**
* Constructor for HttpClientConnection.
*
* @param urlStr * @param urlStr
* @param proxy * @param proxy
* @param cl * @param 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();
} }
} }


/** {@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<>();
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;
} }
} }


/** {@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();
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$
} }
} }


/** {@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)
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)
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)
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 {

+ 4
- 1
org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnectionFactory.java Целия файл

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 {

+ 15
- 5
org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/TemporaryBufferEntity.java Целия файл

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
*/ */
private Integer contentLength; private Integer contentLength;


/** /**
* Construct a new {@link HttpEntity} which will contain the content stored
* in the specified buffer
* Construct a new {@link org.apache.http.HttpEntity} which will contain the
* content stored in the specified buffer
* *
* @param buffer * @param 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)
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) {
} }


/** /**
* 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
- 0
org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/internal/HttpApacheText.java Целия файл

*/ */
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…
Отказ
Запис