<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.6249.1">
<TITLE>CmsImport</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><SPAN LANG="fr-be"><FONT SIZE=2 FACE="Arial">Hello,</FONT></SPAN>
</P>
<P><SPAN LANG="fr-be"><FONT SIZE=2 FACE="Arial">I'mm novice using OpenCms and I want to import a file in a OpenCMS project using a class JAVA called in a template.</FONT></SPAN>
</P>
<P><SPAN LANG="fr-be"><FONT SIZE=2 FACE="Arial">Hereafter the code to import a file from a filesystem. I receive a "java.lang.NullPointerException. </FONT></SPAN>
<BR><SPAN LANG="fr-be"><FONT SIZE=2 FACE="Arial">". What's wrong in this code ?</FONT></SPAN>
</P>
<P><SPAN LANG="fr-be"><FONT SIZE=2 FACE="Arial">public Object getMail(CmsObject cms, String tagcontent, A_CmsXmlContent doc, Object userObject) {</FONT></SPAN>
<BR><SPAN LANG="fr-be"><FONT SIZE=2 FACE="Arial">...</FONT></SPAN>
<BR><SPAN LANG="fr-be"><FONT SIZE=2 FACE="Arial"> I_CmsReport I_CmsRep = null;</FONT></SPAN>
<BR><SPAN LANG="fr-be"><FONT SIZE=2 FACE="Arial"> String strFile = null;</FONT></SPAN>
<BR><SPAN LANG="fr-be"><FONT SIZE=2 FACE="Arial"> strFile = "c:\temp\myfile.txt";</FONT></SPAN>
<BR><SPAN LANG="fr-be"><FONT SIZE=2 FACE="Arial"> CmsImport cmsImp = new CmsImport(cms, strFile, I_CmsWpConstants.C_VFS_PATH_LOCALES, I_CmsRep);</FONT></SPAN>
<BR><SPAN LANG="fr-be"><FONT SIZE=2 FACE="Arial"> cmsImp.importResources();</FONT></SPAN>
</P>
<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">}</FONT></SPAN>
</P>
<BR>
<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">Thanks,</FONT></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial"> David GALLONE</FONT></SPAN>
</P>
</BODY>
</HTML>