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 7031503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:48:42+00:00 2026-05-28T00:48:42+00:00

Java7 ships with a default Path implementation for local files. Is there a Path

  • 0

Java7 ships with a default Path implementation for local files. Is there a Path implementation for URLs?

For example, I should be able to copy a remote resource using the following code:

Path remote = Paths.get(new URI("http://www.example.com/foo/bar.html"));
Path local = Paths.get(new URI("/bar.html"));
Files.copy(remote, local);

Currently, this throws java.nio.file.FileSystemNotFoundException: Provider "http" not installed. I could probably implement this myself but I’d rather not reinvent the wheel.

  • 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-28T00:48:43+00:00Added an answer on May 28, 2026 at 12:48 am

    It seems like what you’re really trying to do is accomplish what FTP does – copy files from one place to another. I would suggest you find better ways to do this with existing FTP code libraries.

    URIs are not file system paths, so you can’t treat them as such. They are addresses/resource locators that, when you go there with your browser (or another client that handles them), they trigger some action as defined by the server that’s behind them. There’s no standard for what that server does, hence the flexibility of web services. Therefore, if your server is doing to accept HTTP requests in this manner to facilitate file copies, you’re going to have to roll your own, and pass the file data into a POST request.

    To say it another way, (1) don’t treat URIs like they are file system paths – they aren’t, (2) find an FTP library to copy files, and/or (3) if you really want to build a web service that does this, abstract the details of the file copying via a POST request. If you do #3 understand that what your building is pretty close to custom, and that it will probably only work on a subset of sites that follow your particular design (i.e. the ones you build yourself). There’s no standard set of parameters or “file copying” via POST command that I’m aware of that you can leverage to make this “just work” – you’re going to have to match up your HTTP request with the web service on the server side.

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

Sidebar

Related Questions

In the upcoming Java7, there is a new API to check if two file
I am using Drools Planner which ships with 21 Jar files in a directory
C:\Users\shilps\Desktop>set PATH=%PATH%;C:\Program Files\Java\jdk1.6.0_22\bin C:\Users\shilps\Desktop>javac Populate.java C:\Users\shilps\Desktop>SET CLASSPATH = .;mysql-connector-java-5.1.13-bin.jar C:\Users\shilps\Desktop>java Populate db.properties flights.data reservations.data
Is there any tool that can remove debug info from Java .class files, just
Googled for a Xml Dom open source library that ships with unit tests, but
The Java world has a JSR-286 standard for how portals and portlets should interoperate:
Configuration: I'm running stock Fedora 12 with the ant that Fedora ships: ant-1.7.1-12.fc12 java-1.6.0-openjdk-1.6.0.0-33.b16.fc12
I am using Rational Application Developer v7.0 that ships with an integrated test environment.
I want to be able to display some simple chunks of HTML in my
Is there a good way to ship AES keys together with the application, but

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.