I have a
ejb cache that I am retrieving data from and writing that data to a file for ftp processing. I am using an ejb to do that that will be called via a timed function. I am having a problem getting anything to write to the file that is being created. The directory and file get created and I recieve no error messages from my write, but nothing shows up in my file. Here is the code that I am executing:
try
{
String dirName = ("c:\\AOSFTP");
String aosFileName = ("aosFtpFile.txt");
File aosFileDir = new File(dirName);
File aosFile = new File(dirName, aosFileName);
FileWriter fileWriter = new FileWriter(aosFileName);
BufferedWriter buffWriter = new BufferedWriter(fileWriter);
if(!aosFileDir.exists())
{
aosFileDir.mkdir();
}
else if(!aosFileDir.isDirectory())
{
System.out.println("The Directory does not exist");
return(1);
}
if(!aosFile.exists())
{
aosFile.createNewFile();
}
buffWriter.write(aosData);
buffWriter.flush();
//buffWriter.close();
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
Everything except the data is showing up......Any help would be greatly appreciated.