ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 28779] - Problem reading resource from jar-file
Date Mon, 10 Jul 2006 06:30:30 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28779>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=28779


jan@materne.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From jan@materne.de  2006-07-10 06:30 -------
Current status is "NEW" and not "REOPENED", so I think Stefan has forgotten to
close the bug in 2005.

And I did a retest which works for me:

build.xml
----------------------------------------
<project>
  <javac srcdir="." destdir="."/>
  <jar destfile="test.jar" excludes="*.jar" basedir="."/>
  <java classname="MyClass" classpath="test.jar"/>
</project>


myFile.xml
----------------------------------------
<myfile/>


MyClass.java
----------------------------------------
public class MyClass {
    public static void main(String[] args) {
        MyClass cl = new MyClass();
        cl.run();
    }
    
    public void run() {
        java.io.InputStream is = getClass().getResourceAsStream( "myFile.xml" );
        System.out.println("is="+is);
        System.out.println("Content:");
        try {
            int ch = is.read();
            while (ch!=-1) {
                System.out.print( (char)ch );
                ch = is.read();
            }
            is.close();
        } catch (java.io.IOException ioe) {
        }
        System.out.println();
    }
}



Apache Ant version 1.7alpha compiled on July 7 2006

Buildfile: build.xml
    [javac] Compiling 1 source file to C:\tmp\ant-28779-jar+resources
      [jar] Building jar: C:\tmp\ant-28779-jar+resources\test.jar
     [java] is=java.util.zip.ZipFile$2@765a16
     [java] Content:
     [java] <myfile/>

BUILD SUCCESSFUL

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message