Hello,

I tested xml signature with URI="file:///work/test.txt" with C++ XMLsec library and works fine. With Java XMLsec library doesn't work.

What is wrong, or I am doing something wrong?

regards

        Matej


Matej Kafadar wrote:
Hello,

which URI reference is correct?

example:

I have file in absolute path "c:\work\test.txt"

XMLsec couldn't find the file, if URI looks like URI="file:///work/test.txt".
The exception is "Original Exception was java.io.FileNotFoundException: \\work\test.txt (The network path was not found)"


It can find it, if looks like URI="file:///c:/work/test.txt" or URI="file:/work/test.txt" or URI="file:/c:/work/test.txt".


In my test program, URI resolver can find all references.

public class TestURI {
  public static void main(String[] args) {
    //URI uri = URI.create("file:///work/test.txt");
    //URI uri = URI.create("file:///c:/work/test.txt");
    //URI uri = URI.create("file:/c:/work/test.txt");
    URI uri = URI.create("file:/work/test.txt");
    File f = new File(uri);
    System.out.println("exist="+f.exists());
  }
}


Why for URI="file:///work/test.txt" XMLsec tries to find file on network and class TestURI finds it on disk?
Or am I doing something wrong?



Best regards

    matej





Reply via email to