com.aelitis.azureus.core.download
Class DiskManagerFileInfoURL

java.lang.Object
  extended by com.aelitis.azureus.core.download.DiskManagerFileInfoURL
All Implemented Interfaces:
SEPasswordListener, DiskManagerFileInfo

public class DiskManagerFileInfoURL
extends Object
implements DiskManagerFileInfo, SEPasswordListener


Nested Class Summary
protected  class DiskManagerFileInfoURL.channel
           
 
Field Summary
 
Fields inherited from interface org.gudy.azureus2.plugins.disk.DiskManagerFileInfo
PRIORITY_HIGH, PRIORITY_LOW, PRIORITY_NORMAL, READ, WRITE
 
Constructor Summary
DiskManagerFileInfoURL(URL _url)
           
 
Method Summary
 void clearPasswords()
           
 DiskManagerFileInfoURL.channel createChannel()
           
 DiskManagerRandomReadRequest createRandomReadRequest(long file_offset, long length, boolean reverse_order, DiskManagerListener listener)
          Creates a random read request - these will be executed against the download sequentially
 void download()
           
 int getAccessMode()
           
 PasswordAuthentication getAuthentication(String realm, URL tracker)
           
 Download getDownload()
           
 long getDownloaded()
           
 byte[] getDownloadHash()
           
 File getFile()
           
 File getFile(boolean follow_link)
          returns liked file if it exists, direct otherwise
 int getFirstPieceNumber()
           
 int getIndex()
           
 long getLength()
          Size when file is complete
 File getLink()
           
 int getNumericPriority()
           
 int getNumericPriorty()
           
 int getNumPieces()
           
 long getPieceSize()
           
 URL getURL()
           
 boolean isDeleted()
           
 boolean isPriority()
           
 boolean isSkipped()
           
 void setAuthenticationOutcome(String realm, URL tracker, boolean success)
           
 void setDeleted(boolean b)
          Mark the file as deleted or not (deleted means the file will be truncated to take up minimum space).
 void setLink(File link_destination)
           
 void setNumericPriority(int priority)
          Sets the file's download priority base on a number
 void setPriority(boolean b)
           
 void setSkipped(boolean b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiskManagerFileInfoURL

public DiskManagerFileInfoURL(URL _url)
Method Detail

getURL

public URL getURL()

download

public void download()

setPriority

public void setPriority(boolean b)
Specified by:
setPriority in interface DiskManagerFileInfo

setSkipped

public void setSkipped(boolean b)
Specified by:
setSkipped in interface DiskManagerFileInfo

getNumericPriority

public int getNumericPriority()
Specified by:
getNumericPriority in interface DiskManagerFileInfo
Returns:

getNumericPriorty

public int getNumericPriorty()
Specified by:
getNumericPriorty in interface DiskManagerFileInfo
Returns:

setNumericPriority

public void setNumericPriority(int priority)
Description copied from interface: DiskManagerFileInfo
Sets the file's download priority base on a number

Specified by:
setNumericPriority in interface DiskManagerFileInfo
Parameters:
priority - Any number or DiskManagerFileInfo.PRIORITY_LOW, DiskManagerFileInfo.PRIORITY_NORMAL, DiskManagerFileInfo.PRIORITY_HIGH

setDeleted

public void setDeleted(boolean b)
Description copied from interface: DiskManagerFileInfo
Mark the file as deleted or not (deleted means the file will be truncated to take up minimum space). This is generally 0 <= X < 2*piece_length as pieces can span file boundaries.

Specified by:
setDeleted in interface DiskManagerFileInfo

setLink

public void setLink(File link_destination)
Specified by:
setLink in interface DiskManagerFileInfo

getLink

public File getLink()
Specified by:
getLink in interface DiskManagerFileInfo

getAccessMode

public int getAccessMode()
Specified by:
getAccessMode in interface DiskManagerFileInfo

getDownloaded

public long getDownloaded()
Specified by:
getDownloaded in interface DiskManagerFileInfo

getLength

public long getLength()
Description copied from interface: DiskManagerFileInfo
Size when file is complete

Specified by:
getLength in interface DiskManagerFileInfo

getFile

public File getFile()
Specified by:
getFile in interface DiskManagerFileInfo

getFile

public File getFile(boolean follow_link)
Description copied from interface: DiskManagerFileInfo
returns liked file if it exists, direct otherwise

Specified by:
getFile in interface DiskManagerFileInfo
Returns:

getIndex

public int getIndex()
Specified by:
getIndex in interface DiskManagerFileInfo

getFirstPieceNumber

public int getFirstPieceNumber()
Specified by:
getFirstPieceNumber in interface DiskManagerFileInfo

getPieceSize

public long getPieceSize()
Specified by:
getPieceSize in interface DiskManagerFileInfo

getNumPieces

public int getNumPieces()
Specified by:
getNumPieces in interface DiskManagerFileInfo

isPriority

public boolean isPriority()
Specified by:
isPriority in interface DiskManagerFileInfo

isSkipped

public boolean isSkipped()
Specified by:
isSkipped in interface DiskManagerFileInfo

isDeleted

public boolean isDeleted()
Specified by:
isDeleted in interface DiskManagerFileInfo

getDownloadHash

public byte[] getDownloadHash()
                       throws DownloadException
Specified by:
getDownloadHash in interface DiskManagerFileInfo
Throws:
DownloadException

getDownload

public Download getDownload()
                     throws DownloadException
Specified by:
getDownload in interface DiskManagerFileInfo
Throws:
DownloadException

createChannel

public DiskManagerFileInfoURL.channel createChannel()
                                             throws DownloadException
Specified by:
createChannel in interface DiskManagerFileInfo
Throws:
DownloadException

createRandomReadRequest

public DiskManagerRandomReadRequest createRandomReadRequest(long file_offset,
                                                            long length,
                                                            boolean reverse_order,
                                                            DiskManagerListener listener)
                                                     throws DownloadException
Description copied from interface: DiskManagerFileInfo
Creates a random read request - these will be executed against the download sequentially

Specified by:
createRandomReadRequest in interface DiskManagerFileInfo
reverse_order - - deliver blocks to the listener in reverse order
Returns:
Throws:
DownloadException

getAuthentication

public PasswordAuthentication getAuthentication(String realm,
                                                URL tracker)
Specified by:
getAuthentication in interface SEPasswordListener

setAuthenticationOutcome

public void setAuthenticationOutcome(String realm,
                                     URL tracker,
                                     boolean success)
Specified by:
setAuthenticationOutcome in interface SEPasswordListener

clearPasswords

public void clearPasswords()
Specified by:
clearPasswords in interface SEPasswordListener