001 package railo.commons.net.http.httpclient3.entity; 002 003 import java.io.IOException; 004 import java.io.OutputStream; 005 006 import org.apache.commons.httpclient.methods.RequestEntity; 007 008 009 public class EmptyRequestEntity implements RequestEntity,Entity3 { 010 011 private final String contentType; 012 013 /** 014 * Constructor of the class 015 * @param contentType 016 */ 017 public EmptyRequestEntity(String contentType) { 018 this.contentType=contentType; 019 } 020 021 @Override 022 public long getContentLength() { 023 return 0; 024 } 025 026 @Override 027 public String getContentType() { 028 return contentType; 029 } 030 031 @Override 032 public boolean isRepeatable() { 033 return true; 034 } 035 036 public void writeRequest(OutputStream os) throws IOException { 037 // do nothing 038 } 039 040 @Override 041 public long contentLength() { 042 return getContentLength(); 043 } 044 045 @Override 046 public String contentType() { 047 return getContentType(); 048 } 049 }