Packages and Resource files


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Packages and Resource files

  1. #1
    Join Date
    Sep 2004
    Posts
    223

    Packages and Resource files

    Hi everyone,

    I was just wondering if someone could help me understand the best (or simply a good way) way to open files inside a certain package in my desktop app that Im going to create in netbeans.

    I have a package like this:

    mypackage.resouces.xsdfiles
    and inside that I have several XSD files that I wish to load into memory, but I cant seem to even get an input stream for them no matter what I try

    currently im trying this sort of thing:
    InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("/mypackage/resources/xsdfiles/thisxsdfilename.xsd");

    but I only get null returned.

    Any help would be greatly appreciated

    Mark
    A kram a day keeps the doctor......guessing

  2. #2
    Join Date
    Sep 2005
    Location
    istanbul / Turkey
    Posts
    133
    /mypackage/resources/xsdfiles/thisxsdfilename.xsd is absolute address.
    please try mypackage/resources/xsdfiles/thisxsdfilename.xsd

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center