--- /dev/null
+package mir.misc;
+
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import com.icl.saxon.ExtendedInputSource;
+
+/**
+ * Title:
+ * Description:
+ * Copyright: Copyright (c) 2001
+ * Company:
+ * @author
+ * @version 1.0
+ */
+
+
+public class InputSourceResolver {
+ private static InputSourceResolver single = new InputSourceResolver();
+ private String prefix = "";
+
+ /**
+ * InputSourceResolver constructor comment.
+ */
+ private InputSourceResolver() {
+ super();
+ }
+
+ /**
+ * Singleton Constructor
+ * @return de.matetrade.tools.InputSourceResolver
+ */
+ private static InputSourceResolver getInstance() {
+ return single;
+ }
+
+ /**
+ * This method was created in VisualAge.
+ * @return InputStream
+ * @param key java.lang.String
+ */
+ private InputStream getFileInputStream( String key )
+ throws IOException {
+
+ FileInputStream is = null;
+ try {
+ is = new FileInputStream( prefix + key );
+ } catch ( FileNotFoundException ex ) {
+ throw new IOException( "FileNotFoundExcpetion: input for <" + key + "> not found" );
+ }
+
+ return is;
+ }
+
+
+ /**
+ * This method was created in VisualAge.
+ * @return org.xml.sax.InputSource
+ * @param key java.lang.String
+ */
+ public static InputSource resolve( String key )
+ throws IOException {
+
+ InputSource is = new InputSource( single.getFileInputStream( key ) );
+ if ( key.indexOf( ':' ) >= 0 ) {
+ is.setSystemId( "file:///" + key ); // special for win (file:///c:/xxx)
+ } else {
+ is.setSystemId( "file://" + key );
+ }
+
+ return is;
+ }
+}
\ No newline at end of file