protected InputStream getInputStream(String filename, boolean loadingPersistenceXML) {
InputStream inputStream = null;
try {
FileObject fileObject = getFileObject(filename, processingEnv);
inputStream = fileObject.openInputStream();
} catch (IOException ioe) {
// If we can't find the persistence.xml from the class output
// we'll try from the current directory using regular IO.
try {
inputStream = new FileInputStream(filename);