How to list files (*.doc, *.mp3, *.txt) of website in Java???

Hi All,
I like to do a search using specific file type (*.doc, *.mp3, *.txt) and need to get the exact links from a web-site.
Basically search a complete, entire URL for specific file types ie. specific file extensions
for example,
http://123.com
I like to search for specific file types throughout the links starts with this address. ex: http://123.com/pages http://123.com/emp http://123.com/later etc.,
if i give *.doc it should display me the exact links whereever the document files present in the particular web-site.
How to achieve this in Java?
Thanks,
Kathir

The first line of the 'webripper' page "Webripper works as a spider that can search a web page for only the stuff that you are interested in." . In other words it parses a web page and extracts all the links then downloads the content of each link. Presumably it does the recursively.
Note - using this technique does not allow you to find ALL the 'files' on a web server. Just those that are referenced on pages you can access.

Similar Messages

  • How to list files from .jar file in applet?

    I have created applet and export all files to .jar file.
    I use File.list() method in applet to list files from one directory and that works ok but if I try to do that from web browser it sends exception AccessDenied meaning that File.list() isn't allowed in browser.
    I know what's the problem but I don't know how to solve it.
    What I want is to read from directory list of files.
    Help anyone?

    I will post here my code so that can be seen what I want to do:
    import java.awt.BorderLayout;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.net.URLClassLoader;
    import java.nio.charset.Charset;
    import javax.swing.JApplet;
    import javax.swing.JPanel;
    import javax.swing.JTextPane;
    public class test extends JApplet {
         private static final long serialVersionUID = 1L;
         private JPanel jContentPane = null;
         private JTextPane jTextPane = null;
          * This is the xxx default constructor
         public test() {
              super();
          * This method initializes this
          * @return void
         public void init() {
              this.setSize(449, 317);
              this.setContentPane(getJContentPane());
          * This method initializes jContentPane
          * @return javax.swing.JPanel
         private JPanel getJContentPane() {
              if (jContentPane == null) {
                   jContentPane = new JPanel();
                   jContentPane.setLayout(new BorderLayout());
                   jContentPane.add(getJTextPane(), BorderLayout.CENTER);
              return jContentPane;
          * This method initializes jTextPane     
          * @return javax.swing.JTextPane     
         private JTextPane getJTextPane() {
              if (jTextPane == null) {
                   jTextPane = new JTextPane();
              return jTextPane;
         public void start(){
              File fileDir= new File("somedirectory");
              String strFiles[]= fileDir.list();
              String a="";
              for(int i =0;i<strFiles.length;i++){
                   a=a+strFiles;
              this.jTextPane.setText(a);
    Method init() is irelevant, it just adds JTextPane in applet.
    Method start() is relevant, it runs normaly when started from Eclipse but from browser it sends exception AccessDenied.

  • Toshiba 20GB F series - How to change files to mp3?

    Hello :)
    This is my first post here. I have had +Toshiba 20 Gb F series+ for over 4 years. Recently it has been acting weird, the directional buttons weren't responding and I decided to back up all my files. So I made a copy of everything I had on my Gigabeat on the hard drive. My GB died 2 days a go (rip) and I tried to listen to my music on the hard drive but the windows does not recognize the format.
    So my question is how do I change the format of the files back to *Mp3*? I asked this question in others boards and they told me to post it here since you guys are more familiar with this problem. If you happen to know the answer can you please tell me a step by step instruction? Like what program I need to use and etc.
    Any help is greatly appreciated!

    > I asked this question in others boards and they told me to post it here since you guys are more familiar with this problem.
    First of all here in the forum you will meet the same guys like in other forums ;)
    Only one difference is that here are more Toshiba notebook owners as in other forums :)
    But I dont know why we should be familiar with such issue ?:|
    Anyway to be honest I dont understand what the problem is.
    I mean you made a backup of your files (what files?) and now you want to convert it to MP3???
    Generally if you want to convert some audio files to mp3 then you will have to use an special tool.
    In internet you will find a lot of different tools which are able to convert the audio files to different formats
    Just google for such free tools.

  • How to list files that are NOT in a .jar file?

    Is it possible to list files (resources, .gif/.jpg files, etc.) that are NOT included in the jar but are still to be considered part of the application somewhere in the jnlp-file?
    My applications requires lots of icons which I have put into .gif files. So far I kept them in individual files next to the .jar file and that worked fine.
    JWS now seems to support only stuff that is included in (a) .jar-file(s). That in itself woul not be much of a problem, however, when I include my .gif files into the .jar files they seem to get corrupted by the jar-signing process (at least that what's the code says, which can suddenly not handle these images any more).

    My previous seem to have been non-sense. The .gif file were not corrupted, but rather they were not found at all. They actually must NOT be included in the .jar file, or else they are not found. Strange enough, the .properties-file seemingly HAS to be in the .jar file to be found.
    This is something I'll probably never fully understand with java: which file-types it searches where...

  • CS4 - How to list files in order in 'Files view'

    Hi,
    I have numerous websites but some of them do not list the folders/pages order in the file view.
    Normally I have the folders at the top followed by the pages as per screen shot 1.
    I have tried refreshing the folder but no joy and I have gone to the master folder with the website and listed the files as 'details' as per my ok websites but still does not work.
    Any suggestions please.
    Thank you.
    Steve
    Screen shot 1 - CORRECT
    Screen shot 2 - COMPLETE MESS

    That second one is likely correct, listing files alphabetically by size.
    Clicking the heading "Local Files" should fix it.
    EDIT: If you click the Expand button in the files tab, it will give you more headings you can sort your files by...
    Local Files (alphabetical), Size, Type, Modified (date) and Checked Out By are the default possibilities.

  • How to list files existing in a folder ??

    hello
    I want to lis all files that are existing in a folder
    MaApp\myFolder\
    note: myApplication is as executeable Jar file
    I do somthing like that
    File []fileList = (new File(this.getClass().getResource("/MyFolder/").getPath())).listFiles();
        for(int i=0; i < fileList.length; i++){
            String srcName = fileList.getName();
    System.out.println("Filename: "+srcName);
    // but java.lang.NullPointerException will be thrown
    what is to do ????
    thanks

    that is not what I ned
    so.
    Mypp contain mor folders
    myApp/Foder1
    myApp/Folder2
    myApp/Folder3/
    in Folder3 are more files file1.txt, file2.txt,file3.txt,...
    tol list the files wich exist in Folder3
      File []fileList = (new File("Folder3\\")).listFiles();
        for(int i=0; i < fileList.length; i++){
       }this works fine
    but wenn I create an executeable jar of myApp
    I becom an NullPointerException
    becaus there is problem with the path new File("Folder3\\")
    what I want how to let jar to know the path of hiles which are in Folder3
    thanks

  • How to upload files (.doc./.pdf) to the database?

    Hello,
    I know this question was raised several times before but the answers don't really make me happy.
    I have a table with a BLOB-column for the documents (different mime-types) and a varchar2(100)-column for the mime type.
    I edited the form in navigator an told the blob-field to store mime-information in the mime-type-field.
    Now, do i have to tell portal the mime-type or does it retrieve it itself?
    if i have to tell, how do i do so?
    How can i fill in the value for the mime-type-field with javascript, when the fieldname is something like abc.def.ghi?
    Javascript then will tell me that document.forms.fieldname is not an object.
    Wouldn't it be a good idea to write a howto on this subject (and other subjects too, of course)? I'll do the work if you share your knowledge with me.
    And, by the way, can you share your wisdom about retrieving the blobs from tha database for displaying and download, too?
    thank you very much,
    Ralf Schmitt

    Hi Ralf,
    see in the design time if you are
    1)Interested in only one type of content in the blob column then just mention that mime-type in the
    for eg.there will be text field "or type in fixed mime type" where you can mention the default type which you are interested in uploading.
    2)If you intent to upload files of diffrent type of mime-types then you will have to associate a column for storing the mime types for that file and for this there will be a text field.
    for eg. you will have options for "Select a column to store mime information" which will be having list of all the remaining fields in the LOV , you select which field of the table you wish to make for storing mime-type and do not set any default mime-type in the text "or type in fixed mime type" in this case.
    more explaination:
    =================
    for this case create a table like this :
    create table for_blob(id number(4),file_name blob,mime_type_of_file varchar2(400));
    when you select file_name field while designing the form you will have following option.
    "Select a column to store mime information" ---> select mime_type_of_file
    "or type in fixed mime type" ---> delete the content of this text field.
    Now when you will actually run the form you have to insert mime-types in the text "mime_type_of_file " for eg
    for PDF files: Application/pdf
    for msword :Application/msword
    for the first case just input the mime-type which you wish to upload.
    "or type in fixed mime type" ---> delete the content of this text field say for eg for PDF files:Application/pdf
    so that at run time you do not have to input any mime-type info and in this case even the field need not have the column for the mime-type.
    hope this help.
    rahul

  • How To List Files On File System

    Hi,
    I have a requirement to display a list of files to the user that are in a directory on the database server. We are using XE so cannot use java in the db. Any pointers appriciated
    Thanks
    Chris

    I have a requirement to display a list of files to the user that are in a directory on the database server. We are using XE so cannot use java in the db. Any pointers appriciatedAssuming Windows as the OS here, although similar approaches could work on *nix:
    1.a) Set up a scheduled task to run a bat file that lists the contents of the directory (via the "dir" command) and writes it to a known location (such as c:\somefolder\filelist.txt).
    1.b) If you don't want to depend on a scheduled task in the operating system, you can actually trigger the bat file via DBMS_SCHEDULER (which even on XE allows you to run OS commands from the database, just make sure the Scheduler service has been started in the OS).
    2. Read the file list using utl_file, or even as an external table (using the SQL Loader syntax, each line in the file is one row in the table).
    Obviously this is not a perfect solution, and it won't be updated in "realtime", but it can work, depending on your exact requirements.
    (And I don't know why a simple get_file_list or get_files_in_directory is still missing from UTL_FILE after all these years.... )
    - Morten
    http://ora-00001.blogspot.com

  • How to List files in a directory into an Array

    Does anyone know of the best way to load all of the files in a specified directory into an array. (not going into sub directories either).
    I was to be able to do something like this.... (pseudo)
    String directory = "C:\";
    String [] theList;
    do
    get next file name;
    add to theList;
    }while(!End of Directory)
    Done.

        public static void main(String args[]) {
         String directory = "C:\\";
         File dir = new File(directory);
         File [] theList = dir.listFiles();
         for(File file : theList)
             if(!file.isDirectory() && !file.isFile())
              System.out.println(file.getName());
         }This will list every item in the coot of C:\ that is not a file or a directory. Change the if statement to fit your needs.
    ~Tim

  • How to list files from directory in list box?

    Hi all,
    Here is what I want to implement: I have several pattern files that'd
    be sent to special motor controller. What I want is: display these
    files in the list box on the interface, so that user can click on the
    file he wants, then run the program, and this file will be the input
    to my controller.
    Thank you!

    lv 6.1 attached.
    cheers,
    ~j5
    2006 Ultimate LabVIEW G-eek.
    Attachments:
    Get_File_Names.vi ‏54 KB

  • Uploading a file (.doc, .xls, .txt) into an Oracle table with BLOB column

    Hello All :
    I have been trying to figure out for a simple code I can use in my JSP to upload a file (of any format) into an Oracle table with a BLOB column type. I have gone through a lot of existing forums but couldnot find a simple code (that doesnot use Servlet, for eg.) to implement this piece.
    Thanks a lot for your help !!

    Hi.
    First of all to put a file into Oracle you need to get the array of bytes byte[] for that file. For this use for example FileInputStream.
    After you get the byte array try to use this code:
            try {
                Connection conn = myGetDBConnection();
                PreparedStatement pstmt = conn.prepareStatement("INSERT INTO table1 (content) VALUES(?)");
                byte[] content = myGetFileAsBytes();
                if (content != null) {
                    pstmt.setBinaryStream(0, new ByteArrayInputStream(content), content.length);
                pstmt.close();
                conn.close();
            } catch (Exception ex) {
                ex.printStackTrace();
            }or instead of using ByteArrayInputStream try pstmt.setBinaryStream(0, new FileInputStream(yourFile), getFileSize());Hope this will help...
    regards, Victor Letunovsky

  • How to list files from a remote directory?

    Hi,
    I have a user interface on a PC that needs to display a directory listing of a remote RT processor.  I don't want to have the RT to use List Directory function and the PC to get this result... I'm sure there's a cleaner way to do that with FTP or DataSocket.  I've tried FTP, but it stalls in FTP Directory Listing.vi.
    Any ideas?
    Thanks!
    Patrick.

    There are a number of reasons why the Directory lister can hang. The best thing to do is try the "FTP browser.vi" found in the example finder. If you have the internet toolkit it will show up if you search for "FTP." In this example program, type in your RT unit's IP address and see if you can browse the directory structure. If it works you can use any portion of this program in your own application. Hope this helps.

  • How to add file type fiter in FileUpload component in Java Web Dynpro

    Hi All,
      In FileUpload UI, i want to set file type filter, for example as *.PDF, *.JPG, is that possibel in Java WebDynpro?
    Thanks a lot!
    Huang Jia

    hi!
    you can achieve this filter thing of file type by just taking some strings for diffrent types as extension and assign those to the resource type .
    eg.
    String extension = ".doc";
    WDWebResourceType.getWebResourceTypeForFileExtension(extension));

  • How to encrypt file on linux using Gnupg command in Java Embedding in BPEL.

    Hi All,
    I am trying to invoke a command script using the java embedding in BPEL Process.I am using the below code to execute the particular command to encrypt the file :-
    try {    
            Runtime rt = Runtime.getRuntime();    
    Process pr = rt.exec(new String[] {"/bin/bash", "-c", "/u01/GnuPG/bin/gpg", "-e", "-r", "Developer","/u01/oracle/ConfigFiles/Adapter_controlDir/abc.csv"});    
             int exitVal = pr.waitFor();            
            String result = "SUCCESS: Process exit with " + exitVal;         
            addAuditTrailEntry("result = "+result);      
            setVariableData("outputVariable","payload","/client:processResponse/client:result",result);    
    } catch(Exception e) {    
            e.printStackTrace();      
      String result = "FAILURE: Exception with " + e.toString();    
            addAuditTrailEntry("result = "+result);      
            setVariableData("outputVariable","payload","/client:processResponse/client:result",result);    
    The above statement does nothing. I am not sure what command i need to use to access to the command line.
    When i try this particular statement from linux machine command prompt :- /u01/GnuPG/bin/gpg -e  -r  Developer /u01/oracle/ConfigFiles/Adapter_controlDir/abc.csv
    It works absolutely fine and it creates the encrypted files also.
    Please suggest , which command i need to use from the java embedding.
    Please suggest!!
    Regards,
    Shah

    I think, you can try, writing these commands into a separate shell script and call that shell script from bpel via Java embedding. However, you might not get a return response.. but you can still give a shot.
    Hope it helps.

  • How to set file watcher

    I want to know how to set file watcher for my sql database using java.
    my doubt is i am running an web application in a web server.
    the user information are stored one databse.
    i want that user details in other databases.
    it will do automatically.
    when ever new values are stored one database then automatically that value transfered in other data base.
    i want urgent.
    please help me
    thanks

    It seems like the most natural way to do that would be with database triggers, if your DB allows its triggers to interact with the world outside the DB--e.g. invoking Java code, invoking some other process, opening a socket, etc.

Maybe you are looking for