• Post Reply Bookmark Topic Watch Topic
  • New Topic

wildcarding a URL  RSS feed

 
Shane Ray
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want my Java client to download for e.g. all XML files from a remote server through FTP. In other words, I want the URL to look something like this:
URL url = new URL("ftp://userName swd@ftp.site.com/*.xml")

How can I achieve this? In other words, is there some way I can retrieve all the file names that meet that wildcard criteria and then subsequently download those files one at a time.

Can a URL contain wildcard chars? If I have my information correct, the concerned RFC says it cannot contain wildcards.

Thnx
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

First, a bit of business: you may not have read our naming policy on the way in. It reqiures that you use a full, real (sounding) first and last name for your display name. Initials aren't enough. You can change your display name here. Thanks, pardner!

Now, as to your question: no, URLs can't have wildcards, but the FTP protocol includes the LIST command and other commands to let you navigate through the file system and list the available files. You could use a client library like Jakarta Commons Net to get easy access to this functionality.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!