Where are jar files downloaded to with Applet?

I have an Applet and am using archive attribute in my applet tag to specify jar files needed by the applet. eg: "archive=myclassfiles.jar, foo.jar". Assume that myclassesfiles.jar has classes needed by the Applet and Foo.jar has some text files or xml files. Assume that Applet is signed.
My question: I am assuming that all jar files are downloaded to the client when the Applet is started. Is this correct? If so, how can I open and read Foo.jar file within the Applet? I dont know the path to that file, that is, I dont know where on the client that Jar file has been downloaded to. Would the following work:
URL aUrl = (new File("Foo.jar")).toURL();
String path = aUrl.toString();
would path point to the correct location of Foo.jar?

They are downloaded to the client, and stored in a cache. I'm not sure they are readable from within the applet, however. But there are 2 solutions, depending on what you are doing.
1) You want to get some images or other resources from the Jar file. Then do this:
URL url = appletClass.getClass().getResource("myimage.jpg");
ImageIcon icon = new ImageIcon(url);
where appletClass is the applet object, and the resource ("myimage.jpg" is the relative path to the image in the Jar file.
2) You want to muck around with the Jar (read it). Well you can't write to it that easily in an applet, as you can't access the file system without a signed applet, or you would have to POST it back to the web server via HTTP file upload. But if you want to just read it and get stuff out of it, you can always just do this:
URL url = new URL(getDocumentBase(), "foo.jar");
and then open the URLConnection for that URL and read the Jar in.

Similar Messages

  • Suggest  to track file download event with applet or any other way

    Hello,
    I am trying to write a code which will handle a file download event. I want my program to to do a change in database when a file downloading completes.
    I thought there might have some way to track this event through javascript and if tracked I'll make an ajax call to a serverside page to serve my purpose. But haven't found any way to track such event.
    I don't know whether it is at all possible or not.
    Any one has any idea??
    Thanks in advance.
    Edited by: Atanu_from_Tollygunge on Mar 20, 2009 2:01 PM
    Edited by: Atanu_from_Tollygunge on Mar 20, 2009 2:56 PM
    Edited by: Atanu_from_Tollygunge on Mar 20, 2009 3:00 PM
    Edited by: Atanu_from_Tollygunge on Mar 20, 2009 3:01 PM

    Thanks for your reply...
    But if the size of the file is say 4mb and somehow in the halfway of downloading, if any problem occurs through any browser, will java server be able to track that exception??
    I'm not sure, I'm trying to figure out....
    Edited by: Atanu_from_Tollygunge on Mar 20, 2009 4:22 PM

  • Where are the files I printed with Adobe CreatPDF Desktop printer?

    When printing any MS files with the Adobe CreatePDF Desktop Printer, I don't know in which folder I must go to get the files. Any idea? Tks. Nicolas.
    Error message : documents in waiting lines

    Hi thimpl,
    Please refer to this FAQ link:Adobe CreatePDF Desktop Printer is no longer available
    Regards,
    Florence

  • Jar files downloaded from SkyDrive are being renamed to jar.zip files

    I have cut and pasted the following series of exchanges from when I posted the problem onto SkyDrive's support forum. I hope that someone might be able to propose a better solution to the problem that I have. Thanks for your help.
    MDSms asked on
    Uploaded jar files convert to jar.zip files when downloaded from SkyDrive
    I have uploaded an executable jar file to SkyDrive. (I will call this FILE.jar). The file is intact and indicates that it is a jar file type when the file is viewed by Properties within Skydrive. However, when I download (or others download through a share link) the file, it is being saved onto the local computer's download file with .zip appended to the file name (FILE.jar.zip). The downloaded file can be renamed to remove the .zip appendage and subsequently run successfully. However the folder options for the folder where the downloaded file resides must be changed for disable "Hide known file extensions" prior to being able to remove the .zip appendage. While I have figured out the workaround for this problem, this manual renaming procedure is entirely too cumbersome as a solution for sharing this file with others. How can I prevent or disable the FILE.jar file from being renamed to FILE.jar.zip when it is downloaded from SkyDrive?
    All Replies (5)
    Audrey_P. replied on
    Forum Moderator
    Hi,
    Thank you for posting. Let me try to assist you with your issue with your files.
    In order for us to reproduce the issue on our end. Please provide us with the exact steps that you did when you uploaded the files as well as the steps when you are downloading it.
    We will be needing the steps to help us figure put what is causing you this issue.
    We look forward to your response.
    Thank you.
    Audrey P.
    MDSms replied on
    Reply
    The file was uploaded by first logging onto my SkyDrive account using Windows 7 Pro and Firefox browser, then a new folder in my account was created without sharing privileges, then the folder was opened and the FILE.jar was uploaded into the folder using the "Upload" option on skydrive account menu. Sharing privileges for FILE.jar were then created (view only), and the shortened url link was sent to the individuals that I was trying to share the file with. was then turned on. When these people use the link to download the file, it is being saved as FILE.jar.zip.
    When I try to download the file through the skydrive account download option, it is being saved onto my computer as FILE.jar.zip and this occurs when I try to download the file while signed into my skydrive account as well as when I am not signed into my skydrive account (using the shared file link).
    This PNG shows the information provided by clicking on the download icon (down arrow) within the Firefox browser; note that the file was downloaded as FILE.jar.zip and that the source was live.com. When I use Windows Explorer to look at the same file within the Download folder itself, examining the file's properties details also shows that it is being saved as FILE.jar.zip and is of the file type compressed zip folder.
    This PNG shows the information displayed to me from my skydrive account when I view the originally uploaded file's properties; note that the information shows that the file is a jar file type.
    When I utilize Internet Explorer 9 to access the file, FILE.jar is being downloaded onto my computer as a jar file type. This PNG shows the information provided by Tools/View Downloads within the IE9 browser. Note that in this instance, the information indicates that the file is being downloaded from yzudea.blu.livefilestore.com.
    It appears to me that the problem (the FILE.jar file being renamed to FILE.jar.zip) arises from the fact that a jar file downloaded from skydrive using firefox, is being sent from live.com whereas a jar file downloaded from skydrive using IE9 is being sent from yzudea.blu.livefilestore.com.
    I want to make sure that a person receiving a share link from me for FILE.jar is able to download it without modification to the file name regardless of which browser is being using to access the link. How can I make sure that this occurs?
    Any help is appreciated. Thanks.
    Michelle Anne D. replied on
    Forum Moderator Community Star Community Star
    Reply
    Hi MDSms,
    I appreciate you for providing as much information as you can about the issue, as well as for uploading screenshots on what you see from the downloaded file. About your initial concern wherein the file gets renamed with .zip after the original file extension, this is solely dependent on the browser that you are using since they have a different safety/security measure that needs to be implemented.
    Moreover, you may see the file servers live.com and yzudea.blu.livefilestore.com to be different with one another, but they actually are sent from the same SkyDrive server. This in turn, depends on the web browser where the file is being downloaded as well. The live.com file where it was downloaded from Firefox simply masks its original server yzudea.blu.livefilestore.com.
    As for your last query about your recipients downloading the file without the hassle of renaming it from a .zip file, you can simply tell them to download it through Internet Explorer.
    Should you have other queries or additional information that might help in our investigation, I highly encourage you to post them here.
    Regards,
    Michelle
    MDSms replied on
    Michelle,
    Thanks for your reply. Yes, I could simply tell them to download the file through Internet Explorer, but is there another solution or workaround to the problem I have described here? Am I being punished with the curse of this problem simply because I (or the individuals with which I wish to share FILE.jar with) choose to use Firefox instead of IE? Will the use of any other browser instead of IE (Chrome, Safari, etc., etc.) still result in the same problem?
    You stated that it is "solely dependent on the browser that you are using since they have a different safety/security measure that needs to be implemented"........could the problem be overcome by designating one or both of the file server addresses as Trusted Sites within the browser options setting?
    I look forward to your response. Thanks in advance.
    Joy V. replied on
    Forum Moderator Community Star Community Star
    Reply
    Hi MDSms,
    We understand your concern. Since the issue does not occur in Internet Explorer, it has something to do with Firefox's security feature. You might want to verify this concern by contacting Firefox support.
    Hope this helps. Let us know if we can further assist you with SkyDrive.
    Thanks,
    Melanie Joy

    Try to delete the mimeTypes.rdf file in the Firefox profile folder to reset all file actions.
    *http://kb.mozillazine.org/mimeTypes.rdf
    *http://kb.mozillazine.org/File_types_and_download_actions#Resetting_download_actions

  • Where are the jar files downloaded.

    When I run a javafx sample, the first time, it downloads so many jarfiles to a particular place on my box. When I run another sample, it downloads some other jar files, and I can bet some of the jar files downloaded by the previous sample are also downloaded by this sample, I am just thinking, if there is a central place where all downloads go to, then can we have an app check in that folder to see if a jar file is present before downloading it again??
    sa

    trinisoftinc wrote:
    When I run a javafx sample, the first time, it downloads so many jarfiles to a particular place on my box. When I run another sample, it downloads some other jar files, and I can bet some of the jar files downloaded by the previous sample are also downloaded by this sample, I am just thinking, if there is a central place where all downloads go to, then can we have an app check in that folder to see if a jar file is present before downloading it again??
    saHey trinisoftinc - I recommend you go investigate java webstart (jnlp). This behavior should not unique to JavaFX applications packed into jnlp but Java as well. I believe it's quite complex and I think Sun have done the right thing here. Duplication is better than potential inconsistencies between supposedly 'identical' jar's. Also, who really sign's jar's anyway.... not many... if any ;)

  • How to make a jar file downloadable with IE

    hello,
    I just bought a website:
    http://www.frozenfountain.net/
    and I put a jar file on it called Logo.jar
    Using Mozilla, the jar file downloads as expected, but with Internet Explorer, it tries to download it as .zip file.
    How do I get it to download as a .jar file with IE?
    thanks

    Just post a link to the Jar. Mozilla will download
    it as a jar. Windows will download it as a zip.
    Only one link. No problem, really. ;-)There is a problem. People who arent as good with computers as you are won't know how to run the jar file after downloading with IE.
    At school, I told someone to download the file, which they did with IE. It downloaded to desktop as a zip. They extracted and were left with a bunch of .class files.
    On a sidenote, how do you draw text with a gradient?

  • How to read file in JAR file (the one containing applet class)

    my applet needs to read a file (font file) that will be bundled in the jar file. how do i read that file?
    i tried using
    URL u = new URL("file:///myfont.ttf");
    u.openStream();i got AccessControlException. is there anyway for the applet to load file in the JAR file? i see applet can load image in the jar file so figured that it should be able to do so with some other type of file
    thanks

    The reason you're getting access violation is the way you code your URL -- it's pointing to a file on the user's local disk. If my.ttf is in the jar, try:
          URL url=myApplet.class.getClassLoader().getResource("myfont.ttf");Where myApplet is the name of your applet and the font file is assumedly kept in the same directory level in the jar file as the class file for your applet.
    ;o)
    V.V.

  • Control JNLP jar files download time

    Hello,
    I have a JNLP application which will run over internet , my problem is that anyone can go to the url and launch the application and download all the jars, before even logging in, i'm worried about using this for Denial of service.
    is there a way that i can control the jar files download time, like only download the necessary jar first and when jars are needed will be downloaded eventually
    Any Help would be appreciaetd
    regards

    elie_nasrani wrote: I have a JNLP application which will run over internet , my problem is that anyone can go to the url and launch the application and download all the jars, before even logging in, i'm worried about using this for Denial of service.
    is there a way that i can control the jar files download time, like only download the necessary jar first and when jars are needed will be downloaded eventually
    Web start offers lazy downloads, as well as the DownloadService* (DS) to help with this kind of problem.
    'Lazy' means the resource is only downloaded when needed, but using the DS offers even greater control, even to the extent of manually blocking a download - if needed.
    * e.g. of the Download service, be sure to follow the links.
    <http://www.physci.org/jws/#ds>
    As far as 'signing' goes, I cannot imagine how that would help for your problem. Not only are signed Jar's (at least slightly) larger, but they can also be used by JWS apps. coming from other domains! If your app. is sandboxed, I strongly recommend keeping it as unsigned code.
    Why is your JNLP file exposed to the general public? Don't the users have to log in before they can get to the page with link to the application JNLP?
    If that is the case, the only chance for users who are not logged in to launch it, is if a friend sends them a direct link to the JNLP file.
    As an aside, I generally do not have time to look at posts with no 'dukes' assigned (see links at upper left), if getting a solution is important to you, it is a good idea to add some.

  • Where are music files stored when playing a song stored in iTunes Match?

    Where are music files stored when playing a song stored in iTunes Match? Instead of clicking the cloud icon and downloading the song, I simply double click the song and it starts playing. Later, I can quite iTunes, come back and not have to wait for the song to buffer. When I go to about on my computer I am told there is 11 gigabytes of music on my computer. Where are those files stored, do they clear themeselves over time, etc...

    but then why does the FAQ state this:
    Does iTunes Match stream or download songs?
    On a computer, any songs stored in iCloud will stream over the air when played, though you can download them at any time by clicking the iCloud download button.
    Do they mean a different computer than the one with the stored music files?  Would be nice if they specified what they mean

  • Where are the files that camera profiles install?

    I have downloaded from this link: http://labs.adobe.com/wiki/index.php/DNG_Profiles
    DNG profile editor 1.0 beta 2 and camera profiles beta 2.
    After installation of these camera profile on PC where are the files?
    I have searched but I don't find these!
    Please help me.

    Welcome to the discussions,
    Your music and movies should still be part of the iTunes library on your computer. See if your movies are listed in "movies" in the left window in iTunes.
    Photos you took with the phone are part of the last backup, if you did not sync after that. If you did, the data got overwritten.
    See what else is inside the backup and how to restore from it here: http://support.apple.com/kb/HT1766

  • HT2500 Where are the files of past mail kept in the Mail program.

    I want to do an additional backup of my email on Mail.  Where are the files of stored past mails kept?  In the same Mail.app?
    Thanks
    Gil

    Hi Gil,
    On Mail...
    First Quit Mail, then I'd backup these two Mail folders, by right clicking on them in the Finder, then choose Archive/Compress.
    Users/YourUserName/Library/Mail
    Users/YourUserName/Library/Mail Downloads
    (Could be a different folder here if you chose such in Mail Prefs)
    Right click on that Mail folder, choose archive, you'll get everything in the folder, and the folder itself in a file called Mail.zip, move it to a safe place, same for the Mail Downloads folder... only the plist is separate.
    /Users/YourUserName/Library/Preferences/com.apple.mail.plist

  • SYSLOGD gone wild - where are the files?

    Hey all,
    Yesterday I had 15GB of free HD yesterday, it told me today that I was down to 100MB.
    Confused - because I haven't added any files, I check the activity monitor and found that SYSLOGD was running, and using an absurd amount of processor and disc access.
    I searched on it, and it seems to relate to Time Machine, which I'm not using.
    SO... I rebooted, and now it's not running any more.  BUT - the hard disc space is still gone, and I don't know where the files are that I need to delete to free it up.
    I've loaded a disc scanning utility to try to find where a new 15GB file might be hiding, but I'm thinking it's in the hidden area of the disc.
    QUESTION 1 : Where are the files SYSLOGD wrote and how can I delete them?
    QUESTION 2:  What made it run, and how can I keep it from happening again?
    Thanks!

    If you're looking for trash sounds, those are located in /System/Library/Components/CoreAudio.component/Contents/Resources/SystemSounds/ . If you're wanting to change the put stuff in trash and empty trash sounds, then follow these steps.
    Convert your sounds to aif, save them in some convenient location.
    Replace the two sound files *"move to trash"* and *"drag to trash"* inside the Finder and Dock folders, respectively, inside the SystemSounds folder, with the one you want for putting things in the trash and the *"empty trash*" one inside the Finder folder with the new one for emptying the trash.
    Ensure that you rename the new ones the same as the originals. (I usually copy the originals and add a .bak suffix so I can restore the sounds to their original condition.)
    OPTION-click the Finder's Dock icon and select Relaunch.
    Do note that if you'll have to authenticate to copy, rename, and replace these files. I use the Terminal with the sudo command to affect the changes.

  • Where are iBook files

    I need to access the iBook or ebook files to have text to speech work.  Where are the files? How do I access outside iBook app?

    You can see the ibooks bought from Apple on your computer's iTunes (they go into the Books part of your library if you download or re-download them there) but they can only be read in the iBooks app on an iOS device. Are you wanting to access them in another app ?

  • Jar file import problem with ADF application

    Hi Everyone,
    I am using Jdev 11g with integrated WLS. I have an ADF application and is trying to integrate JasperReport in it. I added the JasperReport JAR file in the project properties -> Libraries and Classpath, and checked it for "export" and "Deployed by Default'. I have my JasperReport codes in my managed bean
    as follows
    +public String cb1_action() {+
    +try {+
    +JasperDesign design = JRXmlLoader.load("C:/JDeveloper/mywork/ReentryApplication/ViewController/public_html/jasper/testReport.jrxml");+
    +JasperReport report = JasperCompileManager.compileReport(design);+
    +....+
    +}+
    +}+
    I am able to compile the managed bean class successfully. However when I run the application, I got a stack of errors like this,
    +[2009-10-08T11:31:59.910-04:00] [DefaultServer] [ERROR] [] [javax.enterprise.resource.webcontainer.jsf.application] [tid: [ACTIVE].ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: test123] [ecid: 0000IGollZuB5EirL4YBUA1AnVop00000L,0] [APP: ReentryApplication] java.lang.RuntimeException: net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:[[+
    +C:\Documents and Settings\MISSP29\Application Data\JDeveloper\system11.1.1.1.33.54.07\DefaultDomain\testReport_1255015914097_607807.java:4: package net.sf.jasperreports.engine does not exist+
    +import net.sf.jasperreports.engine.*;+
    +....+
    It appears that the JAR file is not picked up at the runtime correctly. I tried a simple Main class with the same codes and JAR file added, it works fine. Does anyone know what I am missing within the ADF application?
    Any helps would be appreciated.
    Thanks,
    John
    Edited by: john wang on Oct 8, 2009 9:24 AM

    Timo,
    Thanks you for your prompt response.
    1. I checked The following folder (I assume this is where it supposes to be). The JAR file is there.
    C:\Documents and Settings\MISSP29\Application Data\JDeveloper\system11.1.1.1.33.54.07\o.j2ee\drs\ReentryApplication\ReentryApplication-ViewController-webapp\WEB-INF\lib
    2. I did not do anything about deployment descriptor. Since I run my application within JDev integrated WLS, I did not do anything about deployment setting. Do I need do something with deployment descriptor if I want to import additional JAR files here? With my experience with 10g, to add a JAR file within JDev, all I need to do is to add it through project properties ->libraries.
    3. I agree with your absolute path comment. This is a test of how JasperReport works with ADF application. I will work it out later.
    Thanks,
    -John

  • When I select files to archive, they move from my file folder, but then I go to the archive folder and it says Empty? Where are those files?

    When I select files to archive, they move from my file folder, but then I go to the archive folder and it says Empty? Where are those files?

    Your account names are probably different on the two Macs. If you know the UNIX command line, open a terminal window and run:
    $ id 
    You should see a line that starts with something like this:
    uid=501(your_user_id_here)
    now check the owner of the folder you copied over:
    $ ls -ld Music
    drwx------+ 8 some_user_id_here  staff  272 May 14 16:08 Music
    Do the IDs match? If not, you could change the ownership. Say your id is "johnsmith"
    $ chown -R johnsmith Music
    Now try and access it with iTunes.

Maybe you are looking for