|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.java.plugin.Plugin cz.vity.freerapid.plugins.webclient.AbstractFileShareService
public abstract class AbstractFileShareService
Implements ShareDownloadService and adds basic functionality
Field Summary |
---|
Fields inherited from class org.java.plugin.Plugin |
---|
log |
Constructor Summary | |
---|---|
AbstractFileShareService()
Constructor AbstractFileShareService creates a new AbstractFileShareService instance. |
Method Summary | |
---|---|
protected void |
doStart()
|
protected void |
doStop()
|
protected PremiumAccount |
getAccountConfigFromFile(String pluginConfigFile)
Loads PremiumAccount information from file. |
Icon |
getFaviconImage()
Returns small icon (16x16) that represents service on the web |
String |
getId()
Unique ID of the plugin |
PluginContext |
getPluginContext()
Returns instance of plugin context to allow access UI or Locale storage |
protected abstract PluginRunner |
getPluginRunnerInstance()
Returns new instance of "plugin's worker" - its methods are called from this class Instance should not be cached. |
protected void |
checkSupportedURL(HttpFileDownloadTask downloadTask)
Method checkSupportedURL ... |
void |
run(HttpFileDownloadTask downloadTask)
Main executable method for downloading file |
void |
runCheck(HttpFileDownloadTask downloadTask)
Checks for file existence before downloading Shouldn't be called if the supportsRunCheck method returns false |
void |
setPluginContext(PluginContext pluginContext)
Sets the new plugin context for this plugin |
protected PremiumAccount |
showAccountDialog(PremiumAccount account,
String dialogTitle,
String pluginConfigFile)
Shows standard account dialog with given account |
void |
showOptions()
Method called from user preferences to show configurable dialog to user |
boolean |
supportsRunCheck()
Checks whether implementation/service supports a check for file existence before downloading |
protected boolean |
supportURL(String url)
Method supportURL checks whether active plugin supports given URL |
String |
toString()
|
Methods inherited from class org.java.plugin.Plugin |
---|
getDescriptor, getManager, isActive |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface cz.vity.freerapid.plugins.webclient.interfaces.ShareDownloadService |
---|
getMaxDownloadsFromOneIP, getName |
Constructor Detail |
---|
public AbstractFileShareService()
Method Detail |
---|
protected void doStart() throws Exception
doStart
in class org.java.plugin.Plugin
Exception
protected void doStop() throws Exception
doStop
in class org.java.plugin.Plugin
Exception
public Icon getFaviconImage()
ShareDownloadService
getFaviconImage
in interface ShareDownloadService
public String getId()
ShareDownloadService
getId
in interface ShareDownloadService
protected boolean supportURL(String url)
url
- given URL to test
public String toString()
toString
in class org.java.plugin.Plugin
public void run(HttpFileDownloadTask downloadTask) throws Exception
ShareDownloadService
run
in interface ShareDownloadService
downloadTask
- file that is being downloaded
Exception
- exception during downloadingpublic void runCheck(HttpFileDownloadTask downloadTask) throws Exception
ShareDownloadService
runCheck
in interface ShareDownloadService
downloadTask
- file that is being checked
Exception
IllegalStateException
- if service does not supports checking filepublic boolean supportsRunCheck()
ShareDownloadService
supportsRunCheck
in interface ShareDownloadService
public void showOptions() throws Exception
ShareDownloadService
showOptions
in interface ShareDownloadService
Exception
public PluginContext getPluginContext()
ShareDownloadService
getPluginContext
in interface ShareDownloadService
protected void checkSupportedURL(HttpFileDownloadTask downloadTask) throws NotSupportedDownloadByServiceException
downloadTask
-
NotSupportedDownloadByServiceException
- whenpublic void setPluginContext(PluginContext pluginContext)
ShareDownloadService
setPluginContext
in interface ShareDownloadService
pluginContext
- instance of plugin contextprotected PremiumAccount showAccountDialog(PremiumAccount account, String dialogTitle, String pluginConfigFile)
account
- account with user name and passworddialogTitle
- title for dialogpluginConfigFile
- file name for storing configuration
protected PremiumAccount getAccountConfigFromFile(String pluginConfigFile)
pluginConfigFile
- file name of configuration file
protected abstract PluginRunner getPluginRunnerInstance()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |