The easy Weblog and Wiki Software
[ start | index | login ]
start > comment-Victor Volle > bookservice-macro-2

bookservice-macro-2 commented Victor Volle/bookservice-macro

Created by Victor Volle. Last edited by Victor Volle, 3 years and 250 days ago. Viewed 76 times. #2
[diff] [history] [edit] [rdf]
labels
attachments
The code in Radeox (TextFileUrlMapper) is as follows:

try{
      BufferedReader br = new BufferedReader(
          new InputStreamReader(
              new FileInputStream(getFileName())));
      addMapping(br);
    } catch (IOException e) {
      log.warn("Unable to read " + getFileName());
      fileNotFound = true;
    }

if (fileNotFound) { BufferedReader br = null; try { br = new BufferedReader( new InputStreamReader( klass.getResourceAsStream("/"+getFileName()))); addMapping(br); } catch (Exception e) { log.warn("Unable to read /" + getFileName() + " from jar"); } }

So it first checks the file system for the path that is returned by getFileName(), which is "conf/bookservices.txt", and then the classpath. I haven't really tried to get this code running, since neither allows me to use a Snip.

4 comments (by stefanrufer, Victor Volle) | post comment

What is SnipSnap?
SnipSnap is a free and easy to install weblog and wiki tool written in Java.

SnipSnap download
Current version: 1.0b3-uttoxeter
Try our >>Web Start Demo!

Resources

5567 Users and 13712 Snips. Installed 6 years and 8 days ago

Logged in Users: (1)
… and 19 Guests.

snipsnap-changed for older changes.

< July 2008 >
SunMonTueWedThuFriSat
12345
6789101112
13141516171819
20212223242526
2728293031

snipsnap
Listed on BlogShares
XHTML 1.0 validated
CSS validated
RSS 2.0 validated
RSS Feed

pico-powered

Powered by SnipSnap 1.0b3-uttoxeter
YourKit >>Java Profiler

Fraunhofer FIRST

snipsnap.org | Copyright 2000-2006 Fraunhofer FIRST