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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:53:46+00:00 2026-06-09T16:53:46+00:00

In java.net.url there is a getFile() method and a getPath() method. In my testing,

  • 0

In java.net.url there is a getFile() method and a getPath() method.

In my testing, they both return the same result: the full path and file after the domain name trailing slash.

For instance, http://www.google.com/x/y/z.html returns x/y/z.html for both methods.

Could someone elaborate on the Javadocs?

  • 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-06-09T16:53:47+00:00Added an answer on June 9, 2026 at 4:53 pm

    The URL.getFile() javadocs say this:

    Gets the file name of this URL. The returned file portion will be the same as getPath(), plus the concatenation of the value of getQuery(), if any. If there is no query portion, this method and getPath() will return identical results.

    They will be the same unless there is a query string, e.g. a ?somename=value&somethingelse=value2 in the URL.

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

Sidebar

Related Questions

I was using the java.net.URL.openStream() method to retrieve content from the server. I recently
URL u=new URL("telnet://route-server.exodus.net"); This line is generating : java.net.MalformedURLException: unknown protocol: telnet And I
this is my pom.xml <repositories> <repository> <url>http://download.java.net/maven/2/</url> <id>hibernate-support</id> <layout>default</layout> <name>Repository for library Library[hibernate-support]</name> </repository>
It seems the java.net.NetworkInterface implementation of android does not have a byte[] getHardwareAddress() method
import java.net.URL; import java.net.URLConnection; import java.sql.*; public class searchlink{ public static void main(String args[])
I'm trying to convert inputText to java.net.URL in JSF page: ... <h:form> <h:inputText value=${myBean.url}
My question is simple. I'm trying to make a set of java.net.URL s that
On large-scale Java/.Net Enterprise projects, does every developer need to have all the components/libraries/dependencies
Although the java.net.Socket and java.net.ServetSocket give me powerful networking capabilities I wouldn't want to
At http://jaxb.java.net/ it says JAXB its under dual license consisting of the CDDL v1.0

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.