[prev in list] [next in list] [prev in thread] [next in thread]
List: slide-user
Subject: Re: getCreationDate -- broken?
From: "Roy Russo" <roy () jboss ! com>
Date: 2004-12-29 18:39:58
Message-ID: 00ea01c4edd5$cc518cd0$4f00a8c0 () LOKI
[Download RAW message or body]
thanks. alt-2 is what I was looking for.
Roy Russo
JBoss Portal Developer
JBoss, Inc.
----- Original Message -----
From: "Stefan Lützkendorf" <luetzkendorf@apache.org>
To: "Slide Users Mailing List" <slide-user@jakarta.apache.org>
Sent: Wednesday, December 29, 2004 12:47 PM
Subject: Re: getCreationDate -- broken?
>
> Roy Russo wrote:
>
>> Using 2.1b. Is this method call broken?
>>
>> long lCreated = wdResource.getCreationDate();
> I've currently no idea why getCreationDate does not work.
>>
>> Seems like I it always returns 0. DavExplorer is showing the value is set
>> for the resource. Is there another way I can get this value for a
>> specific file?
> as a workaround you can run your own query for the creationdate property.
> i may look like the following sample.
>
> public static void main(String[] args) {
> try {
> WebdavResource resource = new WebdavResource(
> "http://localhost:8081/txfile/files",
> new UsernamePasswordCredentials("john", "john"));
>
> System.out.println( resource.getCreationDate());
>
> Vector properties = new Vector();
> properties.add(new PropertyName("DAV:", "creationdate"));
>
> Enumeration e = resource.propfindMethod(0, properties);
> if (e.hasMoreElements()) {
> ResponseEntity response = (ResponseEntity) e.nextElement();
> Enumeration props = response.getProperties();
> if (props.hasMoreElements()) {
> Property property = (Property)props.nextElement();
>
> // alternative 1
> String dateString = property.getPropertyAsString();
> // alternative 2
> Date dateDate = ((DateProperty)property).getDate();
>
> System.out.println(dateString);
> System.out.println(dateDate);
> }
>
> }
> }
> catch (HttpException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> catch (IOException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> }
>>
>> Roy Russo
>> JBoss Portal Developer
>> JBoss, Inc.
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: slide-user-help@jakarta.apache.org
>>
>
> --
> Stefan Lützkendorf -- luetzkendorf@apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic