Is it possible to load attributes files from inside the jar file in a plugin?

I tried the following:

   1 String attrs[] = new String[2];
   2 attrs[0] = getClass().getResource("/file1.txt").toString();
   3 attrs[1] = getClass().getResource("/file2.txt").toString();
   4 Cytoscape.loadAttributes(attrs, null);

but I got an exception: jar:file:plugins/test.jar!/file1.txt(No
such file or directory)

and in my plugin:

$ jar tvf test.jar
    25 Thu Jul 14 11:13:20 CEST 2005 META-INF/MANIFEST.MF
  1974 Thu Jul 14 11:11:14 CEST 2005 csplugins/test/TestPlugin.class
  88501 Thu Jul 14 10:59:00 CEST 2005 file1.txt
226650 Thu Jul 14 10:59:00 CEST 2005 file2.txt 

LoadAttributesFilesInsideJar (last edited 2009-02-12 01:03:38 by localhost)

Funding for Cytoscape is provided by a federal grant from the U.S. National Institute of General Medical Sciences (NIGMS) of the Na tional Institutes of Health (NIH) under award number GM070743-01. Corporate funding is provided through a contract from Unilever PLC.

MoinMoin Appliance - Powered by TurnKey Linux