Skip Menu |

This queue is for tickets about the Artifactory-Client CPAN distribution.

Report information
The Basics
Id: 96935
Status: resolved
Priority: 0/
Queue: Artifactory-Client

People
Owner: Nobody in particular
Requestors: victor_diec [...] mitel.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Artifact Retrieval Issue
Date: Fri, 4 Jul 2014 09:52:48 -0400
To: bug-artifactory-client [...] rt.cpan.org
From: "Diec, Victor" <victor_diec [...] mitel.com>
I would like to report a bug/issue that I ahve been experiencing with Artifactory Client v0.7.4 when using the retrieve_artifact subroutine. I am not exactly sure whether I am retrieving the content properly but my current implementation using the perl module looks like this: my $hash; $hash = ($client->retrieve_artifact("/debug4/debug4/debug4/debug4-debug4.html")); open OUTPUT, "> output-from-perl-html.html"; $hash = $hash->{_content}; print OUTPUT $hash; close OUTPUT; This works for some files like text files but fails for many things. One particular thing that I noticed with my current implementation is that if I reupload the file I retrieved from artifactory, it has a different checksum than the original. Furthermore, the html file I have shown in the example above changes. It is originally in english but when I download it using this method and open it, the language has changed to chinese. Is there way to retrieve the artifact as is without using a file handle? -- Victor Diec Mitel Networks Email: victor_diec@mitel.com Phone: 613-592-5660 x72875 -- Victor Diec Mitel Networks Email: victor_diec@mitel.com Phone: 613-592-5660 x72875 -- This e-mail (including any attachments) is for the sole use of the intended recipient(s) and may contain information that is confidential and/or protected by legal privilege. Any unauthorized review, use, copy, disclosure or distribution of this e-mail is strictly prohibited. If you are not the intended recipient, please notify Mitel immediately and destroy all copies of this e-mail. Mitel does not accept any liability for breach of security, error or virus that may result from the transmission of this message.
I'm not sure if I understand the issue. When you call retrieve_artifact, you should get back an HTTP::Response object. My module does not use a filehandle nor change the language to Chinese - it returns the HTTP::Response object as-is, without tampering the content in any way. When you do: my $response = $client->retrieve_artifact( '/foo/bar/baz' ) You should be able to get the content like so: if ( $response->is_success ) { my $content = $response->decoded_content; } else { print STDERR $response->status_line, "\n"; } Try writing the $content in raw mode like shown here and see if it works: http://stackoverflow.com/questions/1464195/how-can-i-create-a-binary-file-in-perl On Fri Jul 04 09:53:00 2014, victor_diec@mitel.com wrote: Show quoted text
> I would like to report a bug/issue that I ahve been experiencing with > Artifactory Client v0.7.4 when using the retrieve_artifact subroutine. > > I am not exactly sure whether I am retrieving the content properly but my > current implementation using the perl module looks like this: > > my $hash; > $hash = > ($client->retrieve_artifact("/debug4/debug4/debug4/debug4-debug4.html")); > > open OUTPUT, "> output-from-perl-html.html"; > $hash = $hash->{_content}; > print OUTPUT $hash; > close OUTPUT; > > This works for some files like text files but fails for many things. One > particular thing that I noticed with my current implementation is that if I > reupload the file I retrieved from artifactory, it has a different checksum > than the original. Furthermore, the html file I have shown in the example > above changes. It is originally in english but when I download it using > this method and open it, the language has changed to chinese. > > Is there way to retrieve the artifact as is without using a file handle?
Subject: Re: [rt.cpan.org #96935] Artifact Retrieval Issue
Date: Tue, 8 Jul 2014 09:03:09 -0400
To: bug-Artifactory-Client [...] rt.cpan.org
From: "Diec, Victor" <victor_diec [...] mitel.com>
Thanks for the advice. Writing the $content in raw mode fixed the error that I was observing. On 8 July 2014 00:10, Satoshi Yagi via RT < bug-Artifactory-Client@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=96935 > > > I'm not sure if I understand the issue. > > When you call retrieve_artifact, you should get back an HTTP::Response > object. My module does not use a filehandle nor change the language to > Chinese - it returns the HTTP::Response object as-is, without tampering the > content in any way. > > When you do: > my $response = $client->retrieve_artifact( '/foo/bar/baz' ) > > You should be able to get the content like so: > > if ( $response->is_success ) { > my $content = $response->decoded_content; > } > else { > print STDERR $response->status_line, "\n"; > } > > Try writing the $content in raw mode like shown here and see if it works: > > http://stackoverflow.com/questions/1464195/how-can-i-create-a-binary-file-in-perl > > On Fri Jul 04 09:53:00 2014, victor_diec@mitel.com wrote:
> > I would like to report a bug/issue that I ahve been experiencing with > > Artifactory Client v0.7.4 when using the retrieve_artifact subroutine. > > > > I am not exactly sure whether I am retrieving the content properly but my > > current implementation using the perl module looks like this: > > > > my $hash; > > $hash = > > ($client->retrieve_artifact("/debug4/debug4/debug4/debug4-debug4.html")); > > > > open OUTPUT, "> output-from-perl-html.html"; > > $hash = $hash->{_content}; > > print OUTPUT $hash; > > close OUTPUT; > > > > This works for some files like text files but fails for many things. One > > particular thing that I noticed with my current implementation is that
> if I
> > reupload the file I retrieved from artifactory, it has a different
> checksum
> > than the original. Furthermore, the html file I have shown in the
> example
> > above changes. It is originally in english but when I download it using > > this method and open it, the language has changed to chinese. > > > > Is there way to retrieve the artifact as is without using a file handle?
> > > >
-- Victor Diec Mitel Networks Email: victor_diec@mitel.com Phone: 613-592-5660 x72875 -- This e-mail (including any attachments) is for the sole use of the intended recipient(s) and may contain information that is confidential and/or protected by legal privilege. Any unauthorized review, use, copy, disclosure or distribution of this e-mail is strictly prohibited. If you are not the intended recipient, please notify Mitel immediately and destroy all copies of this e-mail. Mitel does not accept any liability for breach of security, error or virus that may result from the transmission of this message.
No problem. Glad it worked. On Tue Jul 08 09:03:26 2014, victor_diec@mitel.com wrote: Show quoted text
> Thanks for the advice. Writing the $content in raw mode fixed the > error > that I was observing. > > > On 8 July 2014 00:10, Satoshi Yagi via RT < > bug-Artifactory-Client@rt.cpan.org> wrote: >
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=96935 > > > > > I'm not sure if I understand the issue. > > > > When you call retrieve_artifact, you should get back an > > HTTP::Response > > object. My module does not use a filehandle nor change the language > > to > > Chinese - it returns the HTTP::Response object as-is, without > > tampering the > > content in any way. > > > > When you do: > > my $response = $client->retrieve_artifact( '/foo/bar/baz' ) > > > > You should be able to get the content like so: > > > > if ( $response->is_success ) { > > my $content = $response->decoded_content; > > } > > else { > > print STDERR $response->status_line, "\n"; > > } > > > > Try writing the $content in raw mode like shown here and see if it > > works: > > > > http://stackoverflow.com/questions/1464195/how-can-i-create-a-binary- > > file-in-perl > > > > On Fri Jul 04 09:53:00 2014, victor_diec@mitel.com wrote:
> > > I would like to report a bug/issue that I ahve been experiencing > > > with > > > Artifactory Client v0.7.4 when using the retrieve_artifact > > > subroutine. > > > > > > I am not exactly sure whether I am retrieving the content properly > > > but my > > > current implementation using the perl module looks like this: > > > > > > my $hash; > > > $hash = > > > ($client->retrieve_artifact("/debug4/debug4/debug4/debug4- > > > debug4.html")); > > > > > > open OUTPUT, "> output-from-perl-html.html"; > > > $hash = $hash->{_content}; > > > print OUTPUT $hash; > > > close OUTPUT; > > > > > > This works for some files like text files but fails for many > > > things. One > > > particular thing that I noticed with my current implementation is > > > that
> > if I
> > > reupload the file I retrieved from artifactory, it has a different
> > checksum
> > > than the original. Furthermore, the html file I have shown in the
> > example
> > > above changes. It is originally in english but when I download it > > > using > > > this method and open it, the language has changed to chinese. > > > > > > Is there way to retrieve the artifact as is without using a file > > > handle?
> > > > > > > >