Help: unreported exception java.io.IOException; must be caught or declared to be thrown
Help: unreported exception java.io.IOException; must be caught or declared to be thrown
- Subject: Help: unreported exception java.io.IOException; must be caught or declared to be thrown
- From: Andre Olivier <email@hidden>
- Date: Mon, 3 Mar 2003 12:24:39 +0000
I want to display random files from the basePath given below. The code
was in WO4.5 and I have tried to convert it to WO5.1. I recieve above
error when compiling. What does this mean?
Rgrds
Andre
//
// Main.java: Class file for WO Component 'Main'
// Project randomNumber
//
// Created by andre on Mon Mar 03 2003
//
import com.webobjects.foundation.*;
import com.webobjects.appserver.*;
import com.webobjects.eocontrol.*;
import com.webobjects.eoaccess.*;
import java.io.*;
public class Main extends WOComponent {
/** @TypeInfo java.lang.String */
protected String[] filenames = {"one.jpg", "two.jpg", "three.jpg",
"four.jpq", 'five.jpg"};
protected String basePath = "Desktop:wowackExamples:chapter03";
protected int randomNumber;
//protected String filename;
protected NSData randomImage;
public Main(WOContext context) {
super(context);
}
public int randomNumber()
{
return (int)(Math.random()*6.0);
}
public void setRandomNumber(int newRandomNumber)
{
randomNumber = newRandomNumber;
}
public NSData randomImage()
{
String filename = basePath;
File file = new File( filename );
--> return new NSData(file);
}
public void setRandomImage(NSData newRandomImage)
{
randomImage = newRandomImage;
}
}
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.