Question related to GetFile and GetPath of a URL

Hello, i have the following code and i was wondering why GetFile and GetPath shall return the same output,
e.g. my example here is http://wikis.sun.com/display/SunForums/Tips
The GetPath returns : Get Path of URL /display/SunForums/Tips
and the GetFile returns : Get file of URL /display/SunForums/Tips
the same.
Well it's just that i would like to use a method which is going to output only the File of a Path, in our example the output should be only Tips.
CODE :
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.*;
public class Main {
    public static void main(String[] args) throws MalformedURLException, IOException, Exception {
                    BufferedReader in = null;
                   try {                              //try
                          URL yahoo = new URL("http://wikis.sun.com/display/SunForums/Tips");
                         String url_string = yahoo.toString();  // Constructs a string representation of URL
                         URLConnection yc = yahoo.openConnection(); //
                         in = new BufferedReader(new InputStreamReader(yc.getInputStream()));
                         System.out.println("Get file of URL " + yahoo.getFile());                            *//it should return only Tips*
                         System.out.println("Get Path of URL " + yahoo.getPath());
                          catch (MalformedURLException ex) {
                                                                              System.err.println("MalformedURLException" + ex);
         }Is there any method which returns only the file of a URL?
Thanks in advance!

new File("/display/SunForums/Tips").getName() will return "Tips".

Similar Messages

  • Question related to regex and whitespaces  \s

    Hello, i have a problem related to regex.
    I have a text area where sm types text. I noticed that when i click on the Enter button (i have a new line) the string is not being recognised.
    String regex = "[A-Za-z0123456789_./-]*";I tried to place \s but \s includes other whitespaces characters.
    I would like to include in my regex the \n character (the Enter button) or general the \s characters.
    How am i supposed to do that?
    Thanks, in advance!

    g_p_java wrote:
    prometheuzz wrote:
    >
    Note that on Windows, a line break is "\r\n".
    Also, A-Za-z0123456789_ can be written as \w:
    String regex = "[\r\n\\w./-]*";
    If we are using Linux , Unix is that different?The OS line break is just \n. I'm not sure what Swing puts into a GUI element, whether it's OS dependent or not. It won't hurt you to leave the \r in there though. If there's no \r in the string, it won't stop your regex from working, just like it won't stop it from working when you have A-Z and they don't happen to enter a Z.
    The only way it would cause a problem to leave the \r in the regex is if \r were somehow part of the input and you didn't want it treated as end-of-line. I don't see that happening though.

  • Basic question related to EKKO and EKPO

    Hi experts,
    I have invoice document header and line item data in an internal table(From RBKP and RSEG). From RSEG I have PO number(EBELN) and PO line item(EBELP).
    I want to find out the corresponding WBS element, costcenter and GL account of the PO number and the PO line item.
    Can anybody tell me which tables to select to fetch WBSelement(PS_PSP_PNR), glaccount(SAKNR) and costcenter(KOSTL).
    In which table I will find the link between EBELN,EBELP with KOSTL,SAKNR and WBS element?
    Regards,
    Sangeeta.

    SOLVED THE QUESTION MYSELF.
    THANKS EVERYBODY!!!

  • A workflow question relating to InDesign and LiveCycle

    Hi,
    I have a layout that I've created in InDesign CS3. I export the PDF from InDesign and open it in LiveCycle v8. I then build my form fields and save the PDF. I have my nice form to distribute.
    My question revolves around how to change the layout in InDesign and not lose all of the work done in LiveCycle. So let's say I want to change the background image for the form but not any of the form data. How can I export the new PDF from InDesign and merge it with the form fields from the original LiveCycle PDF?
    Many thanks,
    Ian P.

    You imported the PDF using "Create an Interactive Form with Fixed Pages" since Replace Artwork is not available with "Create an Interactive Form with a Flowable Layout".
    Please keep in mind, you can only replace artwork which has the same number of pages and identical page sizes as the original. If you change either of these in InDesign, you will have to copy/paste from one document to another.
    John

  • Is there a dedicated area to ask questions related to netbeans and VWP ?

    Hi All,
    Here is a site we developed using Creator : https://www.focalpointfurniture.co.uk/shop/
    We are now looking at using Netbeans to develop visual web applications but are having a lot of issues with layout and css. Any ideas where to ask and answer questions ?
    Regards
    Jim
    Message was edited by: Jim
    jimmymac

    Hello,
    Checkout the following link:
    http://www.nabble.com/Visual-Web-f24578.html
    You can also email [email protected]
    Hope that helps.

  • A sample question related to FMS and NetStream.. hoping your answer

    will i be able to send a video what i'am receiving form fms B to another fms A in a flash app?And how?
    i will be right here waiting for your answer. Thank you!!!

    Hello,
    thanks fo your help very much.
    your solution works well in sending a video from fms A to fms B.but it is unable to work in my network environment.
    in my network environment,fms A can not connect to fms B directly,but flash clients can connect to them directly both.
    i still need a kind of flash client that sending out video stream to fms B while it receiving stream form fms A.
    i means that i want to use flash client as a bridge.
    if you make a change from "A.Live Video B.Server 1 (New York City) C.Server 2 (Chicago) and Server 3 (Los Angeles) D.Users" to "A. Live Video B. Server 1 (New York City) C. Users D. Server" in http://help.adobe.com/en_US/FlashMediaServer/3.5_Deving/WS5b3ccc516d4fbf351e63e3d11a0773d5 6e-7ffb.html is what i really want .
    thanks for your help again!

  • Small question related to Unix and ABAP

    Hi Guys,
    I had a new SAP ABAP requirment in which they are asking for unix shell scripting.
    I am just wondering as what unix shell scripting has to do in SAP ?
    Please throw some light on this....
    Regards,
    Tushar.

    Hi Tushar,
       Please Close your previous thread by marking helpful answers...
    for this question ...
    Check these links out
    monitor ABAP from UNIX
    Re: execute unix in ABAP
    Unix commands in ABAP
    Download to Unix
    these Links definitely find helpful to you...
    Regards,
    Santosh

  • Questions related to SMC and firmware update

    In 2005 just before Tiger OS was launched, I purchased the iMac G5 which was introduced in Oct, '04. This is a 1.8GHZ-17inch iMac, and I would like to find out if there is any firmware that need to be updated.
    I tried to reset the SMC - shut the computer, unplug power for 15 seconds, restart - and have not noticed any changes with the malfunctioning sleep function. When I click it to sleep it immediately shuts the system off.
    I can't determine if this is caused because I never have updated the firmware, or because the SMC needs to be reset.
    Would any required firmware update would also show when I run the update software application? If not, how can I find out if any firmware for the iMac model needs to be updated?
    To reset the SMC for some computers one needs to open the system and reset a button in the motherboard. I don't wan't to do that unles I need. I also need to know where the reset button is located.
    Your help and/or comments are appreciated.

    I'll second that -- everything sounds normal -- Mac's just run hotter at times -- in real-life use, you will probably find it doesn't get that hot. Those tests are literally for the birds. Too many people in these forums give too much bad advise, and it leads to people being worried about nothing.
    In general, you will do better with chat forums in other sites, rather than this help forum, because 99 percent of the people who post here are those who have some kind of problem, and rather than going to their apple store, they post and post their problems over and over here (and other sites).
    The likelihood of you having any real-world problems are pretty much nil.

  • Can someone plz confirm me that how i can change or update the security questions related to my apple id? as i have been never put them since i create my apple id but now due to some security reasons its asking me again and again the answers. i am unable

    can someone plz confirm me that how i can change or update the security questions related to my apple id? as i have been never put them since i create my apple id but now due to some security reasons its asking me again and again the answers. i am unable to go through the process. thanks.

    Some Solutions for Resetting Forgotten Security Questions: Apple Support Communities

  • Question related to Java Concurrent Program

    Hi Friends,
    I have a basic question related to Java Concurrent Program in the Oracle application. I would like to know the how Java concurrent program is executed in Oracle applications.Also, want to know where can I find the document for the AOL packages for Java concurrent program. Document for packages like oracle.apps.fnd.cp.request.* , oracle.apps.fnd.util.*.
    Please let me know.
    -Thanks,
    Satya

    You may also check:
    Note: 250964.1 - How to Register Sample Java Concurrent Program
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=250964.1
    Note: 186301.1 - How to register and execute Java Concurrent Program ?in Oracle Applications R11i?
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=186301.1

  • Basic questions about Bigdata, NOSQL and Hadoop

    Hi,
    I've basic questions related to Bigdata. (I've googled it but still wants to confirm with experts)
    Please correct me if I am wrong on below.
    1) As far as I know big data is collection of unstructured data. Even we can store relational data as well.
    2) NOSQL is an Oracle product to handle bigdata (un structured data and relational data as well)
    3) Hadoop is the only one frame work which is avilable in market to manage the bigdata.
    What are the other database systems we have in the market to manage the bigdata.
    Cheers,
    Suri

    Hi Suri,
    1)  "Big Data" does not have a crystal clear, black and white definition. 
    It is generally characterized as being the processing and management of an amount and type of data that makes a specific workload on that data slow and/or expensive.
    Most commonly, Big Data involves processing and management of unstructured data of large volume and the typical technology used to store/process it is Hadoop, However, on occasion a NoSQL database will also deal with unstructured data.
    Big Data is also seen often in the form of simple, semi-structured data of both large volume and/or large velocity and the typical technology used to store/process it is a NoSQL database.  However, on occasion Hadoop will also deal with semi-structured data of large volume.
    In some cases, Big Data is seen in the form of highly connected data that will be manipulated by advanced algorithms that will need to touch a lot of the data and the typical technology used to store/process it is a Graph type of NoSQL database.
    2)  NoSQL is a category of database technologies most often dealing with the issues as outlined in bullet 2 above.   The Oracle NoSQL Database is oracle's product in the NoSQL category of database technologies.   It does NOT store relational data.   When using NoSQL relations between the data must be managed within the application code.
    3)  Hadoop and NoSQL booth manage Big Data, but different aspects as discussed in (1) above.   Hadoop is a batch based, slow processing data technology, but the "slow" is relative because it can process very large amounts of data, so minutes is commonly seen as fast.   NoSQL is a near real-time data processing technology and typically deals with Big Data where access times are in the single digit millisecond range.
    Hope this helps,
    -Robert

  • Interview Questions related to Warehouse management

    Hi all
    Can u please help me regarding  Interview Questions related to Warehouse management
    Thanks and Regds
    Daniel

    Have you searched in very first thread
    [Warehouse Management?|New to Materials Management / Warehouse Management?;

  • Table Relation with Payment and Invoice of Vendor

    Hi all,
         I have one question about Table Relation with Payment and Invoice of Vendor.
         the scenario is.
         2 Purchase Order number : 100000001/100000002
         1 Invoice document number : 200000001 which include  2 Purchase Order.
         1 Payment document number : 300000001
         How should I found out table relation from Payment document number - Invoice document number - Purchase Order number. ?
          I try to link the following table, but it does not work.
          RBKP     *     Invoice Receipt
          RSEG     *     Invoice Receipt document line item
          BKPF     *     Accounting Document Header
    BSEG     *     Accounting Document Segment
    PAYR          Payment Medium File
    BSIK          Accounting: Secondary Index for Vendors
    BSAK          Accounting: Secondary Index for Vendors (Cleared Items)
    BSIS          Accounting: Secondary Index for G/L Accounts (Open Items)
    Does any one know about it ?
    Regards
    KY Chuang

    Hi Venkatesh,
    Thnx a lot for the reply. This has almost solved my problem, however there's one thing left. when I'm trying to take a print out after exporting the info into an excel sheet, the information really looks scattered, i.e.,  is there a way where we can go ahead and get the info in a rather unscattered manner.
    I've tried to take a print directly without actually transferring the info into an excel sheet, then each of the vendor is printed in a separate page, which again they feel is a problem.
    So, if you have an idea pls suggest.
    Thnx again for the information.
    regards
    sandhya

  • Basic Questions related EHPs for SEM

    Hi Guys,
    I've some basic questions related to EHPs: -
    1. If we don't mean to implement any of the new functionalities does it make any sense to implement EHP? In other words do EHPs also have some general improments other than the functionalities which can be specifically activated?
    2. If we just activate a functionality and don't implement/ use it can there be any negative impact?
    3. In case of a pure technical upgrade from SEM 4.0 to SEM 6.0 which EHP would be recommended?
    4. Is there a quick way to find all relevant notes in EHPn which are related to corrections for EHPn-1?
    Thanks in advance,
    -SSC

    HI,
    If you see some of my older posts I have had many issues with certain features of the EHP2 functionality but that doesn't mean I would recommned against it.
    BCS 6 EHPs 3 & 4  (BCS 6.03 / 6.04) - enhancement packs worth implementing?
    BCS 6 EHP 2 (BCS 6.02) - activation of enhancement pack
    My recommendation is to implement the EHPs but not necesarrily activate the functions (in SFW5) unless you need them - this means that you will only have to test once after EHP implementation and will have the ability to activate the other features as and when required (although testing is required after activation of course) whereas it might be difficult to persuade your client/basis team to implement EHP4 later if you don't do it now.
    In the features of EHP2 (activate FIN_ACC_GROUP_CLOSE) it states that there is a general performance improvement - although I have yet to experience it! From OSS note 1171344 "The functionality which is available in EHP2 consists of...
    ... Performance improvements of status management, reporting and initial start-up of consolidation workbench and monitor.
    Since activating FIN_ACC_GROUP_CLOSE I have had many OSS notes requiring application but i discovered that when the technical team implemented the EHPs (before i joined this client) they somehow forgot the latest SP (support packs) and didn't upgrade to the current level - so make sure that you get the right SPs too (see the links in Greg's link above) to avoid the many OSS notes.
    As for your question - "is there a list of OSS notes to specific to EHP upgrades? - the answer is most definietly "NO" - I already asked OSS in desperation!
    however, you can see the OSS notes that i have applied listed in the above link ( BCS 6 EHP 2 (BCS 6.02) - activation of enhancement pack )

  • Some questions related to SAP XI

    Hello!
    I would like to know the answers for the following questions regarding SAP XI-context (if it possible with Yes/No and a short comment/explanation)
    <b>CAPACITY PLANNING GUIDELINES</b>
    a) Guidelines to size the server(s)?
    b) Guidelines for sizing the over all environment for High-Availability
    <b>ARCHIVING CAPABILITIES</b>
    a) Approach to archiving of obsolete data
    <b>PLATFORM SUPPORT</b>
    a) Software supported on HP-UX 11.i V2 (r6) on Itanium.
    b) software supported on Windows 2003 sp1 (x64) on AMD Opteron 
    c) software support aligned with release roadmaps for future versions of HP-UX and/or Windows Server
    d) Software supported on OS clustered servers  (If mutliple products, please indicate if all are support or list areas where clustering may not be recommended and why)
    <b>RELATIONAL DATABASE </b>
    a) Does your system run native to the Oracle 10g RDBMS (RAC) and database tools?  If not, please explain the databases and tools supported.
    b) database monitoring tools be used to manage impending maintenance needs and potential problems and performance impacts (i.e., tool will monitor and detect prior to real problem occurring)
    c) standard pre-defined SQL queries and related calculations provided for use with industry standard reporting tools
    d) database accept binary-large-objects (BLOBs) and  be referenced via the relational engine.
    Thank you in advance!
    Regards!
    A.Henke

    two questions related to this:
    1. Why Java is designed to only permit single
    inheritence, any stories behind the scene? I think
    some major reasons why "prefer interfaces toabstract
    classes" is accepted is rooted in this limitation.Yes, one of the reasons interfaces are better is that
    you can only extend one class, but implement many
    interfaces. Say you have a concrete class that should
    "implement" two different types. If those types were
    defined as abstract classes, you could only use one
    type. You could implement both types if they were
    interfaces though. So why java is designed to have this limitation? There may be some arguments before this is settled down. I always like to hear this kind of stories:)
    2. Base on the fact that once an interface is outof
    box and widely implemented, it is almostimpossible
    to change it. So how you guys design yourinterfaces?
    Could you share some? In my idea, I would designmy
    interfaces as compact as possible.You could extend the interface and start using that
    if you didn't want to break existing code. You
    couldn't use that implementation as an Interface1
    though, since the new methods only exist in
    Interface2, so that's not an optimal solution.So we may always need to add a new interface when we just want to add a new method.

Maybe you are looking for

  • How to set Dropdown list in tablen whith others Dropdown values in each row

    how to set Dropdown list in tablen whith others Dropdown values in each row of the table

  • Scanned pdf file-how to edit/translate

    Hi, I am not very good at working with computers/but pretty good at messing them up...Anyhow, I have a Mac OS X version 10.5.8 and I received a file that I need to translate into my own language (my own translation, no need of computer aid in transla

  • An error occured while trying to access the base station

    I know enough to get myself in to trouble...but not enough to get myself out I am connected to my wireless network. I know what my WEP is. There is a different password when my iPhone connects to the wifi but I know that too. I am trying to get in to

  • Forum Module, How to link to the forum register page?

    Simple qeustion: Is there a way to just link to the forum register page? if so how?! Btw where can you find the bc docs? im really getting annoyed because i cant figure out just that simple stuff. - Rob

  • How do i delete a screen saver?

    i just downloaded a screen saver a few weeks ago, but then decided i didn't want it i went into my library and then in the screen saver folder, and deleted it when i went back in system preferences, it was still there, and it still works it was a 10