Page 1 of 2 12 LastLast
Results 1 to 20 of 27
Like Tree1Likes

Thread: Offline Downloader

  1. #1
    Sarmad.as is offline Member
    Join Date
    Nov 2013
    Posts
    27
    Rep Power
    0

    Smile Offline Downloader

    Hi Programmers I'm Building a offline website download It's a project given to me from my University I'm able to download all thi links on the page and images what i want know is how can i link those downloaded pages and images to Index.html so i can access all links and images in that page through index.html i just need an idea I'm beginner in java Thank u

  2. #2
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,009
    Rep Power
    20

    Default Re: Offline Downloader

    Moved out of JavaFX because I really can't see the relevance, and you say you;re a beginner.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    Sarmad.as is offline Member
    Join Date
    Nov 2013
    Posts
    27
    Rep Power
    0

    Default Re: Offline Downloader

    Quote Originally Posted by Tolls View Post
    Moved out of JavaFX because I really can't see the relevance, and you say you;re a beginner.
    easy friend i'm just asking and i'm new to this forum so i don't know where to post ok and thanks for your help

  4. #4
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,014
    Rep Power
    6

    Default Re: Offline Downloader

    I don't get the question anyway. What does this have to do with Java? It sounds to me like you're asking how to do some HTML stuff.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  5. #5
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    946
    Rep Power
    2

    Default Re: Offline Downloader

    Smells like a crawler. Here's a list of projects that have done just that: Open Source Crawlers in Java

  6. #6
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,606
    Rep Power
    5

    Default Re: Offline Downloader

    Actually, when I read this I thought it was sort of an oxymoron. How can you download anything unless you are online (i.e. plugged into the internet)?

    Regards,
    Jim
    gimbal2 likes this.
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  7. #7
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,014
    Rep Power
    6

    Default Re: Offline Downloader

    You misread though. Its a tool to download a website. Hence the download is done when online, so you can later access the site when offline. And I interpret the actual question being about generating an index.html file to wire the offline site together. In other words, nothing to do with Java really.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  8. #8
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    946
    Rep Power
    2

    Default Re: Offline Downloader

    Quote Originally Posted by gimbal2 View Post
    In other words, nothing to do with Java really.
    Maybe he is supposed to write this in Java?

  9. #9
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,606
    Rep Power
    5

    Default Re: Offline Downloader

    My assumption too. Because, as you said/implied earlier, there are lots of tools already written to mirror sites.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  10. #10
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,014
    Rep Power
    6

    Default Re: Offline Downloader

    Quote Originally Posted by SurfMan View Post
    Maybe he is supposed to write this in Java?
    That much is clear, but what I can't pry from this thread is WHAT is left to do in this Java program. Because I quote: "I'm able to download all thi links on the page and images" - I interpret that as that an existing piece of Java code is already doing that, but its vague.

    Further quoting: " what i want know is how can i link those downloaded pages and images to Index.html". You see this is the heart of the question: something revolving around an index.html to link up all that stuff that is already downloaded. Is it as simple as how do I create this index.html file? That would be an HTML question.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  11. #11
    Sarmad.as is offline Member
    Join Date
    Nov 2013
    Posts
    27
    Rep Power
    0

    Default Re: Offline Downloader

    Friends Friends catching links from href and downloading the pages it's done but the Home page Index.html i can't access those links (Herf)
    pages Through my home page

  12. #12
    Sarmad.as is offline Member
    Join Date
    Nov 2013
    Posts
    27
    Rep Power
    0

    Default Re: Offline Downloader

    can you guys help me to bulid this offlinewebsite downloader I Don't know much about java but I've Coverd C++

  13. #13
    Sarmad.as is offline Member
    Join Date
    Nov 2013
    Posts
    27
    Rep Power
    0

    Default Re: Offline Downloader

    I WIll Appreciate Your Help Please

  14. #14
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    946
    Rep Power
    2

    Default Re: Offline Downloader

    Help != Doing all the work for you

    This is a forum, you post your stuff that "doesn't work" with a proper explanation, stacktrace, SSCCE, and maybe we'll look into it, to see if we can help you fix it (and in the process help you understand it as well).

    This is not rent-a-coder.com.

  15. #15
    Sarmad.as is offline Member
    Join Date
    Nov 2013
    Posts
    27
    Rep Power
    0

    Default Re: Offline Downloader

    this is the function to download page from website function receive 2 arguments first the link (href) and second name of the link
    how can i save the page with the orginal name that's on the website if you know what i mean
    Java Code:
    public void downloadpage(String Link,String Name)throws Exception{
        url  = new URL(Link);
        String name;
       
        name = "D:\\wegpages\\"+Name+".html";
        reader = new BufferedReader(new InputStreamReader(url.openStream()));
        writer = new BufferedWriter(new FileWriter(name));
          String line;
          while ((line = reader.readLine()) != null) {
             System.out.println(line);
             writer.write(line);
             writer.newLine();
          }
          reader.close();
          writer.close();
        
    }

  16. #16
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    946
    Rep Power
    2

    Default Re: Offline Downloader

    An URL points to a resource (Look up the abbreviation for "URL"). The last part of the URL usually contains the name of the resource. It's not guaranteed to be a filename though. You could parse the Link variable (variables always start with lowercase character, so it should be "link" and not "Link"), and read what's behind the last /

    The meaning of "original name on the website" is vague. Does that mean the URL part? The title? The company name under the logo?

  17. #17
    Sarmad.as is offline Member
    Join Date
    Nov 2013
    Posts
    27
    Rep Power
    0

    Default Re: Offline Downloader

    Quote Originally Posted by SurfMan View Post
    and read what's behind the last /
    can you please guid me how can i do that

  18. #18
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,014
    Rep Power
    6

    Default Re: Offline Downloader

    Quote Originally Posted by Sarmad.as View Post
    can you please guid me how can i do that
    Strings (The Java™ Tutorials > Learning the Java Language > Numbers and Strings)
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  19. #19
    Sarmad.as is offline Member
    Join Date
    Nov 2013
    Posts
    27
    Rep Power
    0

    Default Re: Offline Downloader

    Thanks and another thing how can i set column headers names

  20. #20
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,014
    Rep Power
    6

    Default Re: Offline Downloader

    Quote Originally Posted by Sarmad.as View Post
    Thanks and another thing how can i set column headers names
    Which column header names :s
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 3
    Last Post: 01-16-2012, 11:12 AM
  2. How can i run this Applet offline?
    By echo9 in forum Java Applets
    Replies: 0
    Last Post: 10-23-2010, 07:41 PM
  3. Offline browsing issues
    By stthepan in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 04-16-2010, 07:50 AM
  4. connect JDBC to offline database
    By nancyhung in forum JDBC
    Replies: 1
    Last Post: 04-11-2008, 11:04 PM
  5. Offline Web browser
    By one198 in forum New To Java
    Replies: 6
    Last Post: 08-02-2007, 03:54 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •