Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6231339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:55:07+00:00 2026-05-24T09:55:07+00:00

I am making a download utility in java which will download files from the

  • 0

I am making a download utility in java which will download files from the ftp server.
I am using URLConnection class to establish connection and inputstream as the stream object.
The problem that i am facing is in the network failure scenario i.e
while downloading a particular file if the connectivity is lost and after the connectivity is restored i want it to resume downloading from where it had stopped previously.

To achieve this i have done the foll :-

/*Here,I am trying to skip the number of bytes downloaded so far so as to get the pointer in stream from where it should resume downloading.The skip() method may not necessarily skip the number of bytes given as a parameter and hence the while loop.
*/

while(totalByteSkipped!=downloaded) 
{ 
      bytesSkipped = stream.skip(downloaded-totalByteSkipped); 

      totalByteSkipped = totalByteSkipped+bytesSkipped; 
} 

But this approach of manually skipping so many bytes is very slow and affects the overall time of download, hence in such a case i need a mechanism to get the pointer in the stream at the point where it had stopped downloading.

Hoping to get an alternative approach on the same.
Thanks!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T09:55:07+00:00Added an answer on May 24, 2026 at 9:55 am

    You need to implement FPT restart in order to resume downloads. If your server supports it, then you can tell it the offset in the file.

    Is there any reason why you are not using an already existent FTP Client? Commons Net FTP Client supports restart.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making an Android app where the user can download files from a FTP-server.
I'm making in house application that download data via xml files from external server.
I'm making asynchronous requests with WebRequest.BeginGetResponse to download files from a server. All works
I'm making a website, using codeigniter, that will enable users to download files a
I am new android, i'm making an app in which one can download files
I am making a site which will have music playing on the site using
I'm making a website where users can log on and download files, using the
I am making a PHP script that will download a file given a name
I am making a C# project in which I am using ScintillaNet, and it
I'm making a program which downloads files over http. I've got it downloading, however

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.