You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Marc Palmer <ma...@anyware.co.uk> on 2005/12/19 11:09:04 UTC

VFS local filesystem lastModified problem

Hi,

I'm having a problem with Commons VFS. When any code gets the  
lastModified property from an open URLConnection to a URL provided by  
VFS, which points to the local file system, lastModified is always  
returned as zero.

The code is like this:

FileSystemManager man = VFS.getManager();
FileObject fileSys = man.resolveFile(URI); // The URI is of the form  
"file:///Users/marc/somedir/"
URL moduleURL = fileSys.getURL(); // Gets the VFS-generated URL
FileObject xmlFile = fileSys.getChild(MODULE_CONTEXT_XML_FILE);
if ((xmlFile != null) && xmlFile.exists())
{
	final URL moduleContextURL = new URL(moduleURL,  
MODULE_CONTEXT_XML_FILE);
         log.debug("Lastmodified date of module.xml is : " +
		moduleContextURL.openConnection().getLastModified());
}

The file exists however, and VFS can access it (and does), but if in  
the same application I get the lastModified value from a standard non- 
VFS URL using "file://" as the protocol, it works:

final URL contextURL = new URL(new URL(URI), MODULE_CONTEXT_XML_FILE);
log.debug("Lastmodified date: " + contextURL.openConnection 
().getLastModified());

So the problem is somewhere in VFS or my usage of it, but I can't  
work it out. Can anybody offer any insights? I'm running on Mac OSX  
10.4.3 (under JDK 1.5 rel 3) if that's an issue.

For what it's worth, I tried to find a searchable list archive but no  
joy, and no hits on google.

~ ~ ~
Marc Palmer (marc@anyware.co.uk)
Consultant/Analyst
AnyWare Ltd.
http://www.anyware.co.uk/


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [Collections] When to use a Predicate?

Posted by Stephen Colebourne <sc...@btopenworld.com>.
Bernard, Shawn wrote:
> Under what circumstanes would one use a Predicate to encase conditional logic?  I know it's a rather broad question, but I was looking at them and they seem pretty powerful, but I wouldn't want to use them incorrectly.

If you like the functor style of programming then go ahead and use it!

There is a potential downside in terms of extra classes and object 
instantiation, but on modern JVMs thats not really a big issue.

Stephen



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


[Collections] When to use a Predicate?

Posted by "Bernard, Shawn" <Sh...@turner.com>.
Under what circumstanes would one use a Predicate to encase conditional logic?  I know it's a rather broad question, but I was looking at them and they seem pretty powerful, but I wouldn't want to use them incorrectly.

Thanks,

Shawn


Re: VFS local filesystem lastModified problem

Posted by Marc Palmer <ma...@anyware.co.uk>.
On 19 Dec 2005, at 11:03, Mario Ivankovits wrote:

> Hi Marc!
>> Ah! That might explain it. If I write a fix for it do you want it?
> Sure!
>
OK, I'll try to get a look at it tomorrow.

>> Any chance of Commons/VFS moving over to the Apache JIRA any time   
>> soon? Bugzilla is so ugly...
> Beside the look I see no reason to move to JIRA.

You've obviously not used Jira much then. It's a completely different  
ballgame. A simple example: The RoadMap feature allows you to plan  
your upcoming releases by setting the fix versions, and share this  
information with people interested in the project.

Automatic release notes, filter statistics and so on. It's a - 
completely- different tool. Bugzilla is really very dated and is too  
hard for casual users to use - the UI doesn't just look bad, it is  
really awkward to use and very unintuitive.

Apache have JIRA already in place for many of their major projects.  
Commons would benefit from it too. Isn't it just a case of getting it  
imported (JIRA has Bugzilla import).

Cheers

~ ~ ~
Marc Palmer (marc@anyware.co.uk)
Consultant/Analyst
AnyWare Ltd.
http://www.anyware.co.uk/


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: VFS local filesystem lastModified problem

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi Marc!
> Ah! That might explain it. If I write a fix for it do you want it?
Sure!

> Any chance of Commons/VFS moving over to the Apache JIRA any time  
> soon? Bugzilla is so ugly...
Beside the look I see no reason to move to JIRA.


Ciao,
Mario


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: VFS local filesystem lastModified problem

Posted by Marc Palmer <ma...@anyware.co.uk>.
On 19 Dec 2005, at 10:18, Mario Ivankovits wrote:

> Hi Marc!
>> So the problem is somewhere in VFS or my usage of it, but I can't   
>> work it out. Can anybody offer any insights? I'm running on Mac  
>> OSX  10.4.3 (under JDK 1.5 rel 3) if that's an issue.
> Yes, indeed, the lastmod stuff is missing inf VFS's  
> DefaultURLConnection stuff.
> Could you please open a new ticket in bugzilla: http:// 
> issues.apache.org/bugzilla/
>

Ah! That might explain it. If I write a fix for it do you want it?


Any chance of Commons/VFS moving over to the Apache JIRA any time  
soon? Bugzilla is so ugly...

~ ~ ~
Marc Palmer (marc@anyware.co.uk)
Consultant/Analyst
AnyWare Ltd.
http://www.anyware.co.uk/


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: VFS local filesystem lastModified problem

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi Marc!
> So the problem is somewhere in VFS or my usage of it, but I can't  
> work it out. Can anybody offer any insights? I'm running on Mac OSX  
> 10.4.3 (under JDK 1.5 rel 3) if that's an issue.
Yes, indeed, the lastmod stuff is missing inf VFS's DefaultURLConnection 
stuff.
Could you please open a new ticket in bugzilla: 
http://issues.apache.org/bugzilla/

Thanks!
---
Mario


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org