This discussion is archived
1 Reply Latest reply: Dec 15, 2012 2:36 PM by jtahlborn RSS

Using getResourceAsStream creates empty jar_cache*.tmp files

955291 Newbie
Currently Being Moderated
I was using getResourceAsStream to retrieve property files from my Tomcat server but, if keep temporary files is enabled on the client, it leaves a jar_cache files in the user's temporary directory.
I have tried both version 1.6 and 1.7.

Here is the code.
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
obj = contextClassLoader.getResourceAsStream("servletlocation.properties");
Properties properties = new Properties();
///////////////////////////////////////
if(obj != null)
{
obj = new BufferedInputStream(((InputStream) (obj)));
try
{
properties.load(((InputStream) (obj)));
loaded = true;
}
catch(Exception exception)
{
loaded = false;
}

}

Perhaps I am going about this wrong?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points