
#########
VirtualFS
#########


****
NAME
****


Kernel::System::VirtualFS - virtual filesystem lib


***********
DESCRIPTION
***********


All virtual filesystem functions.


****************
PUBLIC INTERFACE
****************


new()
=====


Don't use the constructor directly, use the ObjectManager instead:


.. code-block:: perl

     my $VirtualFSObject = $Kernel::OM->Get('Kernel::System::VirtualFS');



Read()
======


read a file from virtual file system


.. code-block:: perl

     my %File = $VirtualFSObject->Read(
         Filename => '/Object/some/name.txt',
         Mode     => 'utf8',
 
         # optional
         DisableWarnings => 1,
     );


returns


.. code-block:: perl

     my %File = (
         Content  => $ContentSCALAR,
 
         # preferences data
         Preferences => {
 
             # generated automatically
             FilesizeRaw        => 12345,
 
             # optional
             ContentType        => 'text/plain',
             ContentID          => '<some_id@example.com>',
             ContentAlternative => 1,
             SomeCustomParams   => 'with our own value',
         },
     );



Write()
=======


write a file to virtual file system


.. code-block:: perl

     my $Success = $VirtualFSObject->Write(
         Content  => \$Content,
         Filename => '/Object/SomeFileName.txt',
         Mode     => 'binary',            # (binary|utf8)
 
         # optional, preferences data
         Preferences => {
             ContentType        => 'text/plain',
             ContentID          => '<some_id@example.com>',
             ContentAlternative => 1,
             SomeCustomParams   => 'with our own value',
         },
     );



Delete()
========


delete a file from virtual file system


.. code-block:: perl

     my $Success = $VirtualFSObject->Delete(
         Filename => '/Object/SomeFileName.txt',
 
         # optional
         DisableWarnings => 1,
     );



Find()
======


find files in virtual file system

only for file name


.. code-block:: perl

     my @List = $VirtualFSObject->Find(
         Filename => '/Object/some_what/*.txt',
     );


only for preferences


.. code-block:: perl

     my @List = $VirtualFSObject->Find(
         Preferences => {
             ContentType => 'text/plain',
         },
     );


for file name and for preferences


.. code-block:: perl

     my @List = $VirtualFSObject->Find(
         Filename    => '/Object/some_what/*.txt',
         Preferences => {
             ContentType => 'text/plain',
         },
     );


Returns:


.. code-block:: perl

     my @List = (
       '/Object/some/file.txt',
       '/Object/my.pdf',
     );





