Back to top


NAME

  UpdateChecker::Data::RemoteFile -- To save the contents of target to Remote File.

Back to top


SYNOPSYS

 use UpdateChecker::RemoteFile;
 my $target_data =
     {
      '/etc/httpd/conf/httpd.conf' =>
        {
          location =>'/etc/httpd/conf/httpd.conf',
          server => 'example.com',
          user => 'foo',
        },
      '/etc/httpd/conf/perl.conf' =>
        {
          location =>'/etc/httpd/conf/perl.conf',
          server => 'example.com',
          user => 'foo',
        }
     };
 my $uc = new UpdateChecker::RemoteFile(data => 'RemoteFile', target_data => $target_data);
 $target_data = $uc->target_data;
 # if you want to know other function, see UpdateChecker document.

Back to top


METHODS

new
  my $check_data = new UpdateChecker::Data::RemoteFile ({dir => '/dir', server => 'example.co.jp', user => 'foo', password => 'password' , target_data => {}});

It creates UpdateChecker::Data::RemoteFile object. value of server is server which you want to save the contents of the target. value of dir is server's directory which you want to save the contents of the target. value of server is server which you want to save the contents of the target.

remote_dir
 $obj->remote_dir($dir);
 my $dir = $obj->remote_dir();

$dir is remote directory to save targets' contents.

base_dir
 $obj->base_dir($dir);
 my $dir = $obj->base_dir();

$dir is base directory to target file location. When escape_target_name is 0(default value) and you don't set target_name as target method's second argument, it will be used.

If you use UpdateChecker::File and UpdateChecker::Data::RemoteFile, perhaps, it may be useful. When your target is /etc/httpd/conf/httpd.conf, you set /foo/bar/ as remote_dir and you want to save target's contents to /foo/bar/conf/httpd.conf, you should set /etc/httpd as base_dir.

escape_target_name
 $obj->escape_target_name($zero_or_one);
 my $escape_target_name = $obj->escape_target_name();

$zero_or_one is 0 or 1. Default is 1 as class variable. If this method return true, file name based on target name is escaped by CGI->escape. If this method return false, file name based on target name is not escaped by CGI->escape. You can change default value as below.

 UpdateChecker::Data::File->escape_target_name(0);
set_extension_permission
 $uc->set_extension_permission('.cgi' => 0755);
 $uc->set_extension_permission('.html' => 0644);

It sets pair of extension and permission. If you don't use this method, default mode will be set by default_extension_permission

default_extension_permission
 $uc->default_extension_permission(0755);
 $uc->default_extension_permission(0644);

It set default value which is used by set_extension_permission. By default return value is 0644.

This method can be used as Class method.

connection_config
 # use FTP
 $uc->connection_config('server','user','password');
 # use SCP (need ssh-agent)
 $uc->connection_config('server','user');

It sets values for target which are needed for connection to remote host. If you set server, user and password, it regards as FTP. If you set server and user it regards as SCP.

Back to top


SEE ALSO

 UpdateChecker
 UpdateChecker::Data

Back to top


AUTHOR

 Ktat <ktat.is at gmail.com>

Back to top


COPYRIGHT

 Copyright 2003-2004 by Kato Atsushi <ktat.is at gmail.com>.
 This program is free software; you can redistribute it
 and/or modify it under the same terms as Perl itself.
 See http://www.perl.com/perl/misc/Artistic.html

Back to top