• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Help: unreported exception java.io.IOException; must be caught or declared to be thrown
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Help: unreported exception java.io.IOException; must be caught or declared to be thrown
      • From: Art Isbell <email@hidden>
  • Prev by Date: difference between 4.5. and 5.
  • Next by Date: NEWBIE! WO Authentication
  • Previous by thread: Re: difference between 4.5. and 5.
  • Next by thread: Re: Help: unreported exception java.io.IOException; must be caught or declared to be thrown
  • Index(es):
    • Date
    • Thread