that topic was already brought before and didn't succeed
On 1/31/07, Ole Ersoy <[EMAIL PROTECTED]> wrote:
I noticed that there seems to be a lot of
overlap between Archiva's approach to
file discovery and VFS's.
Should Archiva use VFS?
Overview:
http://wiki.apache.org/jakarta-commons/VFS
Using the API:
http://jakarta.apache.org/commons/vfs/api.html
Here's an example of how to get "maven-metadata.xml"
files:
public FileObject[] discoverMetadata() throws
FileSystemException
{
//MetadataDiscoverer metadataDiscoverer = new
DefaultMetadataDiscoverer();
FileSelector ff = new FileSelector()
{
public boolean includeFile(FileSelectInfo
fileInfo) throws Exception
{
FileObject fileObject = fileInfo.getFile();
return
fileObject.getName().getBaseName().contentEquals("maven-metadata.xml");
}
public boolean
traverseDescendents(FileSelectInfo fileInfo) throws
Exception
{
return true;
}
};
File file = new File("src/test/resources/");
return
VFS.getManager().resolveFile(file.getAbsolutePath()).findFiles(ff);
}
Cheers,
- Ole
____________________________________________________________________________________
The fish are biting.
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
I could give you my word as a Spaniard.
No good. I've known too many Spaniards.
-- The Princess Bride
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]