|
Jala 1.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--jala.BitTorrent
This class provides methods to create a BitTorrent
metadata file from any desired file.
Defined in BitTorrent.js
Constructor Summary | |
jala.BitTorrent
(<String> filePath, <String> trackerUrl)
Constructs a new BitTorrent file. |
Method Summary | |
Object
|
get(<String> name)
Get a torrent property. |
Date
|
getCreationDate()
Get the creation date of the torrent. |
Number
|
getPieceLength()
Get the piece length of the torrent. |
helma.File
|
getSourceFile()
Returns the underlying source file. |
helma.File
|
getTorrentFile()
Returns the underlying torrent file. |
Array
|
keys()
Get all available property names. |
void
|
save(<String> filename)
Saves the torrent as file. |
void
|
set(<String> name, <Object> value)
Set a torrent property. |
void
|
setCreationDate(<Date> date)
Set the creation date of the torrent. |
void
|
setPieceLength(<Number> length)
Set the piece length of the torrent. |
String
|
toString()
Get a string representation of the torrent. |
<static> Object
|
bdecode(<String> code)
The bdecode method. |
<static> String
|
bencode(<Object> obj)
The bencode method. |
Constructor Detail |
jala.BitTorrent(<String> filePath, <String> trackerUrl)
filePath
- The path to the original file.
trackerUrl
- The URL string of the tracker.
Method Detail |
Object get(<String> name)
name
- The name of the property.
Date getCreationDate()
Number getPieceLength()
helma.File getSourceFile()
helma.File getTorrentFile()
Array keys()
void save(<String> filename)
filename
- An optional name for the torrent file. If no name is given it will be composed from name of source file as defined in the torrent plus the ending ".torrent".
void set(<String> name, <Object> value)
name
- The name of the property.
value
- The property's value.
void setCreationDate(<Date> date)
date
- The desired creation date.
void setPieceLength(<Number> length)
length
- The desired piece length.
String toString()
<static> Object bdecode(<String> code)
code
- The encoded string.
<static> String bencode(<Object> obj)
obj
- The target JavaScript object.
|
Jala 1.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |