added new read() methods that read from URL (for urls) and String (for local filenames) objects.

This commit is contained in:
lehni 2004-07-12 15:19:13 +00:00
parent 0c20effa47
commit 61872cfac8

View file

@ -94,18 +94,29 @@ public abstract class ImageGenerator {
Image img = read(src); Image img = read(src);
return img != null ? new ImageWrapper(img, this) : null; return img != null ? new ImageWrapper(img, this) : null;
} }
/**
* @param filenamne ...
*
* @return ...
* @throws IOException
*/
public ImageWrapper createImage(String filenamne)
throws IOException {
Image img = read(filenamne);
return img != null ? new ImageWrapper(img, this) : null;
}
/** /**
* @param urlString ... * @param url ...
* *
* @return ... * @return ...
* @throws MalformedURLException * @throws MalformedURLException
* @throws IOException * @throws IOException
* @throws MalformedURLException ...
*/ */
public ImageWrapper createImage(String urlString) public ImageWrapper createImage(URL url)
throws MalformedURLException, IOException { throws MalformedURLException, IOException {
Image img = read(new URL(urlString)); Image img = read(url);
return img != null ? new ImageWrapper(img, this) : null; return img != null ? new ImageWrapper(img, this) : null;
} }