Bug Summary

File:jvmfwk/plugins/sunmajor/pluginlib/util.cxx
Location:line 659, column 38
Description:Called C++ object pointer is null

Annotated Source Code

1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20
21#include "util.hxx"
22
23#include "osl/process.h"
24#include "osl/security.hxx"
25#include "osl/file.hxx"
26#include "osl/module.hxx"
27#include "rtl/byteseq.hxx"
28#include "rtl/ustrbuf.hxx"
29#include "rtl/instance.hxx"
30#include "salhelper/linkhelper.hxx"
31#include "salhelper/thread.hxx"
32#include "boost/scoped_array.hpp"
33#include "com/sun/star/uno/Sequence.hxx"
34#include <utility>
35#include <algorithm>
36#include <map>
37
38#if defined WNT
39#if defined _MSC_VER
40#pragma warning(push, 1)
41#endif
42#include <windows.h>
43#if defined _MSC_VER
44#pragma warning(pop)
45#endif
46#endif
47#include <string.h>
48
49#include "sunjre.hxx"
50#include "vendorlist.hxx"
51#include "diagnostics.h"
52
53using namespace osl;
54using namespace std;
55
56using ::rtl::OUString;
57using ::rtl::Reference;
58using ::rtl::OString;
59using ::rtl::OUStringBuffer;
60using ::rtl::OUStringToOString;
61
62#define OUSTR(x)::rtl::OUString( (&(x)[0]), ((sal_Int32)((sizeof (x) / sizeof
((x)[0]))-1)), (((rtl_TextEncoding) 11)) )
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x)(&(x)[0]), ((sal_Int32)((sizeof (x) / sizeof ((x)[0]))-1)
), (((rtl_TextEncoding) 11))
)
63#ifdef WNT
64#define HKEY_SUN_JRE L"Software\\JavaSoft\\Java Runtime Environment"
65#define HKEY_SUN_SDK L"Software\\JavaSoft\\Java Development Kit"
66#endif
67
68#ifdef UNX1
69namespace {
70char const *g_arJavaNames[] = {
71 "",
72 "j2re",
73 "j2se",
74 "j2sdk",
75 "jdk",
76 "jre",
77 "java",
78 "Home",
79 "IBMJava2-ppc-142"
80};
81/* These are directory names which could contain multiple java installations.
82 */
83char const *g_arCollectDirs[] = {
84 "",
85#ifndef JVM_ONE_PATH_CHECK
86 "j2re/",
87 "j2se/",
88 "j2sdk/",
89 "jdk/",
90 "jre/",
91 "java/",
92#endif
93 "jvm/"
94};
95
96/* These are directories in which a java installation is
97 looked for.
98*/
99char const *g_arSearchPaths[] = {
100#ifdef MACOSX
101 "",
102 "System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/"
103#else
104#ifndef JVM_ONE_PATH_CHECK
105 "",
106 "usr/",
107 "usr/local/",
108 "usr/local/IBMJava2-ppc-142",
109 "usr/local/j2sdk1.3.1",
110#ifdef X86_64
111 "usr/lib64/",
112#endif
113 "usr/lib/",
114 "usr/bin/"
115#else
116 JVM_ONE_PATH_CHECK
117#endif
118#endif
119};
120}
121#endif // UNX
122
123namespace jfw_plugin
124{
125extern VendorSupportMapEntry gVendorMap[];
126
127bool getSDKInfoFromRegistry(vector<OUString> & vecHome);
128bool getJREInfoFromRegistry(vector<OUString>& vecJavaHome);
129bool decodeOutput(const rtl::OString& s, rtl::OUString* out);
130
131
132
133namespace
134{
135 rtl::OUString getLibraryLocation()
136 {
137 rtl::OUString libraryFileUrl;
138 OSL_VERIFY(osl::Module::getUrlFromAddress((void *)(sal_IntPtr)getLibraryLocation, libraryFileUrl))do { if (!(osl::Module::getUrlFromAddress((void *)(sal_IntPtr
)getLibraryLocation, libraryFileUrl))) do { if (true &&
(!(0))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN), (
"legacy.osl"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "138" ": "), "OSL_ASSERT: %s", "0"); } } while (false); }
while (0)
;
139 return getDirFromFile(libraryFileUrl);
140 }
141
142 struct InitBootstrap
143 {
144 rtl::Bootstrap * operator()(const OUString& sIni)
145 {
146 static rtl::Bootstrap aInstance(sIni);
147 return & aInstance;
148
149 }
150 };
151
152 struct InitBootstrapData
153 {
154 OUString const & operator()()
155 {
156 static OUString sIni;
157 rtl::OUStringBuffer buf( 255);
158 buf.append( getLibraryLocation());
159 buf.appendAscii( SAL_CONFIGFILE("/sunjavaplugin")"/sunjavaplugin" "rc" );
160 sIni = buf.makeStringAndClear();
161 JFW_TRACE2(OUSTR("[Java framework] sunjavaplugin: "do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Using configuration file \n")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Using configuration file \n") / sizeof (("[Java framework] sunjavaplugin: "
"Using configuration file \n")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sIni) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "162" ": "), ::sal::detail::unwrapStream( ::sal::detail::
StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Using configuration file \n")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Using configuration file \n") / sizeof (("[Java framework] sunjavaplugin: "
"Using configuration file \n")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sIni)); } else { ::std::ostringstream sal_detail_stream
; sal_detail_stream << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Using configuration file \n")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Using configuration file \n") / sizeof (("[Java framework] sunjavaplugin: "
"Using configuration file \n")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sIni; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "162" ": "), sal_detail_stream); } } } while (false)
162 "Using configuration file \n") + sIni)do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Using configuration file \n")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Using configuration file \n") / sizeof (("[Java framework] sunjavaplugin: "
"Using configuration file \n")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sIni) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "162" ": "), ::sal::detail::unwrapStream( ::sal::detail::
StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Using configuration file \n")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Using configuration file \n") / sizeof (("[Java framework] sunjavaplugin: "
"Using configuration file \n")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sIni)); } else { ::std::ostringstream sal_detail_stream
; sal_detail_stream << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Using configuration file \n")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Using configuration file \n") / sizeof (("[Java framework] sunjavaplugin: "
"Using configuration file \n")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sIni; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "162" ": "), sal_detail_stream); } } } while (false)
;
163 return sIni;
164 }
165 };
166}
167
168rtl::Bootstrap * getBootstrap()
169{
170 return rtl_Instance< rtl::Bootstrap, InitBootstrap,
171 ::osl::MutexGuard, ::osl::GetGlobalMutex,
172 OUString, InitBootstrapData >::create(
173 InitBootstrap(), ::osl::GetGlobalMutex(), InitBootstrapData());
174}
175
176
177
178
179class FileHandleGuard
180{
181public:
182 inline FileHandleGuard(oslFileHandle & rHandle) SAL_THROW(()):
183 m_rHandle(rHandle) {}
184
185 inline ~FileHandleGuard() SAL_THROW(());
186
187 inline oslFileHandle & getHandle() SAL_THROW(()) { return m_rHandle; }
188
189private:
190 oslFileHandle & m_rHandle;
191
192 FileHandleGuard(FileHandleGuard &); // not implemented
193 void operator =(FileHandleGuard); // not implemented
194};
195
196inline FileHandleGuard::~FileHandleGuard() SAL_THROW(())
197{
198 if (m_rHandle != 0)
199 {
200 if (osl_closeFile(m_rHandle) != osl_File_E_None)
201 {
202 OSL_FAIL("unexpected situation")do { if (true && (((sal_Bool)1))) { sal_detail_logFormat
((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "202" ": "), "%s", "unexpected situation"); } } while (false
)
;
203 }
204 }
205}
206
207
208class FileHandleReader
209{
210public:
211 enum Result
212 {
213 RESULT_OK,
214 RESULT_EOF,
215 RESULT_ERROR
216 };
217
218 inline FileHandleReader(oslFileHandle & rHandle) SAL_THROW(()):
219 m_aGuard(rHandle), m_nSize(0), m_nIndex(0), m_bLf(false) {}
220
221 Result readLine(rtl::OString * pLine) SAL_THROW(());
222
223private:
224 enum { BUFFER_SIZE = 1024 };
225
226 sal_Char m_aBuffer[BUFFER_SIZE];
227 FileHandleGuard m_aGuard;
228 int m_nSize;
229 int m_nIndex;
230 bool m_bLf;
231};
232
233FileHandleReader::Result
234FileHandleReader::readLine(rtl::OString * pLine)
235 SAL_THROW(())
236{
237 OSL_ENSURE(pLine, "specification violation")do { if (true && (!(pLine))) { sal_detail_logFormat((
SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "237" ": "), "%s", "specification violation"); } } while
(false)
;
238
239 for (bool bEof = true;; bEof = false)
240 {
241 if (m_nIndex == m_nSize)
242 {
243 sal_uInt64 nRead = 0;
244 switch (osl_readFile(
245 m_aGuard.getHandle(), m_aBuffer, sizeof(m_aBuffer), &nRead))
246 {
247 case osl_File_E_PIPE: //HACK! for windows
248 nRead = 0;
249 case osl_File_E_None:
250 if (nRead == 0)
251 {
252 m_bLf = false;
253 return bEof ? RESULT_EOF : RESULT_OK;
254 }
255 m_nIndex = 0;
256 m_nSize = static_cast< int >(nRead);
257 break;
258 case osl_File_E_INTR:
259 continue;
260
261 default:
262 return RESULT_ERROR;
263 }
264 }
265
266 if (m_bLf && m_aBuffer[m_nIndex] == 0x0A)
267 ++m_nIndex;
268 m_bLf = false;
269
270 int nStart = m_nIndex;
271 while (m_nIndex != m_nSize)
272 switch (m_aBuffer[m_nIndex++])
273 {
274 case 0x0D:
275 m_bLf = true;
276 case 0x0A:
277 *pLine += rtl::OString(m_aBuffer + nStart,
278 m_nIndex - 1 - nStart);
279 //TODO! check for overflow, and not very efficient
280 return RESULT_OK;
281 }
282
283 *pLine += rtl::OString(m_aBuffer + nStart, m_nIndex - nStart);
284 //TODO! check for overflow, and not very efficient
285 }
286}
287
288class AsynchReader: public salhelper::Thread
289{
290 size_t m_nDataSize;
291 boost::scoped_array<sal_Char> m_arData;
292
293 bool m_bError;
294 bool m_bDone;
295 FileHandleGuard m_aGuard;
296
297 virtual ~AsynchReader() {}
298
299 void execute();
300public:
301
302 AsynchReader(oslFileHandle & rHandle);
303
304 /** only call this function after this thread has finished.
305
306 That is, call join on this instance and then call getData.
307
308 */
309 OString getData();
310};
311
312AsynchReader::AsynchReader(oslFileHandle & rHandle):
313 Thread("jvmfwkAsyncReader"), m_nDataSize(0), m_bError(false),
314 m_bDone(false), m_aGuard(rHandle)
315{
316}
317
318OString AsynchReader::getData()
319{
320 return OString(m_arData.get(), m_nDataSize);
321}
322
323void AsynchReader::execute()
324{
325 const sal_uInt64 BUFFER_SIZE = 4096;
326 sal_Char aBuffer[BUFFER_SIZE];
327 while (true)
328 {
329 sal_uInt64 nRead;
330 //the function blocks until something could be read or the pipe closed.
331 switch (osl_readFile(
332 m_aGuard.getHandle(), aBuffer, BUFFER_SIZE, &nRead))
333 {
334 case osl_File_E_PIPE: //HACK! for windows
335 nRead = 0;
336 case osl_File_E_None:
337 break;
338 default:
339 m_bError = true;
340 return;
341 }
342
343 if (nRead == 0)
344 {
345 m_bDone = true;
346 break;
347 }
348 else if (nRead <= BUFFER_SIZE)
349 {
350 //Save the data we have in m_arData into a temporary array
351 boost::scoped_array<sal_Char> arTmp( new sal_Char[m_nDataSize]);
352 memcpy(arTmp.get(), m_arData.get(), m_nDataSize);
353 //Enlarge m_arData to hold the newly read data
354 m_arData.reset(new sal_Char[(size_t)(m_nDataSize + nRead)]);
355 //Copy back the data that was already in m_arData
356 memcpy(m_arData.get(), arTmp.get(), m_nDataSize);
357 //Add the newly read data to m_arData
358 memcpy(m_arData.get() + m_nDataSize, aBuffer, (size_t) nRead);
359 m_nDataSize += (size_t) nRead;
360 }
361 }
362}
363
364
365bool getJavaProps(const OUString & exePath,
366#ifdef JVM_ONE_PATH_CHECK
367 const OUString & homePath,
368#endif
369 std::vector<std::pair<rtl::OUString, rtl::OUString> >& props,
370 bool * bProcessRun)
371{
372 bool ret = false;
373
374 OSL_ASSERT(!exePath.isEmpty())do { if (true && (!(!exePath.isEmpty()))) { sal_detail_logFormat
((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "374" ": "), "OSL_ASSERT: %s", "!exePath.isEmpty()"); } }
while (false)
;
375 OUString usStartDir;
376 //We need to set the CLASSPATH in case the office is started from
377 //a different directory. The JREProperties.class is expected to reside
378 //next to the plugin.
379 rtl::OUString sThisLib;
380 if (osl_getModuleURLFromAddress((void *) (sal_IntPtr)& getJavaProps,
381 & sThisLib.pData) == sal_False((sal_Bool)0))
382 return false;
383 sThisLib = getDirFromFile(sThisLib);
384 OUString sClassPath;
385 if (osl_getSystemPathFromFileURL(sThisLib.pData, & sClassPath.pData)
386 != osl_File_E_None)
387 return false;
388
389 //check if we shall examine a Java for accessibility support
390 //If the bootstrap variable is "1" then we pass the argument
391 //"noaccessibility" to JREProperties.class. This will prevent
392 //that it calls java.awt.Toolkit.getDefaultToolkit();
393 OUString sValue;
394 getBootstrap()->getFrom(OUSTR("JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY")::rtl::OUString( (&("JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY"
)[0]), ((sal_Int32)((sizeof ("JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY"
) / sizeof (("JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY")[0]))-1)
), (((rtl_TextEncoding) 11)) )
, sValue);
395
396 //prepare the arguments
397 sal_Int32 cArgs = 3;
398 OUString arg1 = OUString(RTL_CONSTASCII_USTRINGPARAM("-classpath")(&("-classpath")[0]), ((sal_Int32)((sizeof ("-classpath")
/ sizeof (("-classpath")[0]))-1)), (((rtl_TextEncoding) 11))
);// + sClassPath;
399 OUString arg2 = sClassPath;
400 OUString arg3(RTL_CONSTASCII_USTRINGPARAM("JREProperties")(&("JREProperties")[0]), ((sal_Int32)((sizeof ("JREProperties"
) / sizeof (("JREProperties")[0]))-1)), (((rtl_TextEncoding) 11
))
);
401 OUString arg4 = OUSTR("noaccessibility")::rtl::OUString( (&("noaccessibility")[0]), ((sal_Int32)(
(sizeof ("noaccessibility") / sizeof (("noaccessibility")[0])
)-1)), (((rtl_TextEncoding) 11)) )
;
402 rtl_uString *args[4] = {arg1.pData, arg2.pData, arg3.pData};
403
404 // Only add the fourth param if the bootstrap parameter is set.
405 if (sValue.equals(OUString::valueOf((sal_Int32) 1)))
406 {
407 args[3] = arg4.pData;
408 cArgs = 4;
409 }
410
411 oslProcess javaProcess= 0;
412 oslFileHandle fileOut= 0;
413 oslFileHandle fileErr= 0;
414
415 FileHandleReader stdoutReader(fileOut);
416 rtl::Reference< AsynchReader > stderrReader(new AsynchReader(fileErr));
417
418 JFW_TRACE2(OUSTR("\n[Java framework] Executing: ") + exePath + OUSTR(".\n"))do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("\n[Java framework] Executing: "
)[0]), ((sal_Int32)((sizeof ("\n[Java framework] Executing: "
) / sizeof (("\n[Java framework] Executing: ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + exePath + ::rtl::OUString( (&(".\n")[0]), ((sal_Int32
)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((rtl_TextEncoding
) 11)) )) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "418" ": "), ::sal::detail::unwrapStream( ::sal::detail::
StreamStart() << ::rtl::OUString( (&("\n[Java framework] Executing: "
)[0]), ((sal_Int32)((sizeof ("\n[Java framework] Executing: "
) / sizeof (("\n[Java framework] Executing: ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + exePath + ::rtl::OUString( (&(".\n")[0]), ((sal_Int32
)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((rtl_TextEncoding
) 11)) ))); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream
<< ::rtl::OUString( (&("\n[Java framework] Executing: "
)[0]), ((sal_Int32)((sizeof ("\n[Java framework] Executing: "
) / sizeof (("\n[Java framework] Executing: ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + exePath + ::rtl::OUString( (&(".\n")[0]), ((sal_Int32
)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((rtl_TextEncoding
) 11)) ); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO), (
"jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "418" ": "), sal_detail_stream); } } } while (false)
;
419 oslProcessError procErr =
420 osl_executeProcess_WithRedirectedIO( exePath.pData,//usExe.pData,
421 args,
422 cArgs, //sal_uInt32 nArguments,
423 osl_Process_HIDDEN0x0010, //oslProcessOption Options,
424 NULL__null, //oslSecurity Security,
425 usStartDir.pData,//usStartDir.pData,//usWorkDir.pData, //rtl_uString *strWorkDir,
426 NULL__null, //rtl_uString *strEnvironment[],
427 0, // sal_uInt32 nEnvironmentVars,
428 &javaProcess, //oslProcess *pProcess,
429 NULL__null,//oslFileHandle *pChildInputWrite,
430 &fileOut,//oslFileHandle *pChildOutputRead,
431 &fileErr);//oslFileHandle *pChildErrorRead);
432
433 if( procErr != osl_Process_E_None)
434 {
435 JFW_TRACE2("[Java framework] Execution failed. \n")do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << "[Java framework] Execution failed. \n"
) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"
), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "435" ": "), ::sal::detail::unwrapStream( ::sal::detail::
StreamStart() << "[Java framework] Execution failed. \n"
)); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream
<< "[Java framework] Execution failed. \n"; ::sal::detail
::log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "435" ": "), sal_detail_stream); } } } while (false)
;
436 *bProcessRun = false;
437 return ret;
438 }
439 else
440 {
441 JFW_TRACE2("[Java framework] Java executed successfully.\n")do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << "[Java framework] Java executed successfully.\n"
) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"
), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "441" ": "), ::sal::detail::unwrapStream( ::sal::detail::
StreamStart() << "[Java framework] Java executed successfully.\n"
)); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream
<< "[Java framework] Java executed successfully.\n"; ::
sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"
), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "441" ": "), sal_detail_stream); } } } while (false)
;
442 *bProcessRun = true;
443 }
444
445 //Start asynchronous reading (different thread) of error stream
446 stderrReader->launch();
447
448 //Use this thread to read output stream
449 FileHandleReader::Result rs = FileHandleReader::RESULT_OK;
450 while (1)
451 {
452 OString aLine;
453 rs = stdoutReader.readLine( & aLine);
454 if (rs != FileHandleReader::RESULT_OK)
455 break;
456 OUString sLine;
457 if (!decodeOutput(aLine, &sLine))
458 continue;
459 JFW_TRACE2("[Java framework]:\" " << sLine << " \".\n")do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << "[Java framework]:\" " <<
sLine << " \".\n") == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "459" ": "), ::sal::detail::unwrapStream( ::sal::detail::
StreamStart() << "[Java framework]:\" " << sLine <<
" \".\n")); } else { ::std::ostringstream sal_detail_stream;
sal_detail_stream << "[Java framework]:\" " << sLine
<< " \".\n"; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "459" ": "), sal_detail_stream); } } } while (false)
;
460 sLine = sLine.trim();
461 if (sLine.isEmpty())
462 continue;
463 //The JREProperties class writes key value pairs, separated by '='
464 sal_Int32 index = sLine.indexOf('=', 0);
465 OSL_ASSERT(index != -1)do { if (true && (!(index != -1))) { sal_detail_logFormat
((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "465" ": "), "OSL_ASSERT: %s", "index != -1"); } } while
(false)
;
466 OUString sKey = sLine.copy(0, index);
467 OUString sVal = sLine.copy(index + 1);
468
469#ifdef JVM_ONE_PATH_CHECK
470 //replace absolute path by linux distro link
471 OUString sHomeProperty(RTL_CONSTASCII_USTRINGPARAM("java.home")(&("java.home")[0]), ((sal_Int32)((sizeof ("java.home") /
sizeof (("java.home")[0]))-1)), (((rtl_TextEncoding) 11))
);
472 if(sHomeProperty.equals(sKey))
473 {
474 sVal = homePath + OUString::createFromAscii("/jre");
475 }
476#endif
477
478 props.push_back(std::make_pair(sKey, sVal));
479 }
480
481 if (rs != FileHandleReader::RESULT_ERROR && !props.empty())
482 ret = true;
483
484 //process error stream data
485 stderrReader->join();
486 JFW_TRACE2("[Java framework] Java wrote to stderr:\" "do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << "[Java framework] Java wrote to stderr:\" "
<< stderrReader->getData().getStr() << " \".\n"
) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"
), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "487" ": "), ::sal::detail::unwrapStream( ::sal::detail::
StreamStart() << "[Java framework] Java wrote to stderr:\" "
<< stderrReader->getData().getStr() << " \".\n"
)); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream
<< "[Java framework] Java wrote to stderr:\" " <<
stderrReader->getData().getStr() << " \".\n"; ::sal
::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"),
("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "487" ": "), sal_detail_stream); } } } while (false)
487 << stderrReader->getData().getStr() << " \".\n")do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << "[Java framework] Java wrote to stderr:\" "
<< stderrReader->getData().getStr() << " \".\n"
) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"
), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "487" ": "), ::sal::detail::unwrapStream( ::sal::detail::
StreamStart() << "[Java framework] Java wrote to stderr:\" "
<< stderrReader->getData().getStr() << " \".\n"
)); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream
<< "[Java framework] Java wrote to stderr:\" " <<
stderrReader->getData().getStr() << " \".\n"; ::sal
::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"),
("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "487" ": "), sal_detail_stream); } } } while (false)
;
488
489 TimeValue waitMax= {5 ,0};
490 procErr = osl_joinProcessWithTimeout(javaProcess, &waitMax);
491 OSL_ASSERT(procErr == osl_Process_E_None)do { if (true && (!(procErr == osl_Process_E_None))) {
sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"
), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "491" ": "), "OSL_ASSERT: %s", "procErr == osl_Process_E_None"
); } } while (false)
;
492 osl_freeProcessHandle(javaProcess);
493 return ret;
494}
495
496/* converts the properties printed by JREProperties.class into
497 readable strings. The strings are encoded as integer values separated
498 by spaces.
499 */
500bool decodeOutput(const rtl::OString& s, rtl::OUString* out)
501{
502 OSL_ASSERT(out != 0)do { if (true && (!(out != 0))) { sal_detail_logFormat
((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "502" ": "), "OSL_ASSERT: %s", "out != 0"); } } while (false
)
;
503 OUStringBuffer buff(512);
504 sal_Int32 nIndex = 0;
505 do
506 {
507 OString aToken = s.getToken( 0, ' ', nIndex );
508 if (!aToken.isEmpty())
509 {
510 for (sal_Int32 i = 0; i < aToken.getLength(); ++i)
511 {
512 if (aToken[i] < '0' || aToken[i] > '9')
513 return false;
514 }
515 sal_Unicode value = (sal_Unicode)(aToken.toInt32());
516 buff.append(value);
517 }
518 } while (nIndex >= 0);
519
520 *out = buff.makeStringAndClear();
521 return true;
522}
523
524
525#if defined WNT
526void createJavaInfoFromWinReg(std::vector<rtl::Reference<VendorBase> > & vecInfos)
527{
528 // Get Java s from registry
529 std::vector<OUString> vecJavaHome;
530 if(getSDKInfoFromRegistry(vecJavaHome))
531 {
532 // create impl objects
533 typedef std::vector<OUString>::iterator ItHome;
534 for(ItHome it_home= vecJavaHome.begin(); it_home != vecJavaHome.end();
535 it_home++)
536 {
537 getJREInfoByPath(*it_home, vecInfos);
538 }
539 }
540
541 vecJavaHome.clear();
542 if(getJREInfoFromRegistry(vecJavaHome))
543 {
544 typedef std::vector<OUString>::iterator ItHome;
545 for(ItHome it_home= vecJavaHome.begin(); it_home != vecJavaHome.end();
546 it_home++)
547 {
548 getJREInfoByPath(*it_home, vecInfos);
549 }
550 }
551}
552
553
554bool getJavaInfoFromRegistry(const wchar_t* szRegKey,
555 vector<OUString>& vecJavaHome)
556{
557 HKEY hRoot;
558 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szRegKey, 0, KEY_ENUMERATE_SUB_KEYS, &hRoot)
559 == ERROR_SUCCESS)
560 {
561 DWORD dwIndex = 0;
562 const DWORD BUFFSIZE = 1024;
563 wchar_t bufVersion[BUFFSIZE];
564 DWORD nNameLen = BUFFSIZE;
565 FILETIME fileTime;
566 nNameLen = sizeof(bufVersion);
567
568 // Iterate over all subkeys of HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment
569 while (RegEnumKeyExW(hRoot, dwIndex, bufVersion, &nNameLen, NULL__null, NULL__null, NULL__null, &fileTime) != ERROR_NO_MORE_ITEMS)
570 {
571 HKEY hKey;
572 // Open a Java Runtime Environment sub key, e.g. "1.4.0"
573 if (RegOpenKeyExW(hRoot, bufVersion, 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS)
574 {
575 DWORD dwType;
576 DWORD dwTmpPathLen= 0;
577 // Get the path to the JavaHome every JRE entry
578 // Find out how long the string for JavaHome is and allocate memory to hold the path
579 if( RegQueryValueExW(hKey, L"JavaHome", 0, &dwType, NULL__null, &dwTmpPathLen)== ERROR_SUCCESS)
580 {
581 char* szTmpPath= (char *) malloc( dwTmpPathLen);
582 // Get the path for the runtime lib
583 if(RegQueryValueExW(hKey, L"JavaHome", 0, &dwType, (unsigned char*) szTmpPath, &dwTmpPathLen) == ERROR_SUCCESS)
584 {
585 // There can be several version entries refering with the same JavaHome,e.g 1.4 and 1.4.1
586 OUString usHome((sal_Unicode*) szTmpPath);
587 // check if there is already an entry with the same JavaHomeruntime lib
588 // if so, we use the one with the more accurate version
589 bool bAppend= true;
590 OUString usHomeUrl;
591 if (osl_getFileURLFromSystemPath(usHome.pData, & usHomeUrl.pData) ==
592 osl_File_E_None)
593 {
594 //iterate over the vector with java home strings
595 typedef vector<OUString>::iterator ItHome;
596 for(ItHome itHome= vecJavaHome.begin();
597 itHome != vecJavaHome.end(); itHome++)
598 {
599 if(usHomeUrl.equals(*itHome))
600 {
601 bAppend= false;
602 break;
603 }
604 }
605 // Save the home dir
606 if(bAppend)
607 {
608 vecJavaHome.push_back(usHomeUrl);
609 }
610 }
611 }
612 free( szTmpPath);
613 RegCloseKey(hKey);
614 }
615 }
616 dwIndex ++;
617 nNameLen = BUFFSIZE;
618 }
619 RegCloseKey(hRoot);
620 }
621 return true;
622}
623
624
625
626bool getSDKInfoFromRegistry(vector<OUString> & vecHome)
627{
628 return getJavaInfoFromRegistry(HKEY_SUN_SDK, vecHome);
629}
630
631bool getJREInfoFromRegistry(vector<OUString>& vecJavaHome)
632{
633 return getJavaInfoFromRegistry(HKEY_SUN_JRE, vecJavaHome);
634}
635
636#endif // WNT
637
638void bubbleSortVersion(vector<rtl::Reference<VendorBase> >& vec)
639{
640 if(vec.empty())
2
Taking false branch
641 return;
642 int size= vec.size() - 1;
643 int cIter= 0;
644 // sort for version
645 for(int i= 0; i < size; i++)
3
Loop condition is true. Entering loop body
646 {
647 for(int j= size; j > 0 + cIter; j--)
4
Loop condition is true. Entering loop body
648 {
649 rtl::Reference<VendorBase>& cur= vec.at(j);
650 rtl::Reference<VendorBase>& next= vec.at(j-1);
651
652 int nCmp = 0;
653 // comparing invalid SunVersion s is possible, they will be less than a
654 // valid version
655
656 //check if version of current is recognized, by comparing it with itself
657 try
658 {
659 cur->compareVersions(cur->getVersion());
5
Called C++ object pointer is null
660 }
661 catch (MalformedVersionException &)
662 {
663 nCmp = -1; // current < next
664 }
665 //The version of cur is valid, now compare with the second version
666 if (nCmp == 0)
667 {
668 try
669 {
670 nCmp = cur->compareVersions(next->getVersion());
671 }
672 catch (MalformedVersionException & )
673 {
674 //The second version is invalid, therefor it is regardes less.
675 nCmp = 1;
676 }
677 }
678 if(nCmp == 1) // cur > next
679 {
680 rtl::Reference<VendorBase> less = next;
681 vec.at(j-1)= cur;
682 vec.at(j)= less;
683 }
684 }
685 ++cIter;
686 }
687}
688
689
690bool getJREInfoFromBinPath(
691 const rtl::OUString& path, vector<rtl::Reference<VendorBase> > & vecInfos)
692{
693 // file:///c:/jre/bin
694 //map: jre/bin/java.exe
695 bool ret = false;
696
697 for ( sal_Int32 pos = 0;
698 gVendorMap[pos].sVendorName != NULL__null; ++pos )
699 {
700 vector<OUString> vecPaths;
701 getJavaExePaths_func pFunc = gVendorMap[pos].getJavaFunc;
702
703 int size = 0;
704 char const* const* arExePaths = (*pFunc)(&size);
705 vecPaths = getVectorFromCharArray(arExePaths, size);
706
707 //make sure argument path does not end with '/'
708 OUString sBinPath = path;
709 if (path.lastIndexOf('/') == (path.getLength() - 1))
710 sBinPath = path.copy(0, path.getLength() - 1);
711
712 typedef vector<OUString>::const_iterator c_it;
713 for (c_it i = vecPaths.begin(); i != vecPaths.end(); ++i)
714 {
715 //the map contains e.g. jre/bin/java.exe
716 //get the directory where the executable is contained
717 OUString sHome;
718 sal_Int32 index = i->lastIndexOf('/');
719 if (index == -1)
720 {
721 //map contained only : "java.exe, then the argument
722 //path is already the home directory
723 sHome = sBinPath;
724 }
725 else
726 {
727 // jre/bin/jre -> jre/bin
728 OUString sMapPath(i->getStr(), index);
729 index = sBinPath.lastIndexOf(sMapPath);
730 if (index != -1
731 && (index + sMapPath.getLength() == sBinPath.getLength())
732 && sBinPath[index - 1] == '/')
733 {
734 sHome = OUString(sBinPath.getStr(), index - 1);
735 }
736 }
737 if (!sHome.isEmpty())
738 {
739 ret = getJREInfoByPath(sHome, vecInfos);
740 if (ret)
741 break;
742 }
743 }
744 if (ret)
745 break;
746 }
747 return ret;
748}
749
750vector<Reference<VendorBase> > getAllJREInfos()
751{
752 vector<Reference<VendorBase> > vecInfos;
753
754#if defined WNT
755 // Get Javas from the registry
756 createJavaInfoFromWinReg(vecInfos);
757#endif // WNT
758
759#ifndef JVM_ONE_PATH_CHECK
760 createJavaInfoFromJavaHome(vecInfos);
761 //this function should be called after createJavaInfoDirScan.
762 //Otherwise in SDKs Java may be started twice
763 createJavaInfoFromPath(vecInfos);
764#endif
765
766#ifdef UNX1
767 createJavaInfoDirScan(vecInfos);
768#endif
769
770 bubbleSortVersion(vecInfos);
1
Calling 'bubbleSortVersion'
771 return vecInfos;
772}
773
774
775vector<OUString> getVectorFromCharArray(char const * const * ar, int size)
776{
777 vector<OUString> vec;
778 for( int i = 0; i < size; i++)
779 {
780 OUString s(ar[i], strlen(ar[i]), RTL_TEXTENCODING_UTF8(((rtl_TextEncoding) 76)));
781 vec.push_back(s);
782 }
783 return vec;
784}
785bool getJREInfoByPath(const rtl::OUString& path,
786 std::vector<rtl::Reference<VendorBase> > & vecInfos)
787{
788 bool ret = false;
789
790 rtl::Reference<VendorBase> aInfo = getJREInfoByPath(path);
791 if (aInfo.is())
792 {
793 ret = true;
794 vector<rtl::Reference<VendorBase> >::const_iterator it_impl= std::find_if(
795 vecInfos.begin(),vecInfos.end(), InfoFindSame(aInfo->getHome()));
796 if(it_impl == vecInfos.end())
797 {
798 vecInfos.push_back(aInfo);
799 }
800 }
801 return ret;
802}
803
804/** Checks if the path is a directory. Links are resolved.
805 In case of an error the returned string has the length 0.
806 Otherwise the returned string is the "resolved" file URL.
807 */
808OUString resolveDirPath(const OUString & path)
809{
810 OUString ret;
811 salhelper::LinkResolver aResolver(osl_FileStatus_Mask_Type0x00000001 |
812 osl_FileStatus_Mask_FileURL0x00000200);
813 if (aResolver.fetchFileStatus(path) == osl::FileBase::E_None)
814 {
815 //check if this is a directory
816 if (aResolver.m_aStatus.getFileType() == FileStatus::Directory)
817 {
818#ifndef JVM_ONE_PATH_CHECK
819 ret = aResolver.m_aStatus.getFileURL();
820#else
821 ret = path;
822#endif
823 }
824 }
825 return ret;
826}
827/** Checks if the path is a file. If it is a link to a file than
828 it is resolved.
829 */
830OUString resolveFilePath(const OUString & path)
831{
832 OUString ret;
833 salhelper::LinkResolver aResolver(osl_FileStatus_Mask_Type0x00000001 |
834 osl_FileStatus_Mask_FileURL0x00000200);
835 if (aResolver.fetchFileStatus(path) == osl::FileBase::E_None)
836 {
837 //check if this is a file
838 if (aResolver.m_aStatus.getFileType() == FileStatus::Regular)
839 {
840#ifndef JVM_ONE_PATH_CHECK
841 ret = aResolver.m_aStatus.getFileURL();
842#else
843 ret = path;
844#endif
845 }
846 }
847 return ret;
848}
849
850rtl::Reference<VendorBase> getJREInfoByPath(
851 const OUString& path)
852{
853 rtl::Reference<VendorBase> ret;
854 static vector<OUString> vecBadPaths;
855
856 static map<OUString, rtl::Reference<VendorBase> > mapJREs;
857 typedef map<OUString, rtl::Reference<VendorBase> >::const_iterator MapIt;
858 typedef map<OUString, rtl::Reference<VendorBase> > MAPJRE;
859 OUString sFilePath;
860 typedef vector<OUString>::const_iterator cit_path;
861 vector<pair<OUString, OUString> > props;
862
863 OUString sResolvedDir = resolveDirPath(path);
864 // If this path is invalid then there is no chance to find a JRE here
865 if (sResolvedDir.isEmpty())
866 return 0;
867
868 //check if the directory path is good, that is a JRE was already recognized.
869 //Then we need not detect it again
870 //For example, a sun JKD contains <jdk>/bin/java and <jdk>/jre/bin/java.
871 //When <jdk>/bin/java has been found then we need not find <jdk>/jre/bin/java.
872 //Otherwise we would execute java two times for evers JDK found.
873 MapIt entry2 = find_if(mapJREs.begin(), mapJREs.end(),
874 SameOrSubDirJREMap(sResolvedDir));
875 if (entry2 != mapJREs.end())
876 {
877 JFW_TRACE2(OUSTR("[Java framework] sunjavaplugin" SAL_DLLEXTENSION ": ")do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("JRE found again (detected before): ")[0]), ((sal_Int32
)((sizeof ("JRE found again (detected before): ") / sizeof ((
"JRE found again (detected before): ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sResolvedDir + ::rtl::OUString( (&(".\n")[0]),
((sal_Int32)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((
rtl_TextEncoding) 11)) )) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "879" ": "), ::sal::detail::unwrapStream( ::sal::detail::
StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("JRE found again (detected before): ")[0]), ((sal_Int32
)((sizeof ("JRE found again (detected before): ") / sizeof ((
"JRE found again (detected before): ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sResolvedDir + ::rtl::OUString( (&(".\n")[0]),
((sal_Int32)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((
rtl_TextEncoding) 11)) ))); } else { ::std::ostringstream sal_detail_stream
; sal_detail_stream << ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("JRE found again (detected before): ")[0]), ((sal_Int32
)((sizeof ("JRE found again (detected before): ") / sizeof ((
"JRE found again (detected before): ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sResolvedDir + ::rtl::OUString( (&(".\n")[0]),
((sal_Int32)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((
rtl_TextEncoding) 11)) ); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "879" ": "), sal_detail_stream); } } } while (false)
878 + OUSTR("JRE found again (detected before): ") + sResolvedDirdo { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("JRE found again (detected before): ")[0]), ((sal_Int32
)((sizeof ("JRE found again (detected before): ") / sizeof ((
"JRE found again (detected before): ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sResolvedDir + ::rtl::OUString( (&(".\n")[0]),
((sal_Int32)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((
rtl_TextEncoding) 11)) )) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "879" ": "), ::sal::detail::unwrapStream( ::sal::detail::
StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("JRE found again (detected before): ")[0]), ((sal_Int32
)((sizeof ("JRE found again (detected before): ") / sizeof ((
"JRE found again (detected before): ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sResolvedDir + ::rtl::OUString( (&(".\n")[0]),
((sal_Int32)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((
rtl_TextEncoding) 11)) ))); } else { ::std::ostringstream sal_detail_stream
; sal_detail_stream << ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("JRE found again (detected before): ")[0]), ((sal_Int32
)((sizeof ("JRE found again (detected before): ") / sizeof ((
"JRE found again (detected before): ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sResolvedDir + ::rtl::OUString( (&(".\n")[0]),
((sal_Int32)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((
rtl_TextEncoding) 11)) ); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "879" ": "), sal_detail_stream); } } } while (false)
879 + OUSTR(".\n"))do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("JRE found again (detected before): ")[0]), ((sal_Int32
)((sizeof ("JRE found again (detected before): ") / sizeof ((
"JRE found again (detected before): ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sResolvedDir + ::rtl::OUString( (&(".\n")[0]),
((sal_Int32)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((
rtl_TextEncoding) 11)) )) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "879" ": "), ::sal::detail::unwrapStream( ::sal::detail::
StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("JRE found again (detected before): ")[0]), ((sal_Int32
)((sizeof ("JRE found again (detected before): ") / sizeof ((
"JRE found again (detected before): ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sResolvedDir + ::rtl::OUString( (&(".\n")[0]),
((sal_Int32)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((
rtl_TextEncoding) 11)) ))); } else { ::std::ostringstream sal_detail_stream
; sal_detail_stream << ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("JRE found again (detected before): ")[0]), ((sal_Int32
)((sizeof ("JRE found again (detected before): ") / sizeof ((
"JRE found again (detected before): ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sResolvedDir + ::rtl::OUString( (&(".\n")[0]),
((sal_Int32)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((
rtl_TextEncoding) 11)) ); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "879" ": "), sal_detail_stream); } } } while (false)
;
880 return entry2->second;
881 }
882
883 for ( sal_Int32 pos = 0;
884 gVendorMap[pos].sVendorName != NULL__null; ++pos )
885 {
886 vector<OUString> vecPaths;
887 getJavaExePaths_func pFunc = gVendorMap[pos].getJavaFunc;
888
889 int size = 0;
890 char const* const* arExePaths = (*pFunc)(&size);
891 vecPaths = getVectorFromCharArray(arExePaths, size);
892
893 bool bBreak = false;
894 typedef vector<OUString>::const_iterator c_it;
895 for (c_it i = vecPaths.begin(); i != vecPaths.end(); ++i)
896 {
897 //if the path is a link, then resolve it
898 //check if the executable exists at all
899
900 //path can be only "file:///". Then do not append a '/'
901 //sizeof counts the terminating 0
902 OUString sFullPath;
903 if (path.getLength() == sizeof("file:///") - 1)
904 sFullPath = sResolvedDir + (*i);
905 else
906 sFullPath = sResolvedDir +
907 OUString(RTL_CONSTASCII_USTRINGPARAM("/")(&("/")[0]), ((sal_Int32)((sizeof ("/") / sizeof (("/")[0
]))-1)), (((rtl_TextEncoding) 11))
) + (*i);
908
909
910 sFilePath = resolveFilePath(sFullPath);
911
912 if (sFilePath.isEmpty())
913 {
914 //The file path (to java exe) is not valid
915 cit_path ifull = find(vecBadPaths.begin(), vecBadPaths.end(), sFullPath);
916 if (ifull == vecBadPaths.end())
917 vecBadPaths.push_back(sFullPath);
918 continue;
919 }
920
921 cit_path ifile = find(vecBadPaths.begin(), vecBadPaths.end(), sFilePath);
922 if (ifile != vecBadPaths.end())
923 continue;
924
925 MapIt entry = mapJREs.find(sFilePath);
926 if (entry != mapJREs.end())
927 {
928 JFW_TRACE2(OUSTR("[Java framework] sunjavaplugin" SAL_DLLEXTENSION ": ")do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("JRE found again (detected before): ")[0]), ((sal_Int32
)((sizeof ("JRE found again (detected before): ") / sizeof ((
"JRE found again (detected before): ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sFilePath + ::rtl::OUString( (&(".\n")[0]), ((
sal_Int32)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((rtl_TextEncoding
) 11)) )) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "930" ": "), ::sal::detail::unwrapStream( ::sal::detail::
StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("JRE found again (detected before): ")[0]), ((sal_Int32
)((sizeof ("JRE found again (detected before): ") / sizeof ((
"JRE found again (detected before): ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sFilePath + ::rtl::OUString( (&(".\n")[0]), ((
sal_Int32)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((rtl_TextEncoding
) 11)) ))); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream
<< ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("JRE found again (detected before): ")[0]), ((sal_Int32
)((sizeof ("JRE found again (detected before): ") / sizeof ((
"JRE found again (detected before): ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sFilePath + ::rtl::OUString( (&(".\n")[0]), ((
sal_Int32)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((rtl_TextEncoding
) 11)) ); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO), (
"jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "930" ": "), sal_detail_stream); } } } while (false)
929 + OUSTR("JRE found again (detected before): ") + sFilePathdo { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("JRE found again (detected before): ")[0]), ((sal_Int32
)((sizeof ("JRE found again (detected before): ") / sizeof ((
"JRE found again (detected before): ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sFilePath + ::rtl::OUString( (&(".\n")[0]), ((
sal_Int32)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((rtl_TextEncoding
) 11)) )) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "930" ": "), ::sal::detail::unwrapStream( ::sal::detail::
StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("JRE found again (detected before): ")[0]), ((sal_Int32
)((sizeof ("JRE found again (detected before): ") / sizeof ((
"JRE found again (detected before): ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sFilePath + ::rtl::OUString( (&(".\n")[0]), ((
sal_Int32)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((rtl_TextEncoding
) 11)) ))); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream
<< ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("JRE found again (detected before): ")[0]), ((sal_Int32
)((sizeof ("JRE found again (detected before): ") / sizeof ((
"JRE found again (detected before): ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sFilePath + ::rtl::OUString( (&(".\n")[0]), ((
sal_Int32)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((rtl_TextEncoding
) 11)) ); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO), (
"jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "930" ": "), sal_detail_stream); } } } while (false)
930 + OUSTR(".\n"))do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("JRE found again (detected before): ")[0]), ((sal_Int32
)((sizeof ("JRE found again (detected before): ") / sizeof ((
"JRE found again (detected before): ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sFilePath + ::rtl::OUString( (&(".\n")[0]), ((
sal_Int32)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((rtl_TextEncoding
) 11)) )) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "930" ": "), ::sal::detail::unwrapStream( ::sal::detail::
StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("JRE found again (detected before): ")[0]), ((sal_Int32
)((sizeof ("JRE found again (detected before): ") / sizeof ((
"JRE found again (detected before): ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sFilePath + ::rtl::OUString( (&(".\n")[0]), ((
sal_Int32)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((rtl_TextEncoding
) 11)) ))); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream
<< ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("JRE found again (detected before): ")[0]), ((sal_Int32
)((sizeof ("JRE found again (detected before): ") / sizeof ((
"JRE found again (detected before): ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + sFilePath + ::rtl::OUString( (&(".\n")[0]), ((
sal_Int32)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((rtl_TextEncoding
) 11)) ); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO), (
"jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "930" ": "), sal_detail_stream); } } } while (false)
;
931
932 return entry->second;
933 }
934
935 bool bProcessRun= false;
936 if (getJavaProps(sFilePath,
937#ifdef JVM_ONE_PATH_CHECK
938 sResolvedDir,
939#endif
940 props, & bProcessRun) == false)
941 {
942 //The java executable could not be run or the system properties
943 //could not be retrieved. We can assume that this java is corrupt.
944 vecBadPaths.push_back(sFilePath);
945 //If there was a java executable, that could be run but we did not get
946 //the system properties, then we also assume that the whole Java installation
947 //does not work. In a jdk there are two executables. One in jdk/bin and the other
948 //in jdk/jre/bin. We do not search any further, because we assume that if one java
949 //does not work then the other does not work as well. This saves us to run java
950 //again which is quite costly.
951 if (bProcessRun == true)
952 {
953 // 1.3.1 special treatment: jdk/bin/java and /jdk/jre/bin/java are links to
954 //a script, named .java_wrapper. The script starts jdk/bin/sparc/native_threads/java
955 //or jdk/jre/bin/sparc/native_threads/java. The script uses the name with which it was
956 //invoked to build the path to the executable. It we start the script directy as .java_wrapper
957 //then it tries to start a jdk/.../native_threads/.java_wrapper. Therefore the link, which
958 //is named java, must be used to start the script.
959 getJavaProps(sFullPath,
960#ifdef JVM_ONE_PATH_CHECK
961 sResolvedDir,
962#endif
963 props, & bProcessRun);
964 // Either we found a working 1.3.1
965 //Or the java is broken. In both cases we stop searchin under this "root" directory
966 bBreak = true;
967 break;
968 }
969 //sFilePath is no working java executable. We continue with another possible
970 //path.
971 else
972 {
973 continue;
974 }
975 }
976 //sFilePath is a java and we could get the system properties. We proceed with this
977 //java.
978 else
979 {
980 bBreak = true;
981 break;
982 }
983 }
984 if (bBreak)
985 break;
986 }
987
988 if (props.empty())
989 return rtl::Reference<VendorBase>();
990
991 //find java.vendor property
992 typedef vector<pair<OUString, OUString> >::const_iterator c_ip;
993 OUString sVendor(RTL_CONSTASCII_USTRINGPARAM("java.vendor")(&("java.vendor")[0]), ((sal_Int32)((sizeof ("java.vendor"
) / sizeof (("java.vendor")[0]))-1)), (((rtl_TextEncoding) 11
))
);
994 OUString sVendorName;
995
996 for (c_ip i = props.begin(); i != props.end(); ++i)
997 {
998 if (sVendor.equals(i->first))
999 {
1000 sVendorName = i->second;
1001 break;
1002 }
1003 }
1004
1005 if (!sVendorName.isEmpty())
1006 {
1007 //find the creator func for the respective vendor name
1008 for ( sal_Int32 c = 0;
1009 gVendorMap[c].sVendorName != NULL__null; ++c )
1010 {
1011 OUString sNameMap(gVendorMap[c].sVendorName, strlen(gVendorMap[c].sVendorName),
1012 RTL_TEXTENCODING_ASCII_US(((rtl_TextEncoding) 11)));
1013 if (sNameMap.equals(sVendorName))
1014 {
1015 ret = createInstance(gVendorMap[c].createFunc, props);
1016 break;
1017 }
1018 }
1019 }
1020 if (ret.is() == false)
1021 vecBadPaths.push_back(sFilePath);
1022 else
1023 {
1024 JFW_TRACE2(OUSTR("[Java framework] sunjavaplugin" SAL_DLLEXTENSION ": ")do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("Found JRE: ")[0]), ((sal_Int32)((sizeof ("Found JRE: "
) / sizeof (("Found JRE: ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + sResolvedDir + ::rtl::OUString( (&(" \n at: ")[0])
, ((sal_Int32)((sizeof (" \n at: ") / sizeof ((" \n at: ")[0]
))-1)), (((rtl_TextEncoding) 11)) ) + path + ::rtl::OUString(
(&(".\n")[0]), ((sal_Int32)((sizeof (".\n") / sizeof ((".\n"
)[0]))-1)), (((rtl_TextEncoding) 11)) )) == 1) { ::sal_detail_log
( (::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1026" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("Found JRE: ")[0]), ((sal_Int32)((sizeof ("Found JRE: "
) / sizeof (("Found JRE: ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + sResolvedDir + ::rtl::OUString( (&(" \n at: ")[0])
, ((sal_Int32)((sizeof (" \n at: ") / sizeof ((" \n at: ")[0]
))-1)), (((rtl_TextEncoding) 11)) ) + path + ::rtl::OUString(
(&(".\n")[0]), ((sal_Int32)((sizeof (".\n") / sizeof ((".\n"
)[0]))-1)), (((rtl_TextEncoding) 11)) ))); } else { ::std::ostringstream
sal_detail_stream; sal_detail_stream << ::rtl::OUString
( (&("[Java framework] sunjavaplugin" ".so" ": ")[0]), ((
sal_Int32)((sizeof ("[Java framework] sunjavaplugin" ".so" ": "
) / sizeof (("[Java framework] sunjavaplugin" ".so" ": ")[0])
)-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString( (&(
"Found JRE: ")[0]), ((sal_Int32)((sizeof ("Found JRE: ") / sizeof
(("Found JRE: ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + sResolvedDir
+ ::rtl::OUString( (&(" \n at: ")[0]), ((sal_Int32)((sizeof
(" \n at: ") / sizeof ((" \n at: ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + path + ::rtl::OUString( (&(".\n")[0]), ((sal_Int32
)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((rtl_TextEncoding
) 11)) ); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO), (
"jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1026" ": "), sal_detail_stream); } } } while (false)
1025 + OUSTR("Found JRE: ") + sResolvedDirdo { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("Found JRE: ")[0]), ((sal_Int32)((sizeof ("Found JRE: "
) / sizeof (("Found JRE: ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + sResolvedDir + ::rtl::OUString( (&(" \n at: ")[0])
, ((sal_Int32)((sizeof (" \n at: ") / sizeof ((" \n at: ")[0]
))-1)), (((rtl_TextEncoding) 11)) ) + path + ::rtl::OUString(
(&(".\n")[0]), ((sal_Int32)((sizeof (".\n") / sizeof ((".\n"
)[0]))-1)), (((rtl_TextEncoding) 11)) )) == 1) { ::sal_detail_log
( (::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1026" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("Found JRE: ")[0]), ((sal_Int32)((sizeof ("Found JRE: "
) / sizeof (("Found JRE: ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + sResolvedDir + ::rtl::OUString( (&(" \n at: ")[0])
, ((sal_Int32)((sizeof (" \n at: ") / sizeof ((" \n at: ")[0]
))-1)), (((rtl_TextEncoding) 11)) ) + path + ::rtl::OUString(
(&(".\n")[0]), ((sal_Int32)((sizeof (".\n") / sizeof ((".\n"
)[0]))-1)), (((rtl_TextEncoding) 11)) ))); } else { ::std::ostringstream
sal_detail_stream; sal_detail_stream << ::rtl::OUString
( (&("[Java framework] sunjavaplugin" ".so" ": ")[0]), ((
sal_Int32)((sizeof ("[Java framework] sunjavaplugin" ".so" ": "
) / sizeof (("[Java framework] sunjavaplugin" ".so" ": ")[0])
)-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString( (&(
"Found JRE: ")[0]), ((sal_Int32)((sizeof ("Found JRE: ") / sizeof
(("Found JRE: ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + sResolvedDir
+ ::rtl::OUString( (&(" \n at: ")[0]), ((sal_Int32)((sizeof
(" \n at: ") / sizeof ((" \n at: ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + path + ::rtl::OUString( (&(".\n")[0]), ((sal_Int32
)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((rtl_TextEncoding
) 11)) ); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO), (
"jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1026" ": "), sal_detail_stream); } } } while (false)
1026 + OUSTR(" \n at: ") + path + OUSTR(".\n"))do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("Found JRE: ")[0]), ((sal_Int32)((sizeof ("Found JRE: "
) / sizeof (("Found JRE: ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + sResolvedDir + ::rtl::OUString( (&(" \n at: ")[0])
, ((sal_Int32)((sizeof (" \n at: ") / sizeof ((" \n at: ")[0]
))-1)), (((rtl_TextEncoding) 11)) ) + path + ::rtl::OUString(
(&(".\n")[0]), ((sal_Int32)((sizeof (".\n") / sizeof ((".\n"
)[0]))-1)), (((rtl_TextEncoding) 11)) )) == 1) { ::sal_detail_log
( (::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1026" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin"
".so" ": ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin"
".so" ": ") / sizeof (("[Java framework] sunjavaplugin" ".so"
": ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString
( (&("Found JRE: ")[0]), ((sal_Int32)((sizeof ("Found JRE: "
) / sizeof (("Found JRE: ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + sResolvedDir + ::rtl::OUString( (&(" \n at: ")[0])
, ((sal_Int32)((sizeof (" \n at: ") / sizeof ((" \n at: ")[0]
))-1)), (((rtl_TextEncoding) 11)) ) + path + ::rtl::OUString(
(&(".\n")[0]), ((sal_Int32)((sizeof (".\n") / sizeof ((".\n"
)[0]))-1)), (((rtl_TextEncoding) 11)) ))); } else { ::std::ostringstream
sal_detail_stream; sal_detail_stream << ::rtl::OUString
( (&("[Java framework] sunjavaplugin" ".so" ": ")[0]), ((
sal_Int32)((sizeof ("[Java framework] sunjavaplugin" ".so" ": "
) / sizeof (("[Java framework] sunjavaplugin" ".so" ": ")[0])
)-1)), (((rtl_TextEncoding) 11)) ) + ::rtl::OUString( (&(
"Found JRE: ")[0]), ((sal_Int32)((sizeof ("Found JRE: ") / sizeof
(("Found JRE: ")[0]))-1)), (((rtl_TextEncoding) 11)) ) + sResolvedDir
+ ::rtl::OUString( (&(" \n at: ")[0]), ((sal_Int32)((sizeof
(" \n at: ") / sizeof ((" \n at: ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + path + ::rtl::OUString( (&(".\n")[0]), ((sal_Int32
)((sizeof (".\n") / sizeof ((".\n")[0]))-1)), (((rtl_TextEncoding
) 11)) ); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO), (
"jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1026" ": "), sal_detail_stream); } } } while (false)
;
1027
1028 mapJREs.insert(MAPJRE::value_type(sResolvedDir, ret));
1029 mapJREs.insert(MAPJRE::value_type(sFilePath, ret));
1030 }
1031
1032 return ret;
1033}
1034
1035Reference<VendorBase> createInstance(createInstance_func pFunc,
1036 vector<pair<OUString, OUString> > properties)
1037{
1038
1039 Reference<VendorBase> aBase = (*pFunc)();
1040 if (aBase.is())
1041 {
1042 if (aBase->initialize(properties) == false)
1043 aBase = 0;
1044 }
1045 return aBase;
1046}
1047
1048inline OUString getDirFromFile(const OUString& usFilePath)
1049{
1050 sal_Int32 index= usFilePath.lastIndexOf('/');
1051 return OUString(usFilePath.getStr(), index);
1052}
1053
1054void createJavaInfoFromPath(vector<rtl::Reference<VendorBase> >& vecInfos)
1055{
1056// Get Java from PATH environment variable
1057 static OUString sCurDir(RTL_CONSTASCII_USTRINGPARAM(".")(&(".")[0]), ((sal_Int32)((sizeof (".") / sizeof ((".")[0
]))-1)), (((rtl_TextEncoding) 11))
);
1058 static OUString sParentDir(RTL_CONSTASCII_USTRINGPARAM("..")(&("..")[0]), ((sal_Int32)((sizeof ("..") / sizeof ((".."
)[0]))-1)), (((rtl_TextEncoding) 11))
);
1059 char *szPath= getenv("PATH");
1060 if(szPath)
1061 {
1062 OUString usAllPath(szPath, strlen(szPath), osl_getThreadTextEncoding());
1063 sal_Int32 nIndex = 0;
1064 do
1065 {
1066 OUString usToken = usAllPath.getToken( 0, SAL_PATHSEPARATOR':', nIndex );
1067 OUString usTokenUrl;
1068 if(File::getFileURLFromSystemPath(usToken, usTokenUrl) == File::E_None)
1069 {
1070 if(!usTokenUrl.isEmpty())
1071 {
1072 OUString usBin;
1073 // "."
1074 if(usTokenUrl.equals(sCurDir))
1075 {
1076 OUString usWorkDirUrl;
1077 if(osl_Process_E_None == osl_getProcessWorkingDir(&usWorkDirUrl.pData))
1078 usBin= usWorkDirUrl;
1079 }
1080 // ".."
1081 else if(usTokenUrl.equals(sParentDir))
1082 {
1083 OUString usWorkDir;
1084 if(osl_Process_E_None == osl_getProcessWorkingDir(&usWorkDir.pData))
1085 usBin= getDirFromFile(usWorkDir);
1086 }
1087 else
1088 {
1089 usBin = usTokenUrl;
1090 }
1091 if(!usBin.isEmpty())
1092 {
1093 getJREInfoFromBinPath(usBin, vecInfos);
1094 }
1095 }
1096 }
1097 }
1098 while ( nIndex >= 0 );
1099 }
1100}
1101
1102void createJavaInfoFromJavaHome(vector<rtl::Reference<VendorBase> >& vecInfos)
1103{
1104 // Get Java from JAVA_HOME environment
1105 char *szJavaHome= getenv("JAVA_HOME");
1106 if(szJavaHome)
1107 {
1108 OUString sHome(szJavaHome,strlen(szJavaHome),osl_getThreadTextEncoding());
1109 OUString sHomeUrl;
1110 if(File::getFileURLFromSystemPath(sHome, sHomeUrl) == File::E_None)
1111 {
1112 getJREInfoByPath(sHomeUrl, vecInfos);
1113 }
1114 }
1115}
1116
1117bool makeDriveLetterSame(OUString * fileURL)
1118{
1119 bool ret = false;
1120 DirectoryItem item;
1121 if (DirectoryItem::get(*fileURL, item) == File::E_None)
1122 {
1123 FileStatus status(osl_FileStatus_Mask_FileURL0x00000200);
1124 if (item.getFileStatus(status) == File::E_None)
1125 {
1126 *fileURL = status.getFileURL();
1127 ret = true;
1128 }
1129 }
1130 return ret;
1131}
1132
1133#ifdef UNX1
1134#ifdef SOLARIS
1135
1136void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos)
1137{
1138 JFW_TRACE2(OUSTR("\n[Java framework] Checking \"/usr/jdk/latest\"\n"))do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("\n[Java framework] Checking \"/usr/jdk/latest\"\n"
)[0]), ((sal_Int32)((sizeof ("\n[Java framework] Checking \"/usr/jdk/latest\"\n"
) / sizeof (("\n[Java framework] Checking \"/usr/jdk/latest\"\n"
)[0]))-1)), (((rtl_TextEncoding) 11)) )) == 1) { ::sal_detail_log
( (::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1138" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << ::rtl::OUString( (&("\n[Java framework] Checking \"/usr/jdk/latest\"\n"
)[0]), ((sal_Int32)((sizeof ("\n[Java framework] Checking \"/usr/jdk/latest\"\n"
) / sizeof (("\n[Java framework] Checking \"/usr/jdk/latest\"\n"
)[0]))-1)), (((rtl_TextEncoding) 11)) ))); } else { ::std::ostringstream
sal_detail_stream; sal_detail_stream << ::rtl::OUString
( (&("\n[Java framework] Checking \"/usr/jdk/latest\"\n")
[0]), ((sal_Int32)((sizeof ("\n[Java framework] Checking \"/usr/jdk/latest\"\n"
) / sizeof (("\n[Java framework] Checking \"/usr/jdk/latest\"\n"
)[0]))-1)), (((rtl_TextEncoding) 11)) ); ::sal::detail::log( (
::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1138" ": "), sal_detail_stream); } } } while (false)
;
1139 getJREInfoByPath(OUSTR("file:////usr/jdk/latest")::rtl::OUString( (&("file:////usr/jdk/latest")[0]), ((sal_Int32
)((sizeof ("file:////usr/jdk/latest") / sizeof (("file:////usr/jdk/latest"
)[0]))-1)), (((rtl_TextEncoding) 11)) )
, vecInfos);
1140}
1141
1142#else
1143void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos)
1144{
1145 OUString excMessage = OUSTR("[Java framework] sunjavaplugin: "::rtl::OUString( (&("[Java framework] sunjavaplugin: " "Error in function createJavaInfoDirScan in util.cxx."
)[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Error in function createJavaInfoDirScan in util.cxx.") / sizeof
(("[Java framework] sunjavaplugin: " "Error in function createJavaInfoDirScan in util.cxx."
)[0]))-1)), (((rtl_TextEncoding) 11)) )
1146 "Error in function createJavaInfoDirScan in util.cxx.")::rtl::OUString( (&("[Java framework] sunjavaplugin: " "Error in function createJavaInfoDirScan in util.cxx."
)[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Error in function createJavaInfoDirScan in util.cxx.") / sizeof
(("[Java framework] sunjavaplugin: " "Error in function createJavaInfoDirScan in util.cxx."
)[0]))-1)), (((rtl_TextEncoding) 11)) )
;
1147 int cJavaNames= sizeof(g_arJavaNames) / sizeof(char*);
1148 boost::scoped_array<OUString> sarJavaNames(new OUString[cJavaNames]);
1149 OUString *arNames = sarJavaNames.get();
1150 for(int i= 0; i < cJavaNames; i++)
1151 arNames[i] = OUString(g_arJavaNames[i], strlen(g_arJavaNames[i]),
1152 RTL_TEXTENCODING_UTF8(((rtl_TextEncoding) 76)));
1153
1154 int cSearchPaths= sizeof(g_arSearchPaths) / sizeof(char*);
1155 boost::scoped_array<OUString> sarPathNames(new OUString[cSearchPaths]);
1156 OUString *arPaths = sarPathNames.get();
1157 for(int c = 0; c < cSearchPaths; c++)
1158 arPaths[c] = OUString(g_arSearchPaths[c], strlen(g_arSearchPaths[c]),
1159 RTL_TEXTENCODING_UTF8(((rtl_TextEncoding) 76)));
1160
1161 int cCollectDirs = sizeof(g_arCollectDirs) / sizeof(char*);
1162 boost::scoped_array<OUString> sarCollectDirs(new OUString[cCollectDirs]);
1163 OUString *arCollectDirs = sarCollectDirs.get();
1164 for(int d = 0; d < cCollectDirs; d++)
1165 arCollectDirs[d] = OUString(g_arCollectDirs[d], strlen(g_arCollectDirs[d]),
1166 RTL_TEXTENCODING_UTF8(((rtl_TextEncoding) 76)));
1167
1168
1169
1170 OUString usFile(RTL_CONSTASCII_USTRINGPARAM("file:///")(&("file:///")[0]), ((sal_Int32)((sizeof ("file:///") / sizeof
(("file:///")[0]))-1)), (((rtl_TextEncoding) 11))
);
1171 for( int ii = 0; ii < cSearchPaths; ii ++)
1172 {
1173 OUString usDir1(usFile + arPaths[ii]);
1174 DirectoryItem item;
1175 if(DirectoryItem::get(usDir1, item) == File::E_None)
1176 {
1177 for(int j= 0; j < cCollectDirs; j++)
1178 {
1179 OUString usDir2(usDir1 + arCollectDirs[j]);
1180 // prevent that we scan the whole /usr, /usr/lib, etc directories
1181 if (!arCollectDirs[j].isEmpty())
1182 {
1183 //usr/java/xxx
1184 //Examin every subdirectory
1185 Directory aCollectionDir(usDir2);
1186
1187 Directory::RC openErr = aCollectionDir.open();
1188 switch (openErr)
1189 {
1190 case File::E_None:
1191 break;
1192 case File::E_NOENT:
1193 case File::E_NOTDIR:
1194 continue;
1195 case File::E_ACCES:
1196 JFW_TRACE2(OUSTR("[Java framework] sunjavaplugin: "do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Could not read directory ") / sizeof (("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + usDir2 + ::rtl::OUString( (&(" because of missing access rights."
)[0]), ((sal_Int32)((sizeof (" because of missing access rights."
) / sizeof ((" because of missing access rights.")[0]))-1)), (
((rtl_TextEncoding) 11)) )) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1198" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Could not read directory ") / sizeof (("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + usDir2 + ::rtl::OUString( (&(" because of missing access rights."
)[0]), ((sal_Int32)((sizeof (" because of missing access rights."
) / sizeof ((" because of missing access rights.")[0]))-1)), (
((rtl_TextEncoding) 11)) ))); } else { ::std::ostringstream sal_detail_stream
; sal_detail_stream << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Could not read directory ") / sizeof (("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + usDir2 + ::rtl::OUString( (&(" because of missing access rights."
)[0]), ((sal_Int32)((sizeof (" because of missing access rights."
) / sizeof ((" because of missing access rights.")[0]))-1)), (
((rtl_TextEncoding) 11)) ); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1198" ": "), sal_detail_stream); } } } while (false)
1197 "Could not read directory ") + usDir2 +do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Could not read directory ") / sizeof (("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + usDir2 + ::rtl::OUString( (&(" because of missing access rights."
)[0]), ((sal_Int32)((sizeof (" because of missing access rights."
) / sizeof ((" because of missing access rights.")[0]))-1)), (
((rtl_TextEncoding) 11)) )) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1198" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Could not read directory ") / sizeof (("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + usDir2 + ::rtl::OUString( (&(" because of missing access rights."
)[0]), ((sal_Int32)((sizeof (" because of missing access rights."
) / sizeof ((" because of missing access rights.")[0]))-1)), (
((rtl_TextEncoding) 11)) ))); } else { ::std::ostringstream sal_detail_stream
; sal_detail_stream << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Could not read directory ") / sizeof (("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + usDir2 + ::rtl::OUString( (&(" because of missing access rights."
)[0]), ((sal_Int32)((sizeof (" because of missing access rights."
) / sizeof ((" because of missing access rights.")[0]))-1)), (
((rtl_TextEncoding) 11)) ); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1198" ": "), sal_detail_stream); } } } while (false)
1198 OUSTR(" because of missing access rights."))do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Could not read directory ") / sizeof (("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + usDir2 + ::rtl::OUString( (&(" because of missing access rights."
)[0]), ((sal_Int32)((sizeof (" because of missing access rights."
) / sizeof ((" because of missing access rights.")[0]))-1)), (
((rtl_TextEncoding) 11)) )) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1198" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Could not read directory ") / sizeof (("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + usDir2 + ::rtl::OUString( (&(" because of missing access rights."
)[0]), ((sal_Int32)((sizeof (" because of missing access rights."
) / sizeof ((" because of missing access rights.")[0]))-1)), (
((rtl_TextEncoding) 11)) ))); } else { ::std::ostringstream sal_detail_stream
; sal_detail_stream << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Could not read directory ") / sizeof (("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + usDir2 + ::rtl::OUString( (&(" because of missing access rights."
)[0]), ((sal_Int32)((sizeof (" because of missing access rights."
) / sizeof ((" because of missing access rights.")[0]))-1)), (
((rtl_TextEncoding) 11)) ); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1198" ": "), sal_detail_stream); } } } while (false)
;
1199 continue;
1200 default:
1201 JFW_TRACE2(OUSTR("[Java framework] sunjavaplugin: "do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Could not read directory ") / sizeof (("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + usDir2 + ::rtl::OUString( (&(". Osl file error: ")
[0]), ((sal_Int32)((sizeof (". Osl file error: ") / sizeof ((
". Osl file error: ")[0]))-1)), (((rtl_TextEncoding) 11)) ) +
OUString::valueOf((sal_Int32) openErr)) == 1) { ::sal_detail_log
( (::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1204" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Could not read directory ") / sizeof (("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + usDir2 + ::rtl::OUString( (&(". Osl file error: ")
[0]), ((sal_Int32)((sizeof (". Osl file error: ") / sizeof ((
". Osl file error: ")[0]))-1)), (((rtl_TextEncoding) 11)) ) +
OUString::valueOf((sal_Int32) openErr))); } else { ::std::ostringstream
sal_detail_stream; sal_detail_stream << ::rtl::OUString
( (&("[Java framework] sunjavaplugin: " "Could not read directory "
)[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Could not read directory ") / sizeof (("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + usDir2 + ::rtl::OUString( (&(". Osl file error: ")
[0]), ((sal_Int32)((sizeof (". Osl file error: ") / sizeof ((
". Osl file error: ")[0]))-1)), (((rtl_TextEncoding) 11)) ) +
OUString::valueOf((sal_Int32) openErr); ::sal::detail::log( (
::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1204" ": "), sal_detail_stream); } } } while (false)
1202 "Could not read directory ")do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Could not read directory ") / sizeof (("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + usDir2 + ::rtl::OUString( (&(". Osl file error: ")
[0]), ((sal_Int32)((sizeof (". Osl file error: ") / sizeof ((
". Osl file error: ")[0]))-1)), (((rtl_TextEncoding) 11)) ) +
OUString::valueOf((sal_Int32) openErr)) == 1) { ::sal_detail_log
( (::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1204" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Could not read directory ") / sizeof (("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + usDir2 + ::rtl::OUString( (&(". Osl file error: ")
[0]), ((sal_Int32)((sizeof (". Osl file error: ") / sizeof ((
". Osl file error: ")[0]))-1)), (((rtl_TextEncoding) 11)) ) +
OUString::valueOf((sal_Int32) openErr))); } else { ::std::ostringstream
sal_detail_stream; sal_detail_stream << ::rtl::OUString
( (&("[Java framework] sunjavaplugin: " "Could not read directory "
)[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Could not read directory ") / sizeof (("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + usDir2 + ::rtl::OUString( (&(". Osl file error: ")
[0]), ((sal_Int32)((sizeof (". Osl file error: ") / sizeof ((
". Osl file error: ")[0]))-1)), (((rtl_TextEncoding) 11)) ) +
OUString::valueOf((sal_Int32) openErr); ::sal::detail::log( (
::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1204" ": "), sal_detail_stream); } } } while (false)
1203 + usDir2 + OUSTR(". Osl file error: ")do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Could not read directory ") / sizeof (("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + usDir2 + ::rtl::OUString( (&(". Osl file error: ")
[0]), ((sal_Int32)((sizeof (". Osl file error: ") / sizeof ((
". Osl file error: ")[0]))-1)), (((rtl_TextEncoding) 11)) ) +
OUString::valueOf((sal_Int32) openErr)) == 1) { ::sal_detail_log
( (::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1204" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Could not read directory ") / sizeof (("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + usDir2 + ::rtl::OUString( (&(". Osl file error: ")
[0]), ((sal_Int32)((sizeof (". Osl file error: ") / sizeof ((
". Osl file error: ")[0]))-1)), (((rtl_TextEncoding) 11)) ) +
OUString::valueOf((sal_Int32) openErr))); } else { ::std::ostringstream
sal_detail_stream; sal_detail_stream << ::rtl::OUString
( (&("[Java framework] sunjavaplugin: " "Could not read directory "
)[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Could not read directory ") / sizeof (("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + usDir2 + ::rtl::OUString( (&(". Osl file error: ")
[0]), ((sal_Int32)((sizeof (". Osl file error: ") / sizeof ((
". Osl file error: ")[0]))-1)), (((rtl_TextEncoding) 11)) ) +
OUString::valueOf((sal_Int32) openErr); ::sal::detail::log( (
::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1204" ": "), sal_detail_stream); } } } while (false)
1204 + OUString::valueOf((sal_Int32) openErr))do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Could not read directory ") / sizeof (("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + usDir2 + ::rtl::OUString( (&(". Osl file error: ")
[0]), ((sal_Int32)((sizeof (". Osl file error: ") / sizeof ((
". Osl file error: ")[0]))-1)), (((rtl_TextEncoding) 11)) ) +
OUString::valueOf((sal_Int32) openErr)) == 1) { ::sal_detail_log
( (::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1204" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Could not read directory ") / sizeof (("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + usDir2 + ::rtl::OUString( (&(". Osl file error: ")
[0]), ((sal_Int32)((sizeof (". Osl file error: ") / sizeof ((
". Osl file error: ")[0]))-1)), (((rtl_TextEncoding) 11)) ) +
OUString::valueOf((sal_Int32) openErr))); } else { ::std::ostringstream
sal_detail_stream; sal_detail_stream << ::rtl::OUString
( (&("[Java framework] sunjavaplugin: " "Could not read directory "
)[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Could not read directory ") / sizeof (("[Java framework] sunjavaplugin: "
"Could not read directory ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + usDir2 + ::rtl::OUString( (&(". Osl file error: ")
[0]), ((sal_Int32)((sizeof (". Osl file error: ") / sizeof ((
". Osl file error: ")[0]))-1)), (((rtl_TextEncoding) 11)) ) +
OUString::valueOf((sal_Int32) openErr); ::sal::detail::log( (
::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1204" ": "), sal_detail_stream); } } } while (false)
;
1205 continue;
1206 }
1207
1208 DirectoryItem curIt;
1209 File::RC errNext = File::E_None;
1210 while( (errNext = aCollectionDir.getNextItem(curIt)) == File::E_None)
1211 {
1212 FileStatus aStatus(osl_FileStatus_Mask_FileURL0x00000200);
1213 File::RC errStatus = File::E_None;
1214 if ((errStatus = curIt.getFileStatus(aStatus)) != File::E_None)
1215 {
1216 JFW_TRACE2(excMessage + OUSTR("getFileStatus failed with error ")do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << excMessage + ::rtl::OUString( (
&("getFileStatus failed with error ")[0]), ((sal_Int32)((
sizeof ("getFileStatus failed with error ") / sizeof (("getFileStatus failed with error "
)[0]))-1)), (((rtl_TextEncoding) 11)) ) + OUString::valueOf((
sal_Int32) errStatus)) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1217" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << excMessage + ::rtl::OUString( (&
("getFileStatus failed with error ")[0]), ((sal_Int32)((sizeof
("getFileStatus failed with error ") / sizeof (("getFileStatus failed with error "
)[0]))-1)), (((rtl_TextEncoding) 11)) ) + OUString::valueOf((
sal_Int32) errStatus))); } else { ::std::ostringstream sal_detail_stream
; sal_detail_stream << excMessage + ::rtl::OUString( (&
("getFileStatus failed with error ")[0]), ((sal_Int32)((sizeof
("getFileStatus failed with error ") / sizeof (("getFileStatus failed with error "
)[0]))-1)), (((rtl_TextEncoding) 11)) ) + OUString::valueOf((
sal_Int32) errStatus); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1217" ": "), sal_detail_stream); } } } while (false)
1217 + OUString::valueOf((sal_Int32) errStatus))do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << excMessage + ::rtl::OUString( (
&("getFileStatus failed with error ")[0]), ((sal_Int32)((
sizeof ("getFileStatus failed with error ") / sizeof (("getFileStatus failed with error "
)[0]))-1)), (((rtl_TextEncoding) 11)) ) + OUString::valueOf((
sal_Int32) errStatus)) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1217" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << excMessage + ::rtl::OUString( (&
("getFileStatus failed with error ")[0]), ((sal_Int32)((sizeof
("getFileStatus failed with error ") / sizeof (("getFileStatus failed with error "
)[0]))-1)), (((rtl_TextEncoding) 11)) ) + OUString::valueOf((
sal_Int32) errStatus))); } else { ::std::ostringstream sal_detail_stream
; sal_detail_stream << excMessage + ::rtl::OUString( (&
("getFileStatus failed with error ")[0]), ((sal_Int32)((sizeof
("getFileStatus failed with error ") / sizeof (("getFileStatus failed with error "
)[0]))-1)), (((rtl_TextEncoding) 11)) ) + OUString::valueOf((
sal_Int32) errStatus); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO
), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1217" ": "), sal_detail_stream); } } } while (false)
;
1218 continue;
1219 }
1220 JFW_TRACE2(OUSTR("[Java framework] sunjavaplugin: "do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Checking if directory: ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Checking if directory: ") / sizeof (("[Java framework] sunjavaplugin: "
"Checking if directory: ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + aStatus.getFileURL() + ::rtl::OUString( (&(" is a Java. \n"
)[0]), ((sal_Int32)((sizeof (" is a Java. \n") / sizeof ((" is a Java. \n"
)[0]))-1)), (((rtl_TextEncoding) 11)) )) == 1) { ::sal_detail_log
( (::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1222" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Checking if directory: ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Checking if directory: ") / sizeof (("[Java framework] sunjavaplugin: "
"Checking if directory: ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + aStatus.getFileURL() + ::rtl::OUString( (&(" is a Java. \n"
)[0]), ((sal_Int32)((sizeof (" is a Java. \n") / sizeof ((" is a Java. \n"
)[0]))-1)), (((rtl_TextEncoding) 11)) ))); } else { ::std::ostringstream
sal_detail_stream; sal_detail_stream << ::rtl::OUString
( (&("[Java framework] sunjavaplugin: " "Checking if directory: "
)[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Checking if directory: ") / sizeof (("[Java framework] sunjavaplugin: "
"Checking if directory: ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + aStatus.getFileURL() + ::rtl::OUString( (&(" is a Java. \n"
)[0]), ((sal_Int32)((sizeof (" is a Java. \n") / sizeof ((" is a Java. \n"
)[0]))-1)), (((rtl_TextEncoding) 11)) ); ::sal::detail::log( (
::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1222" ": "), sal_detail_stream); } } } while (false)
1221 "Checking if directory: ") + aStatus.getFileURL() +do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Checking if directory: ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Checking if directory: ") / sizeof (("[Java framework] sunjavaplugin: "
"Checking if directory: ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + aStatus.getFileURL() + ::rtl::OUString( (&(" is a Java. \n"
)[0]), ((sal_Int32)((sizeof (" is a Java. \n") / sizeof ((" is a Java. \n"
)[0]))-1)), (((rtl_TextEncoding) 11)) )) == 1) { ::sal_detail_log
( (::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1222" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Checking if directory: ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Checking if directory: ") / sizeof (("[Java framework] sunjavaplugin: "
"Checking if directory: ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + aStatus.getFileURL() + ::rtl::OUString( (&(" is a Java. \n"
)[0]), ((sal_Int32)((sizeof (" is a Java. \n") / sizeof ((" is a Java. \n"
)[0]))-1)), (((rtl_TextEncoding) 11)) ))); } else { ::std::ostringstream
sal_detail_stream; sal_detail_stream << ::rtl::OUString
( (&("[Java framework] sunjavaplugin: " "Checking if directory: "
)[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Checking if directory: ") / sizeof (("[Java framework] sunjavaplugin: "
"Checking if directory: ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + aStatus.getFileURL() + ::rtl::OUString( (&(" is a Java. \n"
)[0]), ((sal_Int32)((sizeof (" is a Java. \n") / sizeof ((" is a Java. \n"
)[0]))-1)), (((rtl_TextEncoding) 11)) ); ::sal::detail::log( (
::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1222" ": "), sal_detail_stream); } } } while (false)
1222 OUSTR(" is a Java. \n"))do { if (true) { if (sizeof ::sal::detail::getResult( ::sal::
detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Checking if directory: ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Checking if directory: ") / sizeof (("[Java framework] sunjavaplugin: "
"Checking if directory: ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + aStatus.getFileURL() + ::rtl::OUString( (&(" is a Java. \n"
)[0]), ((sal_Int32)((sizeof (" is a Java. \n") / sizeof ((" is a Java. \n"
)[0]))-1)), (((rtl_TextEncoding) 11)) )) == 1) { ::sal_detail_log
( (::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1222" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Checking if directory: ")[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Checking if directory: ") / sizeof (("[Java framework] sunjavaplugin: "
"Checking if directory: ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + aStatus.getFileURL() + ::rtl::OUString( (&(" is a Java. \n"
)[0]), ((sal_Int32)((sizeof (" is a Java. \n") / sizeof ((" is a Java. \n"
)[0]))-1)), (((rtl_TextEncoding) 11)) ))); } else { ::std::ostringstream
sal_detail_stream; sal_detail_stream << ::rtl::OUString
( (&("[Java framework] sunjavaplugin: " "Checking if directory: "
)[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Checking if directory: ") / sizeof (("[Java framework] sunjavaplugin: "
"Checking if directory: ")[0]))-1)), (((rtl_TextEncoding) 11
)) ) + aStatus.getFileURL() + ::rtl::OUString( (&(" is a Java. \n"
)[0]), ((sal_Int32)((sizeof (" is a Java. \n") / sizeof ((" is a Java. \n"
)[0]))-1)), (((rtl_TextEncoding) 11)) ); ::sal::detail::log( (
::SAL_DETAIL_LOG_LEVEL_INFO), ("jfw.level2"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1222" ": "), sal_detail_stream); } } } while (false)
;
1223
1224 getJREInfoByPath(aStatus.getFileURL(),vecInfos);
1225 }
1226
1227 JFW_ENSURE(errNext == File::E_None || errNext == File::E_NOENT,do { if (true && (!(errNext == File::E_None || errNext
== File::E_NOENT))) { if (sizeof ::sal::detail::getResult( ::
sal::detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Error while iterating over contens of ")[0]), ((sal_Int32)(
(sizeof ("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
) / sizeof (("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
)[0]))-1)), (((rtl_TextEncoding) 11)) ) + usDir2 + ::rtl::OUString
( (&(". Osl file error: ")[0]), ((sal_Int32)((sizeof (". Osl file error: "
) / sizeof ((". Osl file error: ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + OUString::valueOf((sal_Int32) openErr)) == 1) { ::
sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_WARN), ("jfw"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1231" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Error while iterating over contens of ")[0]), ((sal_Int32)(
(sizeof ("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
) / sizeof (("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
)[0]))-1)), (((rtl_TextEncoding) 11)) ) + usDir2 + ::rtl::OUString
( (&(". Osl file error: ")[0]), ((sal_Int32)((sizeof (". Osl file error: "
) / sizeof ((". Osl file error: ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + OUString::valueOf((sal_Int32) openErr))); } else {
::std::ostringstream sal_detail_stream; sal_detail_stream <<
::rtl::OUString( (&("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
)[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Error while iterating over contens of ") / sizeof (("[Java framework] sunjavaplugin: "
"Error while iterating over contens of ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + usDir2 + ::rtl::OUString( (&(". Osl file error: "
)[0]), ((sal_Int32)((sizeof (". Osl file error: ") / sizeof (
(". Osl file error: ")[0]))-1)), (((rtl_TextEncoding) 11)) ) +
OUString::valueOf((sal_Int32) openErr); ::sal::detail::log( (
::SAL_DETAIL_LOG_LEVEL_WARN), ("jfw"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1231" ": "), sal_detail_stream); } } } while (false)
1228 OUSTR("[Java framework] sunjavaplugin: "do { if (true && (!(errNext == File::E_None || errNext
== File::E_NOENT))) { if (sizeof ::sal::detail::getResult( ::
sal::detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Error while iterating over contens of ")[0]), ((sal_Int32)(
(sizeof ("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
) / sizeof (("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
)[0]))-1)), (((rtl_TextEncoding) 11)) ) + usDir2 + ::rtl::OUString
( (&(". Osl file error: ")[0]), ((sal_Int32)((sizeof (". Osl file error: "
) / sizeof ((". Osl file error: ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + OUString::valueOf((sal_Int32) openErr)) == 1) { ::
sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_WARN), ("jfw"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1231" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Error while iterating over contens of ")[0]), ((sal_Int32)(
(sizeof ("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
) / sizeof (("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
)[0]))-1)), (((rtl_TextEncoding) 11)) ) + usDir2 + ::rtl::OUString
( (&(". Osl file error: ")[0]), ((sal_Int32)((sizeof (". Osl file error: "
) / sizeof ((". Osl file error: ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + OUString::valueOf((sal_Int32) openErr))); } else {
::std::ostringstream sal_detail_stream; sal_detail_stream <<
::rtl::OUString( (&("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
)[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Error while iterating over contens of ") / sizeof (("[Java framework] sunjavaplugin: "
"Error while iterating over contens of ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + usDir2 + ::rtl::OUString( (&(". Osl file error: "
)[0]), ((sal_Int32)((sizeof (". Osl file error: ") / sizeof (
(". Osl file error: ")[0]))-1)), (((rtl_TextEncoding) 11)) ) +
OUString::valueOf((sal_Int32) openErr); ::sal::detail::log( (
::SAL_DETAIL_LOG_LEVEL_WARN), ("jfw"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1231" ": "), sal_detail_stream); } } } while (false)
1229 "Error while iterating over contens of ")do { if (true && (!(errNext == File::E_None || errNext
== File::E_NOENT))) { if (sizeof ::sal::detail::getResult( ::
sal::detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Error while iterating over contens of ")[0]), ((sal_Int32)(
(sizeof ("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
) / sizeof (("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
)[0]))-1)), (((rtl_TextEncoding) 11)) ) + usDir2 + ::rtl::OUString
( (&(". Osl file error: ")[0]), ((sal_Int32)((sizeof (". Osl file error: "
) / sizeof ((". Osl file error: ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + OUString::valueOf((sal_Int32) openErr)) == 1) { ::
sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_WARN), ("jfw"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1231" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Error while iterating over contens of ")[0]), ((sal_Int32)(
(sizeof ("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
) / sizeof (("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
)[0]))-1)), (((rtl_TextEncoding) 11)) ) + usDir2 + ::rtl::OUString
( (&(". Osl file error: ")[0]), ((sal_Int32)((sizeof (". Osl file error: "
) / sizeof ((". Osl file error: ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + OUString::valueOf((sal_Int32) openErr))); } else {
::std::ostringstream sal_detail_stream; sal_detail_stream <<
::rtl::OUString( (&("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
)[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Error while iterating over contens of ") / sizeof (("[Java framework] sunjavaplugin: "
"Error while iterating over contens of ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + usDir2 + ::rtl::OUString( (&(". Osl file error: "
)[0]), ((sal_Int32)((sizeof (". Osl file error: ") / sizeof (
(". Osl file error: ")[0]))-1)), (((rtl_TextEncoding) 11)) ) +
OUString::valueOf((sal_Int32) openErr); ::sal::detail::log( (
::SAL_DETAIL_LOG_LEVEL_WARN), ("jfw"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1231" ": "), sal_detail_stream); } } } while (false)
1230 + usDir2 + OUSTR(". Osl file error: ")do { if (true && (!(errNext == File::E_None || errNext
== File::E_NOENT))) { if (sizeof ::sal::detail::getResult( ::
sal::detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Error while iterating over contens of ")[0]), ((sal_Int32)(
(sizeof ("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
) / sizeof (("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
)[0]))-1)), (((rtl_TextEncoding) 11)) ) + usDir2 + ::rtl::OUString
( (&(". Osl file error: ")[0]), ((sal_Int32)((sizeof (". Osl file error: "
) / sizeof ((". Osl file error: ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + OUString::valueOf((sal_Int32) openErr)) == 1) { ::
sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_WARN), ("jfw"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1231" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Error while iterating over contens of ")[0]), ((sal_Int32)(
(sizeof ("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
) / sizeof (("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
)[0]))-1)), (((rtl_TextEncoding) 11)) ) + usDir2 + ::rtl::OUString
( (&(". Osl file error: ")[0]), ((sal_Int32)((sizeof (". Osl file error: "
) / sizeof ((". Osl file error: ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + OUString::valueOf((sal_Int32) openErr))); } else {
::std::ostringstream sal_detail_stream; sal_detail_stream <<
::rtl::OUString( (&("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
)[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Error while iterating over contens of ") / sizeof (("[Java framework] sunjavaplugin: "
"Error while iterating over contens of ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + usDir2 + ::rtl::OUString( (&(". Osl file error: "
)[0]), ((sal_Int32)((sizeof (". Osl file error: ") / sizeof (
(". Osl file error: ")[0]))-1)), (((rtl_TextEncoding) 11)) ) +
OUString::valueOf((sal_Int32) openErr); ::sal::detail::log( (
::SAL_DETAIL_LOG_LEVEL_WARN), ("jfw"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1231" ": "), sal_detail_stream); } } } while (false)
1231 + OUString::valueOf((sal_Int32) openErr))do { if (true && (!(errNext == File::E_None || errNext
== File::E_NOENT))) { if (sizeof ::sal::detail::getResult( ::
sal::detail::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Error while iterating over contens of ")[0]), ((sal_Int32)(
(sizeof ("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
) / sizeof (("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
)[0]))-1)), (((rtl_TextEncoding) 11)) ) + usDir2 + ::rtl::OUString
( (&(". Osl file error: ")[0]), ((sal_Int32)((sizeof (". Osl file error: "
) / sizeof ((". Osl file error: ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + OUString::valueOf((sal_Int32) openErr)) == 1) { ::
sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_WARN), ("jfw"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1231" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << ::rtl::OUString( (&("[Java framework] sunjavaplugin: "
"Error while iterating over contens of ")[0]), ((sal_Int32)(
(sizeof ("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
) / sizeof (("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
)[0]))-1)), (((rtl_TextEncoding) 11)) ) + usDir2 + ::rtl::OUString
( (&(". Osl file error: ")[0]), ((sal_Int32)((sizeof (". Osl file error: "
) / sizeof ((". Osl file error: ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + OUString::valueOf((sal_Int32) openErr))); } else {
::std::ostringstream sal_detail_stream; sal_detail_stream <<
::rtl::OUString( (&("[Java framework] sunjavaplugin: " "Error while iterating over contens of "
)[0]), ((sal_Int32)((sizeof ("[Java framework] sunjavaplugin: "
"Error while iterating over contens of ") / sizeof (("[Java framework] sunjavaplugin: "
"Error while iterating over contens of ")[0]))-1)), (((rtl_TextEncoding
) 11)) ) + usDir2 + ::rtl::OUString( (&(". Osl file error: "
)[0]), ((sal_Int32)((sizeof (". Osl file error: ") / sizeof (
(". Osl file error: ")[0]))-1)), (((rtl_TextEncoding) 11)) ) +
OUString::valueOf((sal_Int32) openErr); ::sal::detail::log( (
::SAL_DETAIL_LOG_LEVEL_WARN), ("jfw"), ("/usr/local/src/libreoffice/jvmfwk/plugins/sunmajor/pluginlib/util.cxx"
":" "1231" ": "), sal_detail_stream); } } } while (false)
;
1232 }
1233 else
1234 {
1235 //usr/java
1236 //When we look directly into a dir like /usr, /usr/lib, etc. then we only
1237 //look for certain java directories, such as jre, jdk, etc. Whe do not want
1238 //to examine the whole directory because of performance reasons.
1239 DirectoryItem item2;
1240 if(DirectoryItem::get(usDir2, item2) == File::E_None)
1241 {
1242 for( int k= 0; k < cJavaNames; k++)
1243 {
1244 // /usr/java/j2re1.4.0
1245 OUString usDir3(usDir2 + arNames[k]);
1246
1247 DirectoryItem item3;
1248 if(DirectoryItem::get(usDir3, item) == File::E_None)
1249 {
1250 //remove trailing '/'
1251 sal_Int32 islash = usDir3.lastIndexOf('/');
1252 if (islash == usDir3.getLength() - 1
1253 && (islash
1254 > RTL_CONSTASCII_LENGTH("file://")((sal_Int32)((sizeof ("file://") / sizeof (("file://")[0]))-1
))
))
1255 usDir3 = usDir3.copy(0, islash);
1256 getJREInfoByPath(usDir3,vecInfos);
1257 }
1258 }
1259 }
1260 }
1261 }
1262 }
1263 }
1264}
1265#endif // ifdef SOLARIS
1266#endif // ifdef UNX
1267}
1268
1269/* vim:set shiftwidth=4 softtabstop=4 expandtab: */