public abstract class ImageDecoder
extends java.lang.Object
implements java.io.Closeable
| Modifier and Type | Field and Description |
|---|---|
protected ScrapingSession |
session
The Scraping Session, used for logging and getting any needed info, such as the current proxy, and scraping state
|
| Modifier | Constructor and Description |
|---|---|
protected |
ImageDecoder(ScrapingSession session)
Creates an ImageDecoder to be used during the session (or a portion of it)
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
close()
Closes any resources associated with the decoder.
|
abstract DecodedImage |
decodeFile(java.io.File file)
Converts the image given to a DecodedImage that will handle it.
|
DecodedImage |
decodeFile(java.lang.String file)
Converts the image given to a DecodedImage that will handle it.
|
DecodedImage |
decodeURL(java.lang.String url)
Converts the image at the given URL to a DecodedImage that will handle it.
|
abstract double |
getBalance()
Returns the current balance of the account (if it can be accessed via the API).
|
void |
setAutoCloseAfterScrapeEnds()
Tells the data manager to close when the scrape ends.
|
protected ScrapingSession session
protected ImageDecoder(ScrapingSession session)
session - The scraping session@NotNull public DecodedImage decodeFile(@Nullable java.lang.String file) throws java.io.IOException
file - The image filejava.io.IOException - If there is an error reading the file@NotNull public abstract DecodedImage decodeFile(@NotNull java.io.File file)
file - The image file@NotNull public DecodedImage decodeURL(@NotNull java.lang.String url)
url - The url to the imagepublic abstract double getBalance()
public abstract void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic void setAutoCloseAfterScrapeEnds()