cz.vity.freerapid.plugins.webclient.interfaces
Interface HttpFile

All Known Implementing Classes:
DownloadFile

public interface HttpFile

A JavaBean that represents file that is downloaded from the Internet.

Author:
Vity

Method Summary
 String getDescription()
          Description for this file (password etc.)
 long getDownloaded()
          Returns value - how many bytes were already downloaded for this file.
 String getFileName()
          Real physical file name of the downloaded file File name is initialized from given URL to some value.
 long getFileSize()
          Method to get whole file size of the give file.
 FileState getFileState()
          Getter
 URL getFileUrl()
          URL to file that is given by user
 String getPluginID()
          Plugin ID associated with this file
 Map<String,Object> getProperties()
          Getter for property 'properties'.
 File getSaveToDirectory()
          Returns target save directory
 DownloadState getState()
          Returns current download state of file.
 void setDescription(String description)
          Description for this file
 void setDownloaded(long downloaded)
          Sets how many bytes were already downloaded for this file
 void setFileName(String fileName)
          Sets file name
 void setFileSize(long fileSize)
          Setter to update file size (of complete file)
 void setFileState(FileState state)
          Setter
 void setNewURL(URL fileUrl)
          Sets new URL for this file for downloading.
 void setPluginID(String pluginID)
          Sets plugin ID associated with this file If pluginID is an empty string, the plugin ID selected automatically.
 void setState(DownloadState state)
          Setter
 

Method Detail

getFileSize

long getFileSize()
Method to get whole file size of the give file.

Returns:
<=0 if file is not known

setFileSize

void setFileSize(long fileSize)
Setter to update file size (of complete file)

Parameters:
fileSize - new value of file size

getState

DownloadState getState()
Returns current download state of file.

Returns:
download state of file

setState

void setState(DownloadState state)
Setter

Parameters:
state - new download state during downloading

getFileState

FileState getFileState()
Getter

Returns:
returns actual file state (its existence state on the server)

setFileState

void setFileState(FileState state)
Setter

Parameters:
state - new value of file state

getFileUrl

URL getFileUrl()
URL to file that is given by user

Returns:
URL of the downloaded file

getFileName

String getFileName()
Real physical file name of the downloaded file File name is initialized from given URL to some value. The final filename is updated by during makeFinalRequestForFile method

Returns:
this method should never return null value
See Also:
HttpDownloadClient.makeFinalRequestForFile(org.apache.commons.httpclient.HttpMethod, HttpFile, boolean);

setFileName

void setFileName(String fileName)
Sets file name

Parameters:
fileName - file name

setNewURL

void setNewURL(URL fileUrl)
Sets new URL for this file for downloading. Filename is extracted from this url. Filesize is set to 0.

Parameters:
fileUrl - new URL

setPluginID

void setPluginID(String pluginID)
Sets plugin ID associated with this file If pluginID is an empty string, the plugin ID selected automatically.

Parameters:
pluginID - plugin ID

getPluginID

String getPluginID()
Plugin ID associated with this file

Returns:

getDescription

String getDescription()
Description for this file (password etc.)

Returns:
description for this file

setDescription

void setDescription(String description)
Description for this file

Parameters:
description - new value description

getDownloaded

long getDownloaded()
Returns value - how many bytes were already downloaded for this file.

Returns:
file size in bytes

setDownloaded

void setDownloaded(long downloaded)
Sets how many bytes were already downloaded for this file

Parameters:
downloaded - file size in bytes

getSaveToDirectory

File getSaveToDirectory()
Returns target save directory

Returns:
directory

getProperties

Map<String,Object> getProperties()
Getter for property 'properties'.

Returns:
Value for property 'properties'.