| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Net::FTP::Path::Iter::File; | 
| 2 |  |  |  |  |  |  |  | 
| 3 |  |  |  |  |  |  | # ABSTRACT: Class representing a File | 
| 4 |  |  |  |  |  |  |  | 
| 5 | 1 |  |  | 1 |  | 15 | use 5.010; | 
|  | 1 |  |  |  |  | 2 |  | 
| 6 | 1 |  |  | 1 |  | 4 | use strict; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 15 |  | 
| 7 | 1 |  |  | 1 |  | 4 | use warnings; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 30 |  | 
| 8 |  |  |  |  |  |  |  | 
| 9 |  |  |  |  |  |  | our $VERSION = '0.05'; | 
| 10 |  |  |  |  |  |  |  | 
| 11 | 1 |  |  | 1 |  | 5 | use strict; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 13 |  | 
| 12 | 1 |  |  | 1 |  | 4 | use warnings; | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 18 |  | 
| 13 |  |  |  |  |  |  |  | 
| 14 | 1 |  |  | 1 |  | 6 | use Carp; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 46 |  | 
| 15 |  |  |  |  |  |  |  | 
| 16 | 1 |  |  | 1 |  | 5 | use File::Spec::Functions qw[ catfile ]; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 36 |  | 
| 17 |  |  |  |  |  |  |  | 
| 18 | 1 |  |  | 1 |  | 5 | use namespace::clean; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 5 |  | 
| 19 |  |  |  |  |  |  |  | 
| 20 | 1 |  |  | 1 |  | 233 | use parent 'Net::FTP::Path::Iter::Entry'; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 11 |  | 
| 21 |  |  |  |  |  |  |  | 
| 22 | 1 |  |  | 1 |  | 53 | use constant is_file => 1; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 55 |  | 
| 23 | 1 |  |  | 1 |  | 6 | use constant is_dir  => 0; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 202 |  | 
| 24 |  |  |  |  |  |  |  | 
| 25 |  |  |  |  |  |  | # if an entity doesn't have attributes, it didn't get loaded | 
| 26 |  |  |  |  |  |  | # from a directory listing.  Try to get one. | 
| 27 |  |  |  |  |  |  | sub _retrieve_attrs { | 
| 28 |  |  |  |  |  |  |  | 
| 29 | 0 |  |  | 0 |  |  | my $self = shift; | 
| 30 | 0 | 0 |  |  |  |  | return if $self->_has_attrs; | 
| 31 |  |  |  |  |  |  |  | 
| 32 |  |  |  |  |  |  | my ( $entry ) = my @entries = grep $self->name eq $_->{name}, | 
| 33 | 0 |  |  |  |  |  | $self->get_entries( $self->parent ); | 
| 34 |  |  |  |  |  |  |  | 
| 35 | 0 | 0 |  |  |  |  | croak( "multiple ftp entries for ", $self->path, "\n" ) | 
| 36 |  |  |  |  |  |  | if @entries > 1; | 
| 37 |  |  |  |  |  |  |  | 
| 38 | 0 | 0 |  |  |  |  | croak( "unable to find attributes for ", $self->path, "\n" ) | 
| 39 |  |  |  |  |  |  | if @entries == 0; | 
| 40 |  |  |  |  |  |  |  | 
| 41 |  |  |  |  |  |  | croak( $self->{path}, ": expected file, got $entry->type\n" ) | 
| 42 | 0 | 0 |  |  |  |  | unless $entry->{type} eq 'f'; | 
| 43 |  |  |  |  |  |  |  | 
| 44 | 0 |  |  |  |  |  | $self->$_( $entry->{$_} ) for keys %$entry; | 
| 45 |  |  |  |  |  |  |  | 
| 46 | 0 |  |  |  |  |  | return; | 
| 47 |  |  |  |  |  |  | } | 
| 48 |  |  |  |  |  |  |  | 
| 49 |  |  |  |  |  |  | # | 
| 50 |  |  |  |  |  |  | # This file is part of Net-FTP-Path-Iter | 
| 51 |  |  |  |  |  |  | # | 
| 52 |  |  |  |  |  |  | # This software is Copyright (c) 2017 by Smithsonian Astrophysical Observatory. | 
| 53 |  |  |  |  |  |  | # | 
| 54 |  |  |  |  |  |  | # This is free software, licensed under: | 
| 55 |  |  |  |  |  |  | # | 
| 56 |  |  |  |  |  |  | #   The GNU General Public License, Version 3, June 2007 | 
| 57 |  |  |  |  |  |  | # | 
| 58 |  |  |  |  |  |  |  | 
| 59 |  |  |  |  |  |  | 1; | 
| 60 |  |  |  |  |  |  |  | 
| 61 |  |  |  |  |  |  | __END__ |