unit Livetrack;
interface
uses IdFTP, IdHTTP;
type TFTP =
class(TIDFTP)
end;
type THTTP =
class(TIDHTTP)
end;
type TLivetrack =
class(TObject)
private
{private Vars}
FHTTP : THTTP;
FFTP : TFTP;
FCacheDirectory :
string;
FFTPHost :
String;
FFTPDirectory :
String;
FFTPLoginName :
String;
FFTPPassword :
String;
FHTTPUrl :
String;
FFileName :
String;
FVID :
String;
{Set Procedures}
procedure SetFTPHost(Host :
String);
procedure SetFTPDirectory(Directory :
String);
procedure SetFTPLoginName(LoginName :
String);
procedure SetFTPPassword(Password :
String);
procedure SetVID(VID :
String);
{get Functions}
function GetFTPHost :
String;
function GetFTPLoginName :
String;
function GetFTPPassword :
String;
public
{Functions}
constructor create(
const CacheDirectory :
String;
const FTPHost :
string;
const FTPDirectory :
string;
const FTPLoginName :
string;
const FTPPassword :
string;
const HTTPUrl :
String;
const FileName :
String;
const VID :
string);
overload;
constructor create(
const CacheDirectory :
String;
const FTPHost :
string;
const FTPDirectory :
string;
const FTPLoginName :
string;
const FTPPassword :
string;
const HTTPUrl :
String;
const FileName :
String);
overload;
destructor destroy ;
override;
{properties}
property CacheDirectory :
String read FCacheDirectory
write FCacheDirectory;
property FTPHost :
String read GetFTPHost
write SetFTPHost;
property FTPDirectory :
String read FFTPDirectory
write SetFTPDirectory;
property FTPLoginName :
String read GetFTPLoginName
write SetFTPLoginName;
property FTPPassword :
String read GetFTPPassword
write SetFTPPassword;
property HTTPUrl :
String read FHTTPUrl
write FHTTPUrl;
property FileName :
String read FFileName
write FFileName;
property VID :
String read FVID
write SetVID;
end;
implementation
{Set Procedures}
procedure TLivetrack.SetFTPHost(Host :
String);
begin
self.FFTP.Host := Host;
end;
procedure TLivetrack.SetFTPDirectory(Directory :
String);
begin
if Directory = '
'
then
exit;
if self.FFTP.Connected
then
self.FFTP.ChangeDir(Directory);
end;
procedure TLivetrack.SetFTPLoginName(LoginName :
String);
begin
if self.FFTP.Connected
then
exit;
self.FFTP.Username := LoginName;
end;
procedure TLivetrack.SetFTPPassword(Password :
String);
begin
if self.FFTP.Connected
then
exit;
self.FFTP.Password := Password;
end;
procedure TLivetrack.SetVID(VID :
String);
begin
self.VID := VID;
end;
// Ende Set Procedures
////////////////////////////////////////////////////////////////////////////////
{Get Functions}
function TLivetrack.GetFTPHost :
String;
begin
result := self.FFTP.Host;
end;
function TLivetrack.GetFTPLoginName :
String;
begin
result := self.FFTP.Username;
end;
function TLivetrack.GetFTPPassword :
String;
begin
result := self.FFTP.Password;
end;
// Ende Get Functions
////////////////////////////////////////////////////////////////////////////////
{Constructor}
constructor TLivetrack.create(
const CacheDirectory :
String;
const FTPHost :
string;
const FTPDirectory :
string;
const FTPLoginName :
string;
const FTPPassword :
string;
const HTTPUrl :
String;
const FileName :
String);
begin
inherited create;
self.FFTP := TFTP.Create(
nil);
self.FHTTP := THTTP.Create(
nil);
// Setzen der Parameter für HTTP und FTP
self.CacheDirectory := CacheDirectory;
self.FTPHost := FTPHost;
self.FTPDirectory := FTPDirectory;
self.FTPLoginName := FTPLoginName;
self.FTPPassword := FTPPassword;
self.HTTPUrl := HTTPUrl;
self.FileName := FileName;
//self.VID := 'none';
end;
constructor TLivetrack.create(
const CacheDirectory :
String;
const FTPHost :
string;
const FTPDirectory :
string;
const FTPLoginName :
string;
const FTPPassword :
string;
const HTTPUrl :
String;
const FileName :
String;
const VID :
string);
begin
inherited create;
self.FFTP := TFTP.Create(
nil);
self.FHTTP := THTTP.Create(
nil);
// Setzen der Parameter für HTTP und FTP
self.CacheDirectory := CacheDirectory;
self.FTPHost := FTPHost;
self.FTPDirectory := FTPDirectory;
self.FTPLoginName := FTPLoginName;
self.FTPPassword := FTPPassword;
self.HTTPUrl := HTTPUrl;
self.FileName := FileName;
//self.VID := VID;
end;
// Ende Constructor
////////////////////////////////////////////////////////////////////////////////
{Destructor}
destructor TLivetrack.destroy;
begin
self.FFTP.Free;
self.FHTTP.free;
inherited destroy;
end;
// Ende Destructor
////////////////////////////////////////////////////////////////////////////////
end.