Representation entity = request.getEntity();
if (request.isEntityAvailable()) { Representation entity = request.getEntity();
	public Status sendRequest(Request request)	{		Status result = null;		try		{			Representation entity = request.getEntity();			if (entity != null)			{				// Adjust the streaming mode				if (entity.getSize() > 0)				{					// The size of the entity is known in advance					getConnection().setFixedLengthStreamingMode((int) entity.getSize());				}				else				{					// The size of the entity is not known in advance					if (getHelper().getChunkLength() >= 0)					{						// Use chunked encoding						getConnection().setChunkedStreamingMode(getHelper().getChunkLength());					}					else					{						// Use entity buffering to determine the content length					}				}			}			// Set the request method			getConnection().setRequestMethod(getMethod());			// Set the request headers			for (Parameter header : getRequestHeaders())			{				getConnection().addRequestProperty(header.getName(), header.getValue());			}			// Ensure that the connections is active			getConnection().connect();			// Send the optional entity			result = super.sendRequest(request);		}		catch (ConnectException ce)		{			getHelper().getLogger().log(Level.FINE,					"An error occured during the connection to the remote HTTP server.", ce);			result = new Status(Status.CONNECTOR_ERROR_CONNECTION,					"Unable to connect to the remote server. " + ce.getMessage());		}		catch (SocketTimeoutException ste)		{			getHelper()					.getLogger()					.log(							Level.FINE,							"An timeout error occured during the communication with the remote HTTP server.",							ste);			result = new Status(Status.CONNECTOR_ERROR_COMMUNICATION,					"Unable to complete the HTTP call due to a communication timeout error. "							+ ste.getMessage());		}		catch (FileNotFoundException fnfe)		{			getHelper().getLogger().log(Level.FINE,					"An unexpected error occured during the sending of the HTTP request.",					fnfe);			result = new Status(Status.CONNECTOR_ERROR_INTERNAL,					"Unable to find a local file for sending. " + fnfe.getMessage());		}		catch (IOException ioe)		{			getHelper().getLogger().log(Level.FINE,					"An error occured during the communication with the remote HTTP server.",					ioe);			result = new Status(Status.CONNECTOR_ERROR_COMMUNICATION,					"Unable to complete the HTTP call due to a communication error with the remote server. "							+ ioe.getMessage());		}		catch (Exception e)		{			getHelper().getLogger().log(Level.FINE,					"An unexpected error occured during the sending of the HTTP request.", e);			result = new Status(Status.CONNECTOR_ERROR_INTERNAL,					"Unable to send the HTTP request. " + e.getMessage());		}		return result;	}