JavaPowUpload 2.1
JavaPowUpload.DownloadItem object
  Home page
Contact support

DownloadItem object methods  

DownloadItem object provides a way to access individual files added to the list. You cannot create DownloadItem object directly. You should obtain it by the getFiles() method of an JavaPowUpload object.

isFile method

getId method

getIndex method

isChecked method

setChecked method

getFilename method

getPath method

getFullPath method

getLength method

getMD5Hash method

getUrl method

getUncompress method

getDelete method

getDescription method

getStatus method


isFile

boolean isFile()

Description

The method returns true if the item is a file, false if it's a folder.

Example

var isfile=JavaPowUpload.getFiles().get(0).isFile();



getId

String getId()

Description

The method returns unique indentifier of a file.

Example

var index=JavaPowUpload.getFiles().get(0).getId();



getIndex

long getIndex()

Description

The method returns 0-based index of an item.

Example

var index=JavaPowUpload.getFiles().get(0).getIndex(); // index of the first file in the list. The value should be 0.



isChecked

boolean isChecked()

Description

The method returns true if the item is checked; otherwise false.

Example

var checked=JavaPowUpload.getFiles().get(0).isChecked();

 

setChecked

void setChecked(boolean newValue)

Description

The method checks or unckecks an item.

Parameters

boolean newValue - True - to set an item checked, false - to uncheck an item.

Example

JavaPowUpload.getFiles().get(0).setChecked(false);

 

getFilename

String getFilename()

Description

The method returns only a name of the file (without directories).

Example

var fileName=JavaPowUpload.getFiles().get(0).getFileName();

getPath

String getPath()

Description

The method returns the path of the item in the tree without a file name.

Example

var treePath=JavaPowUpload.getFiles().get(0).getPath();

 

getFullPath

String getFullPath()

Description

The method returns the full path of the item (included a file name).

Example

var treeFullPath=JavaPowUpload.getFiles().get(0).getFullPath();

getLength

long getLength()

Description

The method returns a file size, in bytes or 0, if the file length is not specified (and not delivered from server) .

Example

var length=JavaPowUpload.getFiles().get(0).getLength();

 

getMD5Hash

String getMD5Hash()

Description

The method returns a string representation of the file content MD5 hash or null if the file was not downloaded.

Example

var md5=JavaPowUpload.getFiles().get(0).getMD5Hash();



getUrl

String getUrl()

Description

The method returns "url" attribute value.

Example

var url=JavaPowUpload.getFiles().get(0).getUrl();



getUncompress

boolean getUncompress()

Description

The method returns the "uncompress" attribute value. True, if the zip archive should be uncompressed when download is complete.

Example

var uncompress=JavaPowUpload.getFiles().get(0).getUncompress();

 

getDelete

boolean getDelete()

Description

The method returns the "delete" attribute value. True, if the zip archive should be deleted after unpacking.

Example

var delete=JavaPowUpload.getFiles().get(0).getDelete();

 


getDescription

String getDescription()

Description

The method returns a file description text.

Example

var userPath=JavaPowUpload.getFiles().get(0).getDescription();


getStatus

Integer getStatus()

Description

The method returns file status constant.


0 - Ready for processing. File has not been uploaded/downloaded.
1 - File is currently being uploaded/downloaded.
2 - Upload/download was completed sucessfully.
3 - Upload/download was stopped.
4 - Error occured.
5 - File skipped.

Example

var status=JavaPowUpload.getFiles().get(0).getStatus();