CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2009
    Posts
    7

    WebStart Resources on Filesystem

    We're currently using Sun's J2SE 1.5 package. Could someone give suggestions on how to determine the full pathname on the client system that a webstart applications resources (specifically JAR files) reside?. In Java 1.4 this was possible with Class.getResource(String).getPath() (which would return a URL of the type "file:") but this no longer seems to be the case in 1.5.

    All ideas and suggestions would be appreciated

  2. #2
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: WebStart Resources on Filesystem

    We've migrated a Java 1.4 Web Start application to 1.5 without any problems, but I don't recall needing to know where the jars are put by Web Start... the class loader finds resources in the jars, and we put data for local storage into the user home or working directories.

    What do you get back from the Class.getResource(String).getPath() call?

    Today, most software exists, not to solve a problem, but to interface with other software...
    I. O. Angell
    Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

  3. #3
    Join Date
    Sep 2009
    Posts
    7

    Re: WebStart Resources on Filesystem

    Quote Originally Posted by dlorde View Post
    What do you get back from the Class.getResource(String).getPath() call?
    It used to return a "file:" type URL that would be pointer to the class/method on the local filesystem, but since the move to 1.5, it now shows an "http:" type URL reference that points back to the origin server. I'm hoping this is just a config change. Something that needs to be added.

  4. #4
    Join Date
    Sep 2009
    Posts
    7

    Re: WebStart Resources on Filesystem

    Pointer to the JAR / class, I meant.

  5. #5
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: WebStart Resources on Filesystem

    OK... so what is it you are trying to achieve (why do you need to know the absolute path) ?

    If you're not failing every now and again, it's a sign you're not doing anything very innovative...
    W. Allen
    Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

  6. #6
    Join Date
    Sep 2009
    Posts
    7

    Re: WebStart Resources on Filesystem

    Have to spawn a new JVM that needs those webstart classes in its classpath

  7. #7
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: WebStart Resources on Filesystem

    OIC... on my system, the jars in the web start cache are all renamed by the JWS cache manager, so you'd have to know the JWS jar naming convention...

    I don't have an answer to your requirement - as I understand it, you can only access local files via the ServiceManager (see JWS Runtime Client Services), so maybe you can find something there you can use.

    Any programming problem can be solved by adding a level of indirection...
    Anon.
    Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured