Package com.iizix.server.wsfile
Class WSFileDownload
- java.lang.Object
- com.iizix.server.wsfile.WSFileDownload
- All Implemented Interfaces:
IWSFileDownload
public final class WSFileDownload extends java.lang.Object implements IWSFileDownload
Class used to hold information for file download into a file provider.- Author:
- Christopher Mindus
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Disposes of the download if in progress.java.lang.StringgetDescription()Gets the description of the download file.java.lang.ThrowablegetException()Gets the exception from the download process or when writing the file.java.io.FilegetFile()Gets the download file.java.lang.ObjectgetID()Gets the ID used for database identification.java.net.URLgetURL()Gets the URL.booleanisDisposed()Checks if the download is disposed of (during progress).java.lang.StringtoString()Returns a string representation of the file download instance.
Method Detail
getURL
public java.net.URL getURL()
Gets the URL.- Specified by:
getURLin interfaceIWSFileDownload- Returns:
- The URL.
getID
public java.lang.Object getID()
Gets the ID used for database identification.- Specified by:
getIDin interfaceIWSFileDownload- Returns:
- A Long or String,
nullwhen database is not used.
getDescription
public java.lang.String getDescription()
Gets the description of the download file.- Specified by:
getDescriptionin interfaceIWSFileDownload- Returns:
- The description.
dispose
public void dispose()
Disposes of the download if in progress.- Specified by:
disposein interfaceIWSFileDownload
isDisposed
public boolean isDisposed()
Checks if the download is disposed of (during progress).- Specified by:
isDisposedin interfaceIWSFileDownload- Returns:
- The dispose flag:
trueif download has been disposed of, i.e. canceled,falseotherwise.
getFile
public java.io.File getFile()
Gets the download file.- Specified by:
getFilein interfaceIWSFileDownload- Returns:
- The file, or null if an exception occurred.
getException
public java.lang.Throwable getException()
Gets the exception from the download process or when writing the file.- Specified by:
getExceptionin interfaceIWSFileDownload- Returns:
- The exception, or null if no error occurred.
toString
public java.lang.String toString()
Returns a string representation of the file download instance.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string formatted as className[url=URL,description=descr,...].