Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to locate the help files

 
Oliver Weikopf
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • 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?
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Jared Cope
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Sounds plausible. Guess I'll put a copy in the jar then.

Thanks a heap!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic