* @throws IOException
* Signals that an I/O exception has occurred.
*/
public void listener( UploadEvent event ) throws IOException
{
UploadItem item = event.getUploadItem();
System.out.println( "FileUploadBean.listener()" );
// Store the file info
FileInfo fileInfo = new FileInfo();
fileInfo.setName( item.getFileName() );
fileInfo.setLength( item.getFileSize() );
fileInfo.setData( item.getData() );
files.add( fileInfo );
// Write the file to disk
try
{
File inputFile = item.getFile();
File outputFile = new File( Settings.GRAPHS_PATH + item.getFileName() );
FileReader in = new FileReader( inputFile );
FileWriter out = new FileWriter( outputFile );
int c;
while( ( c = in.read() ) != -1 )
out.write( c );