• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How to locate the help files

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I include my help files (userguide.html and five others) in the docs folder as specified in the instructions.
I also display these same files from within the application, using a JEditorPane.

So far, I assume the docs folder is located below the working directory and get it like this:


Since I execute the program in the application's root, that's fine, but I cannot be sure it will always be used as the working directory.
My problem is that I have no idea how to find the folder if the working directory differs. Has anyone else encountered and possibly solved this?
 
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Oliver

How about :


Regards M.
[ July 17, 2006: Message edited by: Mihai Radulescu ]
 
Oliver Weikopf
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mihai Radulescu:
Hi Oliver

How about :
[code]
final ClassLoder loader = getClassLoader();
final URL helpURL = loader.getResource("myHelp.html");
new JEditorPane(helpURL);
[code]

Regards M.



The problem with this is that the docs aren't in the classpath, so this won't find them. I'd have to include the files in the runme.jar for that, and that would mean including them twice, which doesn't sound like a good thing to do.
 
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Originally posted by Oliver Weikopf:

I'd have to include the files in the runme.jar for that, and that would mean including them twice, which doesn't sound like a good thing to do.



Well if it's any consolation, I planned on including my doco html in the .jar file for exactly the reasons you gave -- being able to find it reliably at runtime no matter where that jar file gets moved to. Duplication is a bad thing, but in this case I think it is warranted.

Alternatively, you could have a configuration file setting in suncertify.properties to tell your application which directory/location to use for the documentation. In the real world this makes more sense to me, but I have no idea how the examiners unpack our submission and run it so I am a little nervous about doing it that way.

Cheers, Jared.
 
Oliver Weikopf
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds plausible. Guess I'll put a copy in the jar then.

Thanks a heap!
 
Message for you sir! I think it is a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic