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