use 5.008;
use strict;
use warnings;

package Data::Semantic::URI::ftp;
our $VERSION = '1.100850';
# ABSTRACT: Semantic data class for ftp URIs
use parent qw(Data::Semantic::URI);
use constant REGEXP_KEYS => qw(URI FTP);
use constant KEEP_KEYS   => qw(
  URI scheme username password host port abspath_full abspath_full_no_slash
  abspath_full_no_slash_no_query type

sub flags {
    my $self  = shift;
    my @flags = $self->SUPER::flags(@_);
    push @flags => sprintf("-type => '%s'", $self->type) if $self->type;
    push @flags => '-password' if $self->password;


=head1 NAME

Data::Semantic::URI::ftp - Semantic data class for ftp URIs

=head1 VERSION

version 1.100850


    my $obj = Data::Semantic::URI::ftp->new;
    if ($obj->is_valid('...')) {
       #  ...


This class can tell whether a value is an FTP URI, as defined by RFCs 1738 and
2396. The C<valid()> method will respect the C<type> and C<password>
attributes and the inherited C<keep> boolean attribute.

See L<Regexp::Common::URI::ftp> for the meaning of C<type> and C<password>.

If C<keep> is set, C<kept()> will return a hash with the following keys/value

=over 4

=item URI

The complete URI.

=item C<scheme>

The scheme.

=item C<username>

The userinfo, or if C<password> is used, the username.

=item C<password>

If C<password> is used, the password, else "undef".

=item C<host>

The hostname or IP address.

=item C<port>

The port number

=item C<abspath_full>

The full path and type specification, including the leading slash.

=item C<abspath_full_no_slash>

The full path and type specification, without the leading slash.

=item C<abspath_full_no_slash_no_query>

The full path, without the type specification nor the leading slash.

=item C<type>

The value of the type specification.



See perlmodinstall for information and options on installing Perl modules.


No bugs have been reported.

Please report any bugs or feature requests through the web interface at


The latest version of this module is available from the Comprehensive Perl
Archive Network (CPAN). Visit L<> to find a CPAN
site near you, or see

The development version lives at
Instead of sending patches, please fork this project using the standard git
and github infrastructure.

=head1 AUTHOR

  Marcel Gruenauer <>


This software is copyright (c) 2007 by Marcel Gruenauer.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.