How can i get the local path to my cached app in jws

Hi,
sorry, i think it is a stupid question of me. but i'm a newbie in java and jws...
So my question is...
is it possible to get the absolute path to my downloaded an d cached jarfile? (e.g. c:\program files\java web start\.javaws\cache\http\Dmy.server.com\P80\RMmyapp.jar)
thanks a lot for any help.

I just answered this elsewhere, but here it is again.
This code seems to work. I found it last year in one of the forums.
I use it to find resources in Jars or to find images when I am in an IDE
The "SetIcon.class" below should be changed to the class you are running from.
Note: If you are running a class in a package, this returns the root of your application instead of the "folder" containing your package. This would mean that the "images" folder I refer to below is under the root folder, not the package folder.
javax.swing.ImageIcon img;
URL imgPath1;
String imgPath2;
imgPath1 = SetIcon.class.getProtectionDomain().getCodeSource().getLocation();
imgPath2 = imgPath1.toString();
imgPath2 = imgPath2.substring(6); // strip off the "file:"
imgPath2 = imgPath2 + "images/sample.gif";
Hope this helps,
Hale

Similar Messages

  • How can I get a local path of the local disk with swf

    Since FileReference.download() doesn't download multiple
    files, I want to download files with php ftp_get by FTP.
    I need to pass the local path of the local disk where I can
    download the files from a remote serveur. How can I get a prompt to
    have a user choose a folder on his computor (local disk), if any
    way possible?

    OK, at least 3 is working.
    I don't know how you have a Tape Recorder icon on your Home Screen. I cannot add one myself. But, I am running Holo Launcher in replacement of the default LG "Optimus" User Interface. It's much better in my opinion.
    Try long pressing the icon and select Edit and maybe you can change some attribute of the icon.
    Another thing you could do, is long-press an empty area of your desktop, to add an icon. Select Shortcut, then Select Contact, and scroll through your contact list and choose the contact that you added for *86.
    You realize if you have voice mail you haven't heard, there is a tape recorder icon in the notification bar, which you touch and pull down, then press it to dial voicemail.
    If that functionality doesn't work, you MIGHT want to consider doing a factory data reset on your device, but that is going to nuke all your personalizations and cause you work to set up again.

  • How can I get the local computer's ID and IP address in Labview?

    I want to get the local computer's ID and IP address, but i found i can't do it in labview.
    Could anybody do me a favor to give me some guidance?
    Thank very much!

    Under the Communication palette, under TCP, there are two functions you need to get this info':  'String to IP' and 'IP to String.'
    1.  Drop the String to IP function on the diagram. 
    2.  Do not wire any input to it. 
    3.  Take its Output and wire it to the 'net address' input of the 'IP to String' 
    5.  Display the Output of the 'IP to String' 
    Depenging on the True/False input to the 'IP to String' function, you get the machine name versus IP address. 
    See attachemnt... guess it's easier than explaining 
    Hope this helps.
    -Khalid
    Attachments:
    ip.png ‏2 KB

  • How can I get the locale of a country?

    There is a way to get the a locale from an ISO 3 chars country code (Country examples: USD, CRC, MXN) or from an ISO 3 digits country code (840, 180)?
    Thanks

    If you know the ISO-639 language code you can instantiate a java.util.Locale.

  • How can I get the file path which located on webapps/MY_APPS ?

    Hi,
    I use tomcat as our servlet container.OS is win2k srv
    my project was put on x:\tomcat\webapps\MY_APPS
    and I could use getServletContext().getRealPath("/") within a servlet to get x:\tomcat\webapps\ROOT\MY_APPS,
      public void doPost(HttpServletRequest request,
                         HttpServletResponse response)
        throws ServletException, IOException
           String myAppsPath = getServletContext().getRealPath("/");
      }but I could not utilize this method within a normal help class
    any suggestion will be welcome.
    thanks in advance.

    try this:
    package com.sample;
    import java.io.File;
    public class SampleClass
      public SampleClass()
       * @param args
      public static void main(String[] args)
        SampleClass sampleClass = new SampleClass();
        File f = new File("SampleClass.class");
        System.out.println(f.getAbsolutePath());
    }

  • How can I get the music I download from an app to show in my library to use my dj app?

    I need to get my music but I can't use iTunes so help me

    What app?  What music?  Why can't you use iTunes?  You want help you have to provide details.  We're not mind readers here.

  • How can i get the path to config folder placed inside the jar file?

    Hi i have developed an RCP application using eclipse.
    In my application config directory is there.
    When i export my RCP application as JNLP Project the jar file is created which contains config folder inside it.
    When i download the application using java web start , how can i get the path to config folder placed inside the jar file?
    Will the config folder exists in local cache in my system?
    Help needed.
    -Deepak

    -- This works in CS6:
    tell application "Adobe InDesign CS6"
      set myDocument to active document
      set selectedRectangles to selection of myDocument
      set theGraphicsLink to file path of item link of (graphic 1 of (item 1 of selectedRectangles))
    --> "Macintosh HD:folder/folder/filename.tif"
    end tell

  • Teststand 1.03 - How can I get the sequence file path into an expression?

    The sequence file will be located at different locations on different computers. I need the base address of the sequence file to get to the correct limits file. How can I get the sequence file path into a string-local expression.
    Thanks

    As Ray described, the FindFile expression function and TS API method will seach all TS search directories and return to you the path of your file, assuming the file is located in the search directories.
    If you just want the path of a TS file that you have a reference to then there is a faster, easier method. You can use the Path property of the PropertyObjectFile class. In the attached example I use an AcitiveX Automation adapter step to call Path on the property RunState.SequenceFile. This returns the path to the current executing sequence file. Note that if you have not yet saved the sequence file then the path will be empty. In a subsequence step I strip off the file name leaving the root path of the file.
    Attachments:
    GetSeqFilePath.seq ‏22 KB

  • How can i get the document full path in S_TieDocument?

    I create a new S_TieDocument and override 2 methods:
    extendedPreInsert and extendedPostInsert
    how can i get the document full path in these 2 methods?
    (e.g. if i use the system user to upload a new file named 'test.file' in system root path /home/system, and i want to get the document full path '/home/system/test.file', how to get it?
    anybody know it, pls tell me, thanks a lot.
    java source is as below
    package oracle.ifs.server;
    import oracle.ifs.beans.Document;
    import oracle.ifs.beans.DocumentDefinition;
    import oracle.ifs.beans.LibraryObjectDefinition;
    import oracle.ifs.beans.LibrarySession;
    import oracle.ifs.beans.PublicObject;
    import oracle.ifs.common.AttributeValue;
    import oracle.ifs.common.IfsException;
    import oracle.ord.itech.cmsdk.ws.view.EmbeddedCMSDKWebServicesWSStub;
    public class S_TieDocument extends S_Document
    public S_TieDocument(S_LibrarySession session, S_LibraryObjectData data)
    throws IfsException
    super(session, data);
    public S_TieDocument(S_LibrarySession session, java.lang.Long classID)
    throws IfsException
    super(session, classID);
    // Overrides
    public void extendedPreInsert(OperationState opState,
    S_LibraryObjectDefinition def)
    throws IfsException
    // Always call super
    super.extendedPreInsert(opState, def);
    // Get the LibrarySession
    S_LibrarySession session = getSession();
    def.setUserSetAttribute("CUSTOMATTRIBUTE",
    AttributeValue.newAttributeValue(""));
    //how can i get the document file full path here?
    public void extendedPostInsert(OperationState opState,
    S_LibraryObjectDefinition def)
    throws IfsException
    // Get the LibrarySession
    S_LibrarySession session = getSession();
    //how can i get the document file full path here?
    }

    In the new version of Numbers this option is not available.  You will have to type the file name into the header yourself.  You can post feedback to Apple using the menu item "Numbers > Provide Numbers Feedback"
    or use Numbers2.3 which should be in the folder "/Applications/iWork '09" if you previously had it installed

  • How can I get the path of an existing file????

    Hi.
    I'm a newbie in Jsp development, so this question may appear trivial.
    How can I get the path into a String of an exixting file ..like ...
    String thepath = path_of("my file.txt");
    Thanks for your help.

    Try
    application.getRealPath("myFile.txt")

  • C Programming: How can we get the filesystem name for a given file-path?

    C Programming: How can we get the filesystem name for a given file-path?
    Say I have a filepath=/mnt1/file1
    Using some OS API like stat, can I get the Filesystem /mnt ?
    Thanks in advance,
    -V

    Enter the command up to the point of entering the file path and add a space, then drag the file into the terminal window. It will fill out the path.
    If you need to go further into the contents of the Application package, you can continue with /Contents...
    Another way is to start typing and then hit Tab to auto-complete. It will stop where it can't determine the next letter.
    So, type /App tab and it will fill in /Applications. Type a / and start with the name of the app, then tab and it should complete. Continue till you have the correct path.
    Spaces will be replaced with \<space>, so, App Store would end up as /Applications/App\ Store.app

  • How can I get the font list of local

    Hi, everyone.
    In AS2.0, I can use TextField.getFontList() to return a
    array that include all font family of local.
    However, AS3.0 no longer supports it. How can I get the font
    list of local in AS3.0?
    Thanks

    thanks, I have been found result from adobe livedocs.
    example code following:

  • How can I find the all path available for a MPLS VPN in SP network

    How can I find the all path available for a MPLS VPN in SP network between PE to PE and CE to CE?

    Hi There
    If we need to find all the available paths for a remote CE from a local PE it will depend upon whether its a RR or non-RR design. If the MP-iBGP deisgn is non-RR  the below vrf specific command
    sh ip bgp vpnv4 vrf "vrf_name"  will show us the MP-iBGP RT for that particular VPN. It will show us the next hop. Checking the route for same in the Global RT will show us the path(s) available for same ( load-balancing considered) .Then we can do a trace using the Local PE MP-iBGP loopback as source to remote PE's MP-iBGP loopback to get the physical Hops involved.
    However if the design is RR-based there might be complications involved when the RR is in the forwarding path ie we have NHS being set to RR-MP-iBGP loopback and the  trace using the Local PE MP-iBGP loopback as source to remote PE's MP-iBGP loopback will get us the physical Hops involved.
    If we have redundant RRs being used with NHS being set then the output of sh ip bgp vpnv4 vrf "vrf_name" will show us two different available paths for the remote CE destination but just one being used.
    RR-based design with no NHS being used will always to cater to single path for the remote CE detsination.
    So in any case the actual path used for the remote CE connectivity would be a single unless we are using load-balancing.
    Hope this helps you a bit on your requirement
    Thanks & Regards
    Vaibhava Varma

  • How can i get more local storage space on my iphone 4

    I want to put more song on my iphone 4 but it keeps saying i dont have enough local staorage space. How can i get more local storage space on my iphone 4?

    You don't. Delete 'stuff' you don't need or buy a phone with more storage. you can not increase or upgrade the internal storage in the iPhone.

  • I lost my iTunes library on my pc when the hard drive crashed. None of the data on the drive was recoverable and I did not have a backup. How can I get the music that resides on my ipod nano (4th generation back onto the new hard drive on my pc.

    I lost my iTunes library on my pc when the hard drive crashed. None of the data on the drive was recoverable and I did not have a backup either locally or on the cloud. Much of the music is from old vinyl and podcasts which are no longer available.
    How can I get the music that resides on my ipod nano (4th generation) back onto the new hard drive on my pc.
    I have been reluctant to install iTunes on the new hard drive out of fear that I will lose all the contents on the ipod if I try to synch to the new hard drive.
    Help!

    No backup is a huge mistake.
    You can redownload some itunes purchases in some countries:
    Downloading past purchases from the App Store ... - Apple - Support

Maybe you are looking for

  • How do I get access to the parent window native pointer?

    Under Windows: I need to get access to the native pointer for an applications frame (in this case a JFrame). I need to do this because I want to display property pages in a native dialog box. These property pages are supplied by driver software, are

  • ITunes m4a to wma--- is that controversy truly good for apple?

    Seems to *this (20-year+ Mac) user that iTunes software's refusal to export to wma is counter-productive and off-putting. My daughter was given an mp3 player other than iPod (Rave) and cannot use the music she has already purchased on my iMac in iTun

  • Uploading Contacts/Calander FROM the ipod

    Hi all, Hoping someone can help me, been looking at the posts but can't find one that totally answers my question. I have backed up all my contact and calander details to my ipod regularlly, though the other day I foolishly deleted them from ical and

  • Converting forms from  9.0.4 to 10.1.2.0.2.

    converting forms from 9.0.4 to 10.1.2.0.2. when opening the forms in 10.1.2.0.2 libraries are also loaded along with forms and i'm able to compile. But when running the form FRM-40735 ON-ERROR trigger raised unhandled exception ORA-06508. (In 9.0.4 i

  • Required source 'update' is missing

    Hello, I just installed Xp on my new macbook pro and when i put the osx disk in to install windows support things it says something like it needs to update it's installer. And I say "ok" it says "required source 'update' is missing". What do i do??