Solstice::Resource::Directory - A model representing a directory


Solstice documentation Contained in the Solstice distribution.

Index


Code Index:

NAME

Top

Solstice::Resource::Directory - A model representing a directory

SYNOPSIS

Top

  package Solstice::Resource::Directory;

  use Solstice::Resource::Directory;

DESCRIPTION

Top

Superclass

Solstice::Resource.

Export

No symbols exported.

Methods

getContentTypeDescription()

Return a string containing a description of this resource.

isContainer()

Return TRUE if the resource is a container, FALSE otherwise.

list()

Fetch the contents of this directory. Return TRUE on success, FALSE otherwise.

contains($filename)

Returns TRUE if the directory contains the passed $filename, FALSE otherwise.

addChild()
isValidChildName($name)

Returns TRUE if passed $name is valid for a child resource, FALSE otherwise.

getFileClass()

Private Methods

_store()

Recursively store children.

Modules Used

Solstice::Resource.

SEE ALSO

Top

AUTHOR

Top

Catalyst Group, <catalyst@u.washington.edu>

VERSION

Top

$Revision: 747 $

COPYRIGHT

Top


Solstice documentation Contained in the Solstice distribution.
package Solstice::Resource::Directory;

# $Id: Directory.pm 747 2005-09-30 19:38:37Z jlaney $

use 5.006_000;
use strict;
use warnings;

use base qw( Solstice::Resource );

use constant TRUE  => 1;
use constant FALSE => 0;

use constant TYPE_DESCRIPTION => 'Folder';

our ($VERSION) = ('$Revision: 747 $' =~ /^\$Revision:\s*([\d.]*)/);

sub getContentTypeDescription {
    return TYPE_DESCRIPTION;
}

sub isContainer {
    return TRUE;
}

sub list {
    my $self = shift;
    die (ref($self) . "->list(): Not implemented\n");
}

sub contains {
    my $self = shift;
    die (ref($self) . "->contains(): Not implemented\n");
}

sub addChild {
    my $self = shift;

    $self->_taint();
    return $self->Solstice::Tree::addChild(@_);
}

sub isValidChildName {
    return TRUE;
}

sub getFileClass {
    my $self = shift;
    warn ref($self) . "->getFileClass(): Not implemented\n";
    return;
}

sub _store {
    my $self = shift;

    my $return = FALSE;
    for my $child ($self->getChildren()) {
        $return &= $child->store();
    }
    return $return;
}

1;
__END__