+# Directory Administration commands
+
+sub ListDirectoryUnits {
+ my ($this, $shared) = @_;
+ my $line = 'ListDirectoryUnits';
+ $line .= ' SHARED' if $shared;
+ $this->send($line);
+ $this->_parseResponse();
+}
+
+sub CreateDirectoryUnit {
+ my ($this, $unitName,$mountPoint,$shared,$remote) = @_;
+ croak 'usage CGP::CLI->CreateDirectoryUnit($unitName,$mountPoint,[$shared,[$remote]])'
+ unless defined $unitName && defined $mountPoint;
+ my $line = 'CreateDirectoryUnit '.$unitName;
+ $line .= ' SHARED' if $shared;
+ $line .= ' REMOTE' if $remote;
+ $line .= ' '.$mountPoint;
+ $this->send($line);
+ $this->_parseResponse();
+}
+
+sub RelocateDirectoryUnit {
+ my ($this, $unitName,$newMountPoint,$shared) = @_;
+ croak 'usage CGP::CLI->RelocateDirectoryUnit($unitName,$newMountPoint,[$shared])'
+ unless defined $unitName && defined $newMountPoint;
+ my $line = 'RelocateDirectoryUnit '.$unitName;
+ $line .= ' SHARED' if $shared;
+ $line .= ' '.$newMountPoint;
+}
+
+sub DeleteDirectoryUnit {
+ my ($this, $unitName,$shared) = @_;
+ croak 'usage CGP::CLI->DeleteDirectoryUnit($unitName,[$shared])'
+ unless defined $unitName;
+ my $line = 'DeleteDirectoryUnit '.$unitName;
+ $line .= ' SHARED' if $shared;
+ $this->send($line);
+ $this->_parseResponse();
+}
+
+sub GetDirectoryUnit {
+ my ($this, $unitName,$shared) = @_;
+ croak 'usage CGP::CLI->GetDirectoryUnit($unitName,[$shared])'
+ unless defined $unitName;
+ my $line = 'GetDirectoryUnit '.$unitName;
+ $line .= ' SHARED' if $shared;
+ $this->send($line);
+ return undef unless $this->_parseResponse();
+ $this->parseWords($this->getWords);
+}
+
+sub SetDirectoryUnit {
+ my ($this, $unitName,$newSettings,$shared) = @_;
+ croak 'usage CGP::CLI->SetDirectoryUnit($unitName,$newSettings,[$shared])'
+ unless defined $unitName && defined $newSettings;
+ my $line = 'SetDirectoryUnit '.$unitName;
+ $line .= ' SHARED' if $shared;
+ $line .= ' '.$this->printWords($newSettings);
+ $this->send($line);
+ $this->_parseResponse();
+}
+
+sub GetDirectoryAccessRights {
+ my ($this, $shared) = @_;
+ my $line = 'GetDirectoryAccessRights';
+ $line .= ' SHARED' if $shared;
+ $this->send($line);
+ return undef unless $this->_parseResponse();
+ $this->parseWords($this->getWords);
+}
+
+sub SetDirectoryAccessRights {
+ my ($this, $unitName,$newRights,$shared) = @_;
+ croak 'usage CGP::CLI->SetDirectoryAccessRights($newRights,[$shared])'
+ unless defined $newRights;
+ my $line = 'SetDirectoryAccessRights';
+ $line .= ' SHARED' if $shared;
+ $line .= ' '.$this->printWords($newRights);
+ $this->send($line);
+ $this->_parseResponse();
+}
+
+#############################################