How to forced JWS to download only jar we want

Hi everybody !
In my application, which run from an ftp adress with Java Web Start, I load a main jar.
After, I will have the opportunity to load in the cache any secondary jar I want (those jar are not required by the application at the beginning) : I just want to click an a button to load the jar I want.
I try to put a download="lazy" in the jnlp file, but JWS still download the secondary jar after the application is loaded : it is possible to forced JWS to not download this secondary jar, in the optic to download it manually after ?
Thanks in advance !!!

You need more than download="lazy" in the jnlp..... You also need to specify part="{somthing}" ...for example (Taken from vamphq).
<jar href="skinlf.jar" download="lazy" part="skinlf"/>Then, in your client code, you need to explicitly instruct webstart to download this part - use the following (Modified from webstat developers guide):
DownloadService ds;
         try {
             ds = (DownloadService)ServiceManager.lookup("javax.jnlp.DownloadService");
         } catch (UnavailableServiceException e) {
             ds = null;
         if (ds != null) {
             try {
                 // determine if a particular resource is cached
                 boolean cached = ds.isPartCached("skinlf");
                 if (!cached) {
                 // Load the resource into the cache
                 DownloadServiceListener dsl = ds.getDefaultProgressWindow();
                 ds.loadPart("skinlf",dsl);
             } catch (Exception e) {
                 e.printStackTrace();
         } You cant put any references to any class in the java that you are downloading in this file... Because, it will crash with 'Class not found'. Instead, use reflection to dynamically load your class. Ie, instead of doing:
new org.me.DownloadedClass();do this instead
Class.forName("org.me.DownloadedClass").newInstance();Message was edited by:
tonywestonuk

Similar Messages

  • How to authenticate a JWS Client download of jar files on a web server

    Here is a history of how i tried to implement the auth system:
    The resources(jar files) cannot be downloaded by any HTTP client from the server without some authentication method.
    As JWS is not reliable when using cookies (only 1.5 supports them, but with problems when in JNLP file i specify j2se version=older that 1.5) , i implemented another mecanism that works like this:
    1. 1.The template JNLP looks like this
    <?xml version="1.0" encoding="utf-8"?>
    <jnlp codebase="http://10.3.0.62/" href="mapped/#JWS_CODE#___#PLATFORM#___app2.2.jnlp">
        <information>
           bla bla
        </information>
        <security>
            <all-permissions/>
        </security>
        <resources>
            <j2se version="1.4"/>
            <jar href="http://10.3.0.62/mapped/gui.jar?jwsid=#JWS_CODE#" version="2.2"/>
            <jar href="http://10.3.0.62/mapped/data.jar?jwsid=#JWS_CODE#" version="2.2"/>
            <jar href="http://10.3.0.62/mapped/log4j.jar?jwsid=#JWS_CODE#"/>
        </resources>
        <application-desc main-class="com.bet.blues.gui.Application">
            <argument>-host</argument>
            <argument>ursus</argument>
            <argument>-port</argument>
            <argument>17771</argument>
        </application-desc>
    </jnlp>2. All resources found in /mapped/ directory are mapped to JWSServlet
    3. The users login to a site , clik on link , /mapped/app2.2.jnlp , the servlet checks if the session is active , gets the PLATFORM form browser request header , gets the JWSCODE for the logged user, replaces this in the template, and returns it to the client
    4.Now after the 1st download the JNLP file is opened by JWS Client , that checks for latest version , requesting the JNLP file again
    like this:
    GET http://10.3.0.62/mapped/f12ks21092___windows___app2.2.jnlp5.Now the servlet sees the the request has a JNLP file name with an ID and PLATFORM, and serves the JNLP as before
    6.The JWS Client will request for JAR Files
    GET http://10.3.0.62/mapped/gui.jar?jwscode=f12ks21092?version-id=2.2Note: that i have forced JWSID parameter in the URL, that's why the query string contains 2 "?"
    - forcing this is because the mapped/*.jar is redirected JnlpDownloadServlet that supports versions , diffs - i cannot use 'version' to put there the jswid param(e.g .../mapped/gui.jar version="fk12ks21092_2.2" because the JnlpDownloadServlet will not find this version , and if JWS Servlet will redirect to JnlpDownloadServlet with correct version param in request, the JWS Client will raise an exception because version responded is not right(JNLPDownloadServlet marks in response HTTP header the version of the jar so JWS CLient will chek it)
    JWS Client expects version 'fk12ks21092_ver2.2'; to correct this i should modify the JnlpDownloadServlet and i shouldnt
    THE PROBLEM :
    on older versions than 1.5 JWS Client raises an exception because it wants to create a temp file named
    " gui.jar?jwscode=f12ks21092" because it contains "?"
    Only with 1.5 that seems to parse the jar name until it meets "?" char :(
    Thats why i wanted to send an error to the client to upgrade to Java Web Start 1.5
    Now, maybe u have a solution to this problem...
    All i want is a solution to let JWS Client download jars only if the user is authenticated by some mecanism....and also support the versioning system.
    Also:
    Note that the jar names must preserve on the client JWS Cache dir ( i cannot use the same method to pass the JWSCODE when requesting the JARS as when requesting the JNLP).

    You need to look into JAAS

  • How to force RH9 to use only one master stylesheet for all Word imports?

    I have set a stylesheet (css) as the default for my RH9 WebHelp project in project settings. When I import Word documents into the project, the edit import setting dialog does not show this stylesheet in the list of available stylesheets for the import.
    What is happening instead is a proliferation of unwanted stylesheets derived from all the imported documents. I then have to manually re-set all the new topics to the master stylesheet.
    How can I stop this, and force RH9 to use only the one master stylesheet for all imports?

    cid:[email protected]
    Hi Peter,
    That’s what I thought I was doing in the Project Settings>Import tab>CSS for Style Mapping selection. Maybe that isn’t what it’s meant to do. It’s just getting annoying having all these unneeded files popping up in the project manager so that I have trouble distinguishing the “real” topics from the extra stuff.
    Michael West | Business Improvement | Aurecon
    Ph: +61 3 8683 1996 | Fax: +61 3 8683 1444 | Mob: 0407 485 228
    Email: [email protected]
    PO Box 321, South Melbourne | VIC 3205 | Australia
    http://www.aurecongroup.com
    http://www.aurecongroup.com/apac/groupentity/

  • How to force FF to download a file that is in cache automatically

    We have files that others download. The files get changed frequently but have the same name in the same remote folder.
    Many times when they download from a link FF does not download it again but uses the last file (same name) that we previously downloaded.
    I do not have control of the user who is doing the download.
    The files in question are Windows exe files.
    The user doing the download is on Windows.
    So how can we force FF to download the file and not use the old file in cache????

    A good place to ask advice about web development is at the mozillaZine "Web Development/Standards Evangelism" forum.
    *http://forums.mozillazine.org/viewforum.php?f=25
    The helpers at that forum are more knowledgeable about web development issues.<br>
    You need to register at the mozillaZine forum site in order to post at that forum.

  • How to force iTunes to download purchased media?

    This has happened to me at least twice so far and it annoys the **** out of me. Here's the situation:
    I purchased and downloaded media on one computer with this Apple ID and I come back later and want to download it on another computer. The second computer is authorized to download stuff so that's not the issue, but then this happens:
    If I go to my library, the album/movie in question isn't there (because I downloaded it on another computer)
    If I view that album/movie in the store, the purchase button is greyed out and says "Purchased".
    Here's the kicker: If I select "Check for Available Downloads..." from the "Store" menu, it pops up a message that says "All purchases have been downloaded for this Apple ID."
    I call BS. All purchases have NOT been downloaded! It says I purchased [album/movie title] but it's not in my library. How do I make iTunes download media I've purchased when it spews out blatantly false statements denying I need to?
    This is on Windows 7, in case it's a platform dependent bug. It's certainly some sort of bug when your program says there are no downloads available when clearly there are. :/

    Different people have different ways of wanting to manage their libraries and their purchases. In this context whenever you make a purchase it remains "available for download" until it has been successfully downloaded to one of your computers or devices.
    For items that are available for repeat download on demand (audiobooks are not for example, and the rules can vary by region) you can then download them to any of your other computers or devices using the cloud links that can be enabled in your library (iTunes > Edit > Preferences > Store > Show iTunes in the Cloud Purchases - iOS device > Settings > Music > Show All Music) or via the "Purchased" links (iTunes > iTunes Store > Quick Links > Purchased - iOS device > iTunes Store > More > Purchased).
    On your computers you can also enable automatic downloads of all eligible purchases via Edit > Preferences > Store > Automatic Downloads and tick the options for Music, Apps & Books as appropriate.
    If you purchase anything that is subject to a one download policy then it is your responsibility to transfer it to a computer, if necessary, and then back it up. You should backup all content really since any item may be withdrawn from the iTunes Store without notice at any time.
    tt2

  • How Does One Backup a Downloadable-Only Software App?

    Plan to purchase new Final Cut Pro X but discovered it is only available as a download from the App Store without the usual CD/DVD for one's files. Given this, how is one to keep a copy for future use if upgrading to a new platform or rebuilding one's existing hard drive etc.?

    Dah.veed!
    Thank you for the prompt response to my question. Much appreciated. I can now go ahead and purchase FCP X knowing there is a way to maintain a back-up copy for future use.
    I noticed your long association with Mac! I started in 1986 with with an SE, gave gone through seven different platforms in the interim and and currently use a 24" iMac.
    Ybles

  • Help: how to get contents of downloaded webstart jar

    I have a small webstart application which has an associated resources jar file, ie.
    <jar href="resources.jar" />
    The jar is generated dynamically elsewhere with my processes.
    When a webstart client starts up, I need to look into one of the folders contained within the resources.jar, ie. something like:
    String[] filenames = new File("dynamic-resources-dir").list(new FilenameFilter()...
    I have no problems to pull individual files out of the jar by using:
    URL url = getInstance().getClass().getClassLoader().getResource(filename);
    But then I still don't have the dynamic list of filenames I actually need to extract.
    Any tips on how to solve this?
    Cheers
    Peter

    Hi,
    I am doing something similar to what you did here. But I have a question, how did you handle the signing of the jar file that is dynamically created?
    In my case, I can create a jar file but at the client side it is complaining of the unsigned jar. Your help is highly appreciated.
    Thanks,
    Subhash

  • How to Force PDF to Print Only in Black

    I have an old HP 932C that's been working fine until recently. It quit printing blue. Bought a new cartridge and there's no difference. I've run the diagnostics for the printer--fairly primitive and no help. I probably need a new one at this point, but right now I need to print out a form I have in PDF. It's got a lot of blue in it and it prints out this sickly pinkish that just won't work. I'm just looking for a way to "force" this PDF to print only in black. Any tips?
    Also I'd love to see any advice about trying get this old printer to print blue again. The print nozzles are contained in the cartridges so changing out the color cartridge gets me new nozzles. I've inspected the electrical contact area of the cartridge holder in the printer and it looks fine.
    Thanks,
    Steve M.

    Or is there some other software that I am missing or that I could add?
    It's not in the printer driver, it's part of the OZS/Colorsync/Quartz... been so long I forget, but...
    See if in the Print Dialog you have Print settings & an option for grayscale.
    B&W is supposed to be a default filter...
    http://en.wikipedia.org/wiki/ColorSync
    /Library/ColorSync/Profiles/Black & White.icc
    /Library/Application Support/Adobe/Color/Profiles/BlackWhite.icc
    See also for clues...
    http://www.macsimumnews.com/index.php/archive/theinside_wire_colorsync_andquartz
    Message was edited by: BDAqua

  • How can I have Mail download only 2 years of my Gmail?

    The Mac mailbox for my Gmail account is 30 GB which is too much on a MacBook Air. I do want a two years of my personal and business emails available offline. But I don't need commercial mailinglists or old mail. I do want to keep them on the Gmail server.
    Is there a good way to specify a time limit or set of mailboxes with the current version of mail. I like the new Mac Mail approach of keeping the messages in the All Mail folder, despite lables, because it reduces duplicates. But as a result the Gmail IMAP setting to limit downloads to 10,000 messages isn't big enough to give me the number of messages I want on the local drive.
    Is there a way to get mail to have smarter limits on what is stored locally?
    Saul
    PS I know Airmail does that, but I haven't had luck with that program.

    Hi derreeg Open mail and go to prefs, then select accounts, select your gmail account and click the tab in the right frame called Advanced, there is a check-box you can UNCHECK called include when automatically checking for new mail.
    dah dah all done, mail will now not check for new emails sent to your gmail account.
    Hopes that helps

  • How do I get capital letters ONLY when I want them?

    I had the same problem long ago, but I have forgotten how I fixed it. As things are now, I have to keep resetting the keyboard by clicking on the SHIFT key and then the CAPS LOCK key. This fix doesn't last very long. What is a more permanent one?

    mr.k99 wrote:
    Just checking: you are sure you are not just accidentaly hitting the caps lock? Also: does this happen with different keyboards?
    No, I'm not sure, but when this happened years ago, someone told me how to stop this from happening, and it didn't involve my typing. I only have one keyboard.

  • Download only half movie

    Hello, I really dont know what I should have written in the
    tittle, but I can explain it better here.
    I am developing a flash movie to my website and the movie is
    getting kinda big, since all the features are being included in it.
    The problem is that even the features that ae not used are being
    loaded.
    What I want is to load only the things that the user will
    actually use in that moment. Is there a way to do that?
    The current movie has a big TV and everything that the user
    uses is displayed on the TV.
    Right now, the user can see a video, can play a game and see
    some pictures. But he does not use them at the same time, how do I
    make he download only the part he is using?
    See ya!
    Augusto

    make you flash movie have pages, a background and buttons.
    load them all into separate layers. i always make my background
    have the copyright and logos on it. then it loads on level 0. the
    buttons.swf loads on level 1 and the pages only load when the user
    requests them on level 2. each "page" is a separate swf.

  • Force JWS to preload Jars.

    Hello,
    I would like to force JWS to first download any outdated jars. And then only when all these jars have been downloaded should the Main statup class be called.
    Is this possible?
    Background is that my startup classes do some classloading and URLConnection stuff which disturbes the JWS update protocol code.
    Edited by: javastorm on Mar 25, 2010 10:08 AM

    javastorm wrote:
    Hello,
    I would like to force JWS to first download any outdated jars. And then only when all these jars have been downloaded should the Main statup class be called.
    Is this possible?I'd have said, not only possible, but easy, until I read..
    Background is that my startup classes do some classloading and URLConnection stuff which disturbes the JWS update protocol code...that. What exactly do you mean by those statements? Are the Jars in question refered to in the resources section of the JNLP file(s)? What is the custom class loading/URLConnection 'stuff' meant to achieve, and how is it implemented?

  • How do i find and download jar files?

    I have some old code and it uses import com.sun.java_cup.internal.parser
    When compiling gives error on this.
    Googleing this shows that its part of the rt.jar file. rt.jar is in the jre/lib folder. That is part of my classpath but still wont compile how do i find what an import belongs to and where can i download these jar files..
    Java really is not a friendly language to me.

    You don't need to download the rt.jar or do anything with it since it's an integral part of the JRE. If a class isn't there, then because you have too old a JRE/JDK and it's not there yet, or because it was never part of the public API and is gone now.
    When I google, I only find references to Java 6. So you probably need that, which means the sources can't be sooo old.

  • HT204365 How do I force my PDF downloads on my device to sync to my MacBook?

    How do I force my PDF downloads on my device to sync to my MacBook? I can see them in the list of books on my device, and I have syncing on, but they won't sync. Only books I've bought are syncing.

    settings->itunes & app stores->click on unwanted appleid and choose logout

  • How to force support for Long preamble only?

    how to force support for Long preamble only?
    Last edited by jackphil (2012-01-04 03:17:12)

    Hi,
    Thanks for your reply.
    I have downloaded the workspace containing the sample application from the address you provided. I have done the following changes to the application:
    1. Created AdcsResourceBundle_fo.java in the same package as AdcsResourceBundle.java
    2. Configured locale in faces-config.xml
    <locale-config>
          <default-locale>fo</default-locale>
          <supported-locale>fo</supported-locale>
        </locale-config>Indeed the messages are taken from AdcsResourceBundle_fo.java (I've tested the PanelCollection), but the problem with the number inputText is still there.
    Test scenario:
    Drag and drop DepartmentsView1 from Data Control to showDetailItem 1 in Table.jspx -> Create -> Forms -> ADF Form
    When the page is run, the 'Splash' image and 'Loading..' remains on the browser window and nothing else happens. And again, no messages in the server log.
    Is there anything else that needs to be configured?
    Anca

Maybe you are looking for

  • Installed OS 10.9.5 and now screen is frozen.  Cannot restart or shut down.

    Installed Yosemite 10.9.5 and now screen is frozen.  Cannot restart or shut down.  Have done Repair Permissions but still not working.

  • Failed to retrieve data from the database. [Database Vendor Code: 916]

    I am recieving this error when the report is called from my asp.net application.  Out of 50 or so reports, this is the only one that I am having an issue with, and I imagine the reason is that the strored procedure it calls joins to a 2nd database fo

  • OIM GTC Connector

    Hi All, I have a requirement where I need to provision and reconcile into multiple flat files and metadata in each of them may differ. So I was planning to create custom GTC connector each for provisioning and reconciliation respectively. Can anyone

  • Portal URL's

    How do I change the servername Portal uses to build the <a href> URLs? I have created a VirtualHost for my Portal server, configured the Site-to-Server in my WebCache but when I got to my VirtualHost URL, I get the Portal page, but all the links use

  • Muse crashed and afterwards, error message saying site file damaged and will not open

    I was working on a muse file when it shut down due to "an error". When I tried to open the file again, it told me that the site was damaged and could not be opened. I have a PC and I would like to know if there is any way I can get the file checked o