KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > webdav > lib > properties > GetContentLengthProperty


1 /*
2  * $Header: /home/cvs/jakarta-slide/webdavclient/clientlib/src/java/org/apache/webdav/lib/properties/GetContentLengthProperty.java,v 1.3.2.1 2004/09/26 14:19:20 luetzkendorf Exp $
3  * $Revision: 1.3.2.1 $
4  * $Date: 2004/09/26 14:19:20 $
5  *
6  * ====================================================================
7  *
8  * Copyright 1999-2002 The Apache Software Foundation
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */

23 package org.apache.webdav.lib.properties;
24
25 import org.apache.webdav.lib.BaseProperty;
26 import org.apache.webdav.lib.ResponseEntity;
27 import org.apache.webdav.lib.util.DOMUtils;
28 import org.w3c.dom.Element JavaDoc;
29
30 /**
31  * @version $Revision: 1.3.2.1 $
32  */

33 public class GetContentLengthProperty extends BaseProperty {
34     
35     public static final String JavaDoc TAG_NAME = "getcontentlength";
36
37     public GetContentLengthProperty(ResponseEntity response, Element JavaDoc element)
38     {
39         super(response, element);
40     }
41     
42     /**
43      * Get the content length.
44      *
45      * @throws NumberFormatException
46      */

47     public long getLength() {
48         return Long.parseLong(DOMUtils.getTextValue(element));
49     }
50 }
51
Popular Tags