00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #include "BESFileContainer.h"
00034 #include "TheBESKeys.h"
00035 #include "BESUncompressManager.h"
00036 #include "BESCache.h"
00037 #include "BESContainerStorageException.h"
00038
00039 BESFileContainer::BESFileContainer( const string &sym_name,
00040 const string &real_name,
00041 const string &type )
00042 : BESContainer( sym_name, real_name, type )
00043 {
00044 string::size_type dotdot = real_name.find( ".." ) ;
00045 if( dotdot != string::npos )
00046 {
00047 string s = (string)"'../' not allowed in container real name "
00048 + real_name ;
00049 throw BESContainerStorageException( s, __FILE__, __LINE__ ) ;
00050 }
00051 }
00052
00053 BESFileContainer::BESFileContainer( const BESFileContainer ©_from )
00054 : BESContainer( copy_from )
00055 {
00056 }
00057
00058 void
00059 BESFileContainer::_duplicate( BESContainer ©_to )
00060 {
00061 BESContainer::_duplicate( copy_to ) ;
00062 }
00063
00064 BESContainer *
00065 BESFileContainer::ptr_duplicate( )
00066 {
00067 BESContainer *container = new BESFileContainer ;
00068 BESContainer::_duplicate( *container ) ;
00069 return container ;
00070 }
00071
00072 string
00073 BESFileContainer::access()
00074 {
00075
00076 BESKeys *keys = TheBESKeys::TheKeys() ;
00077 BESCache cache( *keys, "BES.CacheDir", "BES.CachePrefix", "BES.CacheSize" );
00078
00079 return BESUncompressManager::TheManager()->uncompress( get_real_name(),
00080 cache ) ;
00081 }
00082
00090 void
00091 BESFileContainer::dump( ostream &strm ) const
00092 {
00093 strm << BESIndent::LMarg << "BESFileContainer::dump - ("
00094 << (void *)this << ")" << endl ;
00095 BESIndent::Indent() ;
00096 BESContainer::dump( strm ) ;
00097 BESIndent::UnIndent() ;
00098 }
00099