added new read() methods that read from URL (for urls) and String (for local filenames) objects.
This commit is contained in:
parent
0c20effa47
commit
61872cfac8
1 changed files with 15 additions and 4 deletions
|
@ -96,16 +96,27 @@ public abstract class ImageGenerator {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param urlString ...
|
* @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 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue