Retrieve file/directory listing from a URL

I am building an applet to view images located on a given URL (not the same as the codebase URL...). The problem is how to see which directories and files that are located on the given URL? File.list() works fine as long as I'm the pictures are located on my own computer, but I would like to do something like:
File f = new File(new URL("http://.../imagelibrary"));
String [] x = f.list();
Please help me out!
You'll get credited for it - I promise!
/Markus

Hi,
I make a try to help you. A applet has only a HttpConnection to the server. Typical over this connection you can receive a file. E.g., when you connect the http-server by a browser, you becomes a html-page, with a table or list from the directory,when it allowed. Over a HttpURLConnection you can receive this html-code by the following code-snippet:public class DownLoad {
     public static void main(String args[]) {
          try {
               java.net.URL url = new java.net.URL("http://localhost:8080/../images/");
               java.io.InputStream in = url.openStream();
               int count = in.available();
               byte content[] = new byte[count];
               in.read(content, 0, count);
               String contentAsString = new String(content, 0, count);
               System.out.println(contentAsString);
          } catch (Exception e) {
               e.printStackTrace();
}Now you can show this in the applet directly or you parse the contentAsString and find the entry in the table/list.
Hope thats help
Roland

Similar Messages

  • Directory listing from my OS X 10.5.8 server into a text file

    Does anyone know how I can get a directory listing from my server, which I can put into an Excel Spreadsheet?
    Thanks

    Download the free TextWrangler and drag the enclosing folder into it. Alternatively, open the AppleScript Editor in the /Applications/Utilities/ folder, paste the following in:
    do shell script "ls -AR " & quoted form of POSIX path of ((choose folder) as alias) & " >> ~/Desktop/inventory.txt"
    and run it as is.
    (104088)

  • TS4118 Can I retrieve to do list from old calendar after upgrading to mountain lion?

    Can I retrieve "to do list" from old calendar after upgrading to mountain lion?

    Hello MacMystie,
    Thank you for using Apple Support Communities. 
    If you have a recent backup with the old "to do list" you can use the following article will provide information on recovering information from a backup. 
    Recovering iCloud contacts, calendars, and bookmarks from an iTunes backup of an iOS device - Apple Support
    Regards,
    Jeff D. 

  • Cannot "enable directory listing" from the wadm CLI

    With SJSWS 6.1 sp1 up to sp11, there was a documented bug that caused directory listing to work even though the ACL was:
    acl "default";
    authenticate (user, group) {
      prompt = "Sun ONE Web Server";
    allow (read, execute, info) user = "anyone";
    allow (list, write, delete) user = "all";With SJSWS 7.0, this bug was fixed. The default installed ACL is exactly the same from 6.1 to 7.0. e.g. the "list" right is given only to [all] authenticated user, and not everyone. So requesting a "GET /images/" will give you a 401 unauthorized, as should have happened in 6.1, which causes your browser to prompt you to login.
    By default, 7.0 webserver configs are created with directory listing enabled with "index-common". But it can also be disabled, directing the user to a defined static file on the web server disk. i.e.:
    Service method="(GET|HEAD)" type="magnus-internal/directory" fn="send-error" path="/path/on/disk/notFound.html"In either case, out of the box, neither enabling nor disabling directory listing matters because the default ACL denies directory listing in the prior case, and denies the "notFound.html" response in the later. Note "allow (list) user = all" requires authentication for the "list"privilege.
    To fix this, you change the ACL so the "list" privilege is in the first ACI, i.e., 'allow (read, execute, info, list) user = "anyone";'
    The problem is that even though the ACL file can be modified in the Admin Web GUI, it cannot be modified from the the wadm CLI.
    So, because of this, technically one cannot truly enable directory listing (wadm enable-directory-listing) using wadm. The best you can do is manually edit the existing ACL, or create a new ACL file and set that new file using wadm.
    I don't even see a way, using wadm, to dump new content into the ACL file. Without the GUI, you are stuck. And you cannot perform remote administration for this feature using wadm.
    If we admins are creating TCL scripts to automate creating and configuring webserver configs, this feature cannot be configured.
    I would like to know if I am wrong, and how I could resolve this using the wadm CLI alone.
    And if the default is going to remain that the "list" privilege requires authentication, this should be documented in the SJSWS7 documentation for enabling and disabling directory listing.

    pull-config does not work in this case because of two reasons:
    1. you must still manually edit the ACL file (can already do that on the admin server)
    2. and you must make that change on a node which has the configuration
    In my case, I want to remotely manage the configuration using wadm. But I do not want to log into one of the nodes in the server farm.
    And I want to avoid having to edit the ACL file manually if possible, or through the GUI which requires manual intelligent point-and-click efforts.
    Seems like my only bet is to:
    1. create the config via the wadm tcl shell
    2. then outside of the wadm command, execute some script that can perform a scp to the admin server, or a ssh for a local copy of a previously written ACL file - which requires a lot of extra setup to make that happen.
    3. then get back into wadm to execute the other tasks
    I want to avoid step #2.

  • Directory Listing from Web

    Hi All,
    I am trying to populate a menu with a list of PDF files from
    a particular folder. I've got this working perfectly for a local
    path using the FileXtra4 xtra, but I'm stumped with getting a
    folder from the web. I've tried the Buddy Web xtra, but it returns
    an empty list when I use:
    fileList = bwFileList("
    http://www.awebsite.com/stuff/",
    Maybe I could embed a Flash Movie and have Flash pass the
    list to Director?
    I'm using Director and Flash MX 2004
    Any help much appreciated
    Thanks guys,

    Hi,
    I'm not sure about Buddy Web xtra (I've not used it), but you
    have a couple of other options:
    1. Use the excellent free and for absolutely no sane reason
    depreciated MultiUSer Xtra to create a network connection with an
    ftp server and use standard ftp commands to get a directory
    listing. see
    http://www.lingoworkshop.com/Testzone/FTP_Client_Test.php
    2. Use getNetText to ask a server-script to return the list
    of files. This is probably the safest but is dependent on the
    server (example php script attached).

  • Directory List from XML

    I would outsource this section of a Flash site to someone who
    understands
    actionscript and xml.
    The section that needs to be created is a project title
    directory.
    The project title list or directory:
    1. needs to be created from an existing XML file.
    2. be displayed in Flash as 3 columns with a scroll when
    necessary. Each
    column lists all Proj_title's for that Category.
    3. Clicking on a Proj_title from the list would open up that
    project in the
    existing allprojects.fla.
    The All Projects page is already done and pulls its data from
    the same XML
    file.
    It displays scrolling images of products. When an image is
    clicked, a
    detailed section opens with other images and text all coming
    from the same
    xml file. This section is completed. Now with a Directory
    List, the same
    happens when clicking on a Proj_title from the list.
    The directory list is what needs to be done.
    The XML file contains: Image, Category, Proj_title,
    Thumbnail, Summary,
    Description, Picture1, Pic1Desc, Picture2, Pic2Desc,
    Picture3, Pic3Desc,
    Use, Builder, Builder etc.....
    The XML file used for the directory is the same used for the
    rest of this
    allprojects.fla..
    Please find link to see the xml file:
    www.filecondo.com/allimages.xml
    If you are interested in this freelance job please respond to
    this post.
    Thank you

    The IsGetDevice operation will get you all the devices including their extension numbers from a CME. You need to set up the router XML interface on the router as per this document: http://cisco.com/en/US/docs/voice_ip_comm/cucme/srnd/design/guide/managcme.html#wp1076023
    then follow the appropriate developer guide which you can get here: http://www.cisco.com/cgi-bin/dev_support/access_level/product_support (under voice gateway applications)
    You'll also find searching this forum for the topic useful as there are a few things the developer guide fails to mention (specifially that you need to urlencode the message before sending).

  • How to retrieve query string value from the URL in my portlet

    Hi,
    When user clicks on "Advance Search", i am redirecting to page in the community. At the same i am adding some more values to the query string (to the URL).
    My URL will look like this.
    http://ctp-mc0149/portal/server.pt?space=CommunityPage&parentname=CommunityPage&parentid=0&in_hi_userid=200&cached=true&control=SetCommunity&PageID=202&CommunityID=200&searchType=2
    Now in one of my portlet in that page, i want to retrieve the query string values from the URL.
    Please help me regarding this.
    Thanks in advance.
    Thanks,
    sreekanth.

    Hi,
    Look at the following threads,
    For programmatically getting the iview properties,
    Programmatically getting iView Properties
    Also,
    Get Properties of IView Programmatically
    Permanent change of iView property programmatically
    Hope these threads help u.
    Regards
    Srinivasan T

  • Printing a URL pdf file on Unix from a URL

    Has anyone, managed to print a pdf file from a URL to UNIX via "lp" without first saving the file and then printing from the saved file via Runtime.getRuntime().exec().
    Welcome suggestions on alternatives if not possible ?

    One simple option which doesn't explicitly require a '.exec' would be to write a Java program which writes the PDF data from the URL to the console, and pipe the output to lp from the shell.
    % java PDFURLWriter | lp
    Good luck,
    -Derek

  • Directory listing from a JAR file

    Hi,
    I want to know how i can get a list of files in a certain directory located inside a jar file.
    Thanks

    Programmatically, you need to parse the JAR with the help of java.util.zip.
    From the command prompt, you can do it with "jar -t archive.jar"

  • Retrieving Active Directory infomation from SQL Server

    Dear All
    We have a requirement to load active directory users and user groups into a SQL Server database. Looking at the information available it seems you need to create a Linked Server of type 'Active Directory Service Interfaces'. Creating a linked server will
    be a problem for out customers so I was wondering if there was another way of doing it. I will accept all ideas no matter how odd :D
    Thanks
    Peter

    Please refer the below link for incremental loading of data from AD:
    http://beyondrelational.com/modules/2/blogs/557/posts/15401/incremental-dl-porting-in-sql-server-querying-ldap-to-get-the-users-belongs-to-a-dl-group-in-sql-ser.aspx

  • [SOLVED] Pacman failed retrieving file 'core.db' after removing KDE

    Hey, I had to remove KDE and foolishly used the -Rsc flag. Now, trying to update yields:
    [root@Gal-PC2 gal]# pacman -Sy
    :: Synchronizing package databases...
    error: failed retrieving file 'core.db' from mirror.isoc.org.il : Resolving timed out after 10524 milliseconds
    error: failed retrieving file 'core.db' from mirror.us.leaseweb.net : Resolving timed out after 10523 milliseconds
    I tryed using the -Sy and -Syy flags to update the database, and made sure I am not using ipv6. I think the -Rsc flag might deleted an importent package. I can connect to the net, and I can acess mirrors using http and I can ping the mirrors. The error persists on a large number of mirrors. Any help will be appriciated.
    Last edited by Greenstuff (2015-02-08 20:49:24)

    Sorry, will do!
    The debug printed a lot of the first errors, so I cut them. This is what pacman --Syu --debug show:
    debug: adding new server URL to database 'multilib': [url]http://ftp.nluug.nl/pub/os/Linux/distr/archlinux/multilib/os/x86_64[/url]
    debug: adding new server URL to database 'multilib': [url]http://ftp.ds.hj.se/pub/os/linux/archlinux/multilib/os/x86_64[/url]
    debug: adding new server URL to database 'multilib': [url]http://ftp.uni-kl.de/pub/linux/archlinux/multilib/os/x86_64[/url]
    debug: adding new server URL to database 'multilib': [url]http://ftp.tu-chemnitz.de/pub/linux/archlinux/multilib/os/x86_64[/url]
    debug: adding new server URL to database 'multilib': [url]http://mirror.lnx.sk/pub/linux/archlinux/multilib/os/x86_64[/url]
    debug: adding new server URL to database 'multilib': [url]http://mirrors.st.uz/archlinux/multilib/os/x86_64[/url]
    debug: adding new server URL to database 'multilib': [url]http://mirrors.mithril.org.ua/linux/archlinux/multilib/os/x86_64[/url]
    debug: adding new server URL to database 'multilib': [url]http://piotrkosoft.net/pub/mirrors/ftp.archlinux.org/multilib/os/x86_64[/url]
    debug: adding new server URL to database 'multilib': [url]http://ftp.uni-bayreuth.de/linux/archlinux/multilib/os/x86_64[/url]
    debug: adding new server URL to database 'multilib': [url]http://artfiles.org/archlinux.org/multilib/os/x86_64[/url]
    debug: adding new server URL to database 'multilib': [url]http://repo.ukdw.ac.id/archlinux/multilib/os/x86_64[/url]
    debug: adding new server URL to database 'multilib': [url]http://linux.cs.nctu.edu.tw/archlinux/multilib/os/x86_64[/url]
    debug: adding new server URL to database 'multilib': [url]http://ftp.kaist.ac.kr/ArchLinux/multilib/os/x86_64[/url]
    debug: config: new section '(null)'
    debug: config: finished parsing /etc/pacman.conf
    :: Synchronizing package databases...
    debug: url: [url]http://mirror.isoc.org.il/pub/archlinux/core/os/x86_64/core.db[/url]
    debug: maxsize: 26214400
    debug: using time condition: 1422991262
    debug: opened tempfile for download: /var/lib/pacman/sync/core.db.part (wb)
    debug: curl returned error 28 from transfer
    error: failed retrieving file 'core.db' from mirror.isoc.org.il : Resolving timed out after 10523 milliseconds
    debug: url: [url]http://mirror.us.leaseweb.net/archlinux/core/os/x86_64/core.db[/url]
    debug: maxsize: 26214400
    debug: using time condition: 1422991262
    debug: opened tempfile for download: /var/lib/pacman/sync/core.db.part (wb)
    EDIT: SOLVED!
    Ok, so I did indeed disable ipv6 as I promised, but turns out I put in the GRUB kernel line "ipv6.disable_ipv6=1". Upon re-reading the wiki, turns out this means ipv6 is disabled but tunnels with ipv6 may be opened by programs. I changed to "ipv6.disable=1" and pacman updates away! I hope others will find this usefull. Be careful!
    Last edited by Greenstuff (2015-02-08 20:52:45)

  • Populate dropDown or listBox with Directory Listing

    I need to populate a dropDown or listBox component with a directory listing from the Server.
    For example:
    \Import\XML_Files\*.xml
    Can someone point me in the right direction?
    Thanks

    Here is a hint
    File directory = new File(path);
    String[] files = directory.list();
    List fileList = new ArrayList();
    Populate the "fileList" with "files" (may need to create an object to get the file name)
    Ex
    class MyFileObject(){
    private String fileName;
    public getFileName(){
    return fileName;
    Create a object list data provider with the File List above. Now bind this data provider to the drop down list
    See my blog on how to use the Object List Data Provider
    http://blogs.sun.com/roller/page/winston?entry=objectlistdp_sample_project
    - Winston
    http://blogs.sun.com/roller/page/winston?catname=Creator

  • How to Get Parameter Values from the URL ?

    Hi,
    I have built a calendar called cal_test. I am calling this calendar with this URL:
    http://.../pls/.../xyz.cal_test.show?p_arg_names=p_sc_id&p_arg_values=2&p_arg_names=_start_date&p_arg_values=FEB-2002
    In the 'Additional PL/SQL Code' tab of cal_test, I need to call a procedure which requires me to pass in as parameters the values of p_sc_id and startdate embedded in the URL named above. How can I retrieve these 2 values from the URL ? Any advice will be appreicated !
    Dorothy

    Hi Daniel
    The following thread might help;
    if not, you could try posting the question in Application Server » Web Dynpro Java
    Thanks
    Kenny

  • [SOLVED] Pacman error: failed retrieving file : No address record

    I just installed Arch on a x86 laptop using the cd as the package source. I wanted to do a net install, but when I attempted to (regardless of the mirror) I got many responses from pacman in tty7 of "No address record". This happened despite having a network connection and being able to ping any site from the cli.
    After installing, I am still having the same problem. The laptop is plugged in via ethernet, and I can ping any site I want, but a call to pacman -Syyu just returns numerous errors such as
    error: failed retrieving file 'core.db' from mirror.rit.edu : No address record
    And just as a test, I was getting replies when pinging mirror.rit.edu.
    Last edited by process91 (2011-11-18 18:21:17)

    Try the following steps:
    1 - Set the VirtualBox Networking option to NAT
    2 -  Start the arch machine in the VirtualBox
    3 -  Edit /etc/rc.conf as a dynamic IP:
    HOSTNAME="arch"
    interface=eth0
    address=
    netmask=
    broadcast=
    gateway=
    4 - Run dhcpcd
    5 -  Try to ping a couple of sites, or your router
    If you still can't ping or anything, I suggest you start a new thread specifically about your problem. Include the output from "ipconfig -a". You're not going to get much help from posting in a thread marked "[SOLVED]".
    Last edited by process91 (2012-01-18 07:21:14)

  • IPV6 issues during the installation? "error: failed retrieving file"

    Hi!
    I currently try to install Arch on my Notebook using the Newbie Guide from the German Arch Wiki. Everything seemed to work fine until I got to the point of installing the base system using
    pacstrap /mnt base base-devel wpa_supplicant
    . The downloading process fails and returns about the same error message for every mirror:
    error: failed retrieving file 'core.db' from MIRRORNAME : Resolving timed out after XY milliseconds
    I already tried to use different mirrors, but none of them worked. I tried to reach them on another machine via the browser and could access them, so they're definitly up. It therefore could be my internet connection, but I'm connected via an ethernet cable and can ping e.g. google.com or archlinux.org without any problems. I looked up the issue on different forums and almost everyone said that it's an issue caused by ipv6; I tried different workarounds, but none of them worked since most of them were used on an Arch system that was already installed but had problems with pacman. Due to the fact that I'm encountering this problem on a CD that I try to install Arch with, most of the files I'm supposed to edit to disable ipv6 aren't there (yet?) - and the other workarounds just didn't work. I really want to install Arch on my system, but can't continue with the installation when pacman can't reach the mirrors.
    I therefore need your help to solve this; like I said, it's probably an issue with ipv6, but I just can't find out how to disable it on my installation medium (I burned the archlinux-2014.11.01-dual.iso on it, if that matters).
    Last edited by Nex (2014-11-15 15:05:06)

    run ping6 -c 4 google.com and post the output.
    alss post the output of :
    ip addr
    ip route -4
    ip route -6
    Last edited by Lone_Wolf (2014-11-15 16:37:13)

Maybe you are looking for

  • How to stream movies from hard drive to apple tv

    I have an external hard drive connected to my Airport Extreme, which works for my Time Capsule and saving files wirelessly; however, I do not know how to access the movies I have on it via my Apple TV or iPhones without having my laptop open using Ho

  • Help for a live setup

    Hey everyone, I was wondering if someone could lend some advice to the following. Basically I want to run 1 microphone into logic on a single audio track with automation and effects and on a seperate audio track have the backing track playing. This i

  • Exception Handling in OWB Urgent!!!

    Hi, I want to do error handling in OWB Mapping, how to achivw the same as there is no exception handling OPERATOR provided by OWB. Please let me know its URGET... Not: OWB version is 10g R1.

  • Why can I only text 10 people with the IPhone 4s

    Why can I only text 10 people at a time with the IPhone 4s?

  • Exporting from FCP to Adobe Premier

    hi gang, so, would like to export my short film (20 min) that I've finished editing in FCP 5.1.3 but I'm seeing something strange with the final product. It's seems really fuzzy/grainy when doing playback on a PC. I think that I might be doing someth