diff options
author | Oliver Bolte <obo@openoffice.org> | 2007-06-13 06:58:23 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2007-06-13 06:58:23 +0000 |
commit | 8391d743210f25845e66152e558700d30ae19866 (patch) | |
tree | b848fd5712460b9707606f4de5d327173187f19c /jvmfwk | |
parent | 870fe7fe9b37b6d0525e04003bf53ec4fe5e19a9 (diff) |
INTEGRATION: CWS jl64 (1.25.24); FILE MERGED
2007/06/07 07:52:58 jl 1.25.24.2: #i76390# support of new bootstrap variable UNO_JAVA_JFW_INSTALL_DATA and UNO_JAVA_JFW_INSTALL_EXPIRE
2007/06/04 08:05:45 jl 1.25.24.1: #i76390 do not create user installation when installing java extensions during setup
Diffstat (limited to 'jvmfwk')
-rw-r--r-- | jvmfwk/source/fwkutil.cxx | 119 |
1 files changed, 19 insertions, 100 deletions
diff --git a/jvmfwk/source/fwkutil.cxx b/jvmfwk/source/fwkutil.cxx index d61fe88df205..00bb2ffd33c0 100644 --- a/jvmfwk/source/fwkutil.cxx +++ b/jvmfwk/source/fwkutil.cxx @@ -4,9 +4,9 @@ * * $RCSfile: fwkutil.cxx,v $ * - * $Revision: 1.25 $ + * $Revision: 1.26 $ * - * last change: $Author: obo $ $Date: 2006-09-16 17:48:18 $ + * last change: $Author: obo $ $Date: 2007-06-13 07:58:23 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -68,22 +68,6 @@ using namespace osl; namespace jfw { -struct Init -{ - osl::Mutex * operator()() - { - static osl::Mutex aInstance; - return &aInstance; - } -}; -osl::Mutex * getFwkMutex() -{ - return rtl_Instance< osl::Mutex, Init, ::osl::MutexGuard, - ::osl::GetGlobalMutex >::create( - Init(), ::osl::GetGlobalMutex()); -} - - bool isAccessibilitySupportDesired() { bool retVal = false; @@ -324,103 +308,38 @@ rtl::OUString getLibraryLocation() return getDirFromFile(libraryFileUrl); } -//Todo is this still needed? -rtl::OUString searchFileNextToThisLib(const rtl::OUString & sFile) -{ - rtl::OUString ret; - rtl::OUString sLib; - if (osl::Module::getUrlFromAddress( - reinterpret_cast< oslGenericFunction >(searchFileNextToThisLib), - sLib)) - { - sLib = getDirFromFile(sLib); - rtl::OUStringBuffer sBufVendor(256); - sBufVendor.append(sLib); - sBufVendor.appendAscii("/"); - sBufVendor.append(sFile); - sLib = sBufVendor.makeStringAndClear(); - //check if the file exists - osl::DirectoryItem item; - osl::File::RC fileError = osl::DirectoryItem::get(sLib, item); - if (fileError == osl::FileBase::E_None) - ret = sLib; - } - return ret; -} - -jfw::FileStatus checkFileURL(const rtl::OUString & path) +jfw::FileStatus checkFileURL(const rtl::OUString & sURL) { - rtl::OString sExcMsg("[Java framework] Error in function " - "resolveFileURL (fwkutil.cxx)."); - OUString sResolved = path; jfw::FileStatus ret = jfw::FILE_OK; - while (1) + DirectoryItem item; + File::RC rc_item = DirectoryItem::get(sURL, item); + if (File::E_None == rc_item) { - DirectoryItem item; - File::RC fileErr = - DirectoryItem::get(sResolved, item); - if (fileErr == File::E_None) - { - osl::FileStatus status(FileStatusMask_Type | - FileStatusMask_LinkTargetURL | - FileStatusMask_FileURL); + osl::FileStatus status(FileStatusMask_Validate); - if (item.getFileStatus(status) == File::E_None) - { - osl::FileStatus::Type t = status.getFileType(); - if (t == osl::FileStatus::Regular) - { - ret = jfw::FILE_OK; - break; - } - else if ( t == osl::FileStatus::Link ) - { - sResolved = status.getLinkTargetURL(); - } - else - { - ret = FILE_INVALID; - break; - } - } - else - { - throw FrameworkException(JFW_E_ERROR, sExcMsg); - } + File::RC rc_stat = item.getFileStatus(status); + if (File::E_None == rc_stat) + { + ret = FILE_OK; } - else if(fileErr == File::E_NOENT) + else if (File::E_NOENT == rc_stat) { ret = FILE_DOES_NOT_EXIST; - break; } else { ret = FILE_INVALID; - break; } } - return ret; -} -const rtl::Bootstrap& getBootstrap() -{ - static rtl::Bootstrap *pBootstrap = 0; - rtl::OUString sIni; - if( !pBootstrap ) + else if (File::E_NOENT == rc_item) { - rtl::OUStringBuffer buf( 255); - buf.append( getLibraryLocation()); - buf.appendAscii( SAL_CONFIGFILE("/jvmfwk3") ); - sIni = buf.makeStringAndClear(); - static rtl::Bootstrap bootstrap(sIni); - pBootstrap = &bootstrap; -#if OSL_DEBUG_LEVEL >=2 - rtl::OString o = rtl::OUStringToOString( sIni , osl_getThreadTextEncoding() ); - fprintf(stderr, "[Java framework] Using configuration file %s\n" , o.getStr() ); -#endif + ret = FILE_DOES_NOT_EXIST; } - - return *pBootstrap; - + else + { + ret = FILE_INVALID; + } + return ret; } } |