"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/HTTP/DAV.pm" between
HTTP-DAV-0.48.tar.gz and HTTP-DAV-0.49.tar.gz

About: HTTP-DAV (PerlDAV) is a Perl library for modifying content on Web servers using the WebDAV protocol.

DAV.pm  (HTTP-DAV-0.48):DAV.pm  (HTTP-DAV-0.49)
# Perl WebDAV client library # Perl WebDAV client library
package HTTP::DAV; package HTTP::DAV;
use strict; use strict;
use vars qw($VERSION $VERSION_DATE $DEBUG); use vars qw($VERSION $VERSION_DATE $DEBUG);
# Globals # Globals
$VERSION = '0.48'; $VERSION = '0.49';
$VERSION_DATE = '2015/03/26'; $VERSION_DATE = '2018/11/28';
# Set this up to 3 # Set this up to 3
$DEBUG = 0; $DEBUG = 0;
#use Carp (cluck); #use Carp (cluck);
use Cwd (); # Can't import all of it, cwd clashes with our namespace. use Cwd (); # Can't import all of it, cwd clashes with our namespace.
use LWP; use LWP;
use XML::DOM; use XML::DOM;
use Time::Local; use Time::Local;
use HTTP::DAV::Lock; use HTTP::DAV::Lock;
skipping to change at line 39 skipping to change at line 39
sub new { sub new {
my $class = shift; my $class = shift;
my $self = bless {}, ref($class) || $class; my $self = bless {}, ref($class) || $class;
$self->_init(@_); $self->_init(@_);
return $self; return $self;
} }
########################################################################### ###########################################################################
sub clone { sub clone {
my $self = @_; my ($self)= @_;
my $class = ref($self); my $class = ref($self);
my %clone = %{$self}; my %clone = %{$self};
bless {%clone}, $class; bless {%clone}, $class;
} }
########################################################################### ###########################################################################
{ {
sub _init { sub _init {
my ( $self, @p ) = @_; my ( $self, @p ) = @_;
skipping to change at line 834 skipping to change at line 834
if ($url) { if ($url) {
$url = $self->get_absolute_uri($url); $url = $self->get_absolute_uri($url);
$resource = $self->new_resource( -uri => $url ); $resource = $self->new_resource( -uri => $url );
} }
else { else {
$resource = $self->get_workingresource(); $resource = $self->get_workingresource();
} }
# Make the call # Make the call
my $resp = $resource->propfind( -depth => $depth ); my $resp = $resource->propfind( -depth => $depth );
if ( $resp->is_success() ) { if ($resp->is_success() || $resp->code == 207) {
$resource->build_ls($resource); $resource->build_ls($resource);
$self->ok( "propfind " . $resource->get_uri() . " succeeded", $url ); $self->ok( "propfind " . $resource->get_uri() . " succeeded", $url );
return $resource; return $resource;
} }
else { else {
return $self->err( 'ERR_RESP_FAIL', $resp->message(), $url ); return $self->err( 'ERR_RESP_FAIL', $resp->message(), $url );
} }
} }
# Set a property on the resource # Set a property on the resource
skipping to change at line 1775 skipping to change at line 1775
If the filename contains any of the characters `*', `?' or `[' it is a candid ate for filename substitution, also known as ``globbing''. This word is t hen regarded as a pattern (``glob-pattern''), and replaced with an alphabeticall y sorted list of file names which match the pattern. If the filename contains any of the characters `*', `?' or `[' it is a candid ate for filename substitution, also known as ``globbing''. This word is t hen regarded as a pattern (``glob-pattern''), and replaced with an alphabeticall y sorted list of file names which match the pattern.
One can upload/put a string by passing a reference to a scalar in the -local par ameter. See example below. One can upload/put a string by passing a reference to a scalar in the -local par ameter. See example below.
put requires a working resource to be set before being called. See C<open>. put requires a working resource to be set before being called. See C<open>.
The return value is always 1 or 0 indicating success or failure. The return value is always 1 or 0 indicating success or failure.
See L<get()> for a description of what the optional callback parameter does. See L<get()> for a description of what the optional callback parameter does.
You can also pass a C<-headers> argument. That allows to specify custom HTTP hea ders. It can be either a hashref with header names and values, or a L<HTTP::Head ers> object. You can also pass a C<-headers> argument. That allows one to specify custom HTTP headers. It can be either a hashref with header names and values, or a L<HTTP:: Headers> object.
B<put examples:> B<put examples:>
Put a string to the server: Put a string to the server:
my $myfile = "This is the contents of a file to be uploaded\n"; my $myfile = "This is the contents of a file to be uploaded\n";
$d->put(-local=>\$myfile,-url=>"http://www.host.org/dav_dir/file.txt"); $d->put(-local=>\$myfile,-url=>"http://www.host.org/dav_dir/file.txt");
Put a local file to the server: Put a local file to the server:
skipping to change at line 2045 skipping to change at line 2045
[OUTDATED] [OUTDATED]
Please see the primary HTTP::DAV webpage at Please see the primary HTTP::DAV webpage at
(http://www.webdav.org/perldav/http-dav/) (http://www.webdav.org/perldav/http-dav/)
or the README file in this library. or the README file in this library.
=head1 SEE ALSO =head1 SEE ALSO
You'll want to also read: You'll want to also read:
=over * =over
=item C<HTTP::DAV::Response> =item C<HTTP::DAV::Response>
=item C<HTTP::DAV::Resource> =item C<HTTP::DAV::Resource>
=item C<dave> =item C<dave>
=back =back
and maybe if you're more inquisitive: and maybe if you're more inquisitive:
=over * =over
=item C<LWP::UserAgent> =item C<LWP::UserAgent>
=item C<HTTP::Request> =item C<HTTP::Request>
=item C<HTTP::DAV::Comms> =item C<HTTP::DAV::Comms>
=item C<HTTP::DAV::Lock> =item C<HTTP::DAV::Lock>
=item C<HTTP::DAV::ResourceList> =item C<HTTP::DAV::ResourceList>
 End of changes. 6 change blocks. 
7 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)