Package com.iizix.server.weblogos
Class WebLogo
java.lang.Object
com.iizix.server.weblogos.WebLogo
Class holding information about a logo of a website, typically "apple.com" or "www.apple.com", by trying various "smart" algorithms to extract the logo from the site.
- Method SummaryModifier and TypeMethodDescription- addCompletionListener- (Runnable runnable) Adds a completion listener that will wait for completion of the loading.- boolean- addListener- (IWebLogoListener listener) Adds a listener for the loading state.The exception the caused the failure when performing the loading of the logo for the Website.- getFile()Gets the file in the file provider system that should be used for the Website logo.- getSite()Gets the Website of the logo.- getState()Gets the state of the logo process.Gets the Web Server file in the file provider system that should be used for the Website logo.- booleanChecks if disposed.- boolean- removeListener- (IWebLogoListener listener) Removes a listener for the loading state.- waitForCompletion- (Runnable runnable) Waits for completion of the loading.
- Method Details- isDisposedpublic boolean isDisposed()Checks if disposed.- Returns:
- true if disposed of.
 
- waitForCompletionWaits for completion of the loading. The state must be in PENDING or LOADING mode. The current thread is blocked until it completes.- Once the loading has completed, the - runnablewill be invoked. Please note that if the- WebLogoinstance has been disposed of, no call to the- runnablewill be performed.- Parameters:
- runnable- Called when the loading completed, with or without error. Please check the- getState()or- getException().
- Returns:
- The state of the logo.
 
- addCompletionListenerAdds a completion listener that will wait for completion of the loading. The state must be in PENDING or LOADING mode.- The current thread is blocked until it completes. If you do not wish to have a blocking operation, use the - addListener(IWebLogoListener)- Once the loading has completed, the - runnablewill be invoked. Please note that if the- WebLogoinstance has been disposed of, no call to the- runnablewill be performed.- Parameters:
- runnable- Called when the loading completed, with or without error. Please check the- getState()or- getException().
- Returns:
- The state of the logo.
 
- getFileGets the file in the file provider system that should be used for the Website logo. It might be a ".png" (quite common), ".jpg", but also other formats such as SVG (".svg).- Returns:
- The file, it might NOT be loaded yet, this is can be null!
 
- getWSFileGets the Web Server file in the file provider system that should be used for the Website logo. It might be a ".png" (quite common), ".jpg", ".gif", but also other formats such as SVG (".svg).- Returns:
- The wsFile, it might NOT be loaded yet, this is can be null!
 
- getStateGets the state of the logo process.- Returns:
- The enumeration value of State.
 
- getExceptionThe exception the caused the failure when performing the loading of the logo for the Website.- Returns:
- The exception, or null for none.
 
- getSiteGets the Website of the logo.- Returns:
- The Website string such as "apple.com" or "www.apple.com".
 
- addListenerAdds a listener for the loading state.- Calling this method twice with the same listener will always return - false.- Parameters:
- listener- The listener that will be called from the loading thread.
- Returns:
- truewhen the listener is added successfully and that the- stateis not- WebLogoState.PENDING- WebLogoState.RETRIEVING
 
- removeListenerRemoves a listener for the loading state.- Calling this method twice with the same listener will always return - false.- Parameters:
- listener- The listener.
- Returns:
- truewhen the listener is removed successfully.