Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
abba18cc
Kaydet (Commit)
abba18cc
authored
Kas 09, 2004
tarafından
Jens-Heiner Rechtien
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
INTEGRATION: CWS jl13 (1.14.24); FILE MERGED
2004/09/30 15:34:59 jl 1.14.24.1: #i29390# some cleanup
üst
824996f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
229 deletions
+5
-229
jvmargs.cxx
stoc/source/javavm/jvmargs.cxx
+5
-229
No files found.
stoc/source/javavm/jvmargs.cxx
Dosyayı görüntüle @
abba18cc
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
*
*
* $RCSfile: jvmargs.cxx,v $
* $RCSfile: jvmargs.cxx,v $
*
*
* $Revision: 1.1
4
$
* $Revision: 1.1
5
$
*
*
* last change: $Author:
obo $ $Date: 2004-06-01 09:04:23
$
* last change: $Author:
hr $ $Date: 2004-11-09 13:53:51
$
*
*
* The Contents of this file are made available subject to the terms of
* The Contents of this file are made available subject to the terms of
* either of the following licenses
* either of the following licenses
...
@@ -59,32 +59,14 @@
...
@@ -59,32 +59,14 @@
*
*
************************************************************************/
************************************************************************/
#ifdef UNIX
#define CLASSPATH_DELIMETER ":"
#else
#define CLASSPATH_DELIMETER ";"
#endif
#include <string.h>
#include "jvmargs.hxx"
#include "jvmargs.hxx"
#include "com/sun/star/uno/Exception.hpp"
#include "rtl/bootstrap.hxx"
#include <osl/diagnose.h>
#include <osl/thread.h>
#include "osl/file.h"
#include "osl/file.hxx"
#include <rtl/ustring.hxx>
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
#define OUSTR(x) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( x ))
#define OUSTR(x) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( x ))
using
namespace
rtl
;
using
namespace
rtl
;
namespace
css
=
com
::
sun
::
star
;
namespace
stoc_javavm
{
namespace
stoc_javavm
{
JVM
::
JVM
()
throw
()
//: _enabled(sal_False)
JVM
::
JVM
()
throw
()
//: _enabled(sal_False)
...
@@ -98,30 +80,7 @@ void JVM::pushProp(const OUString & property)
...
@@ -98,30 +80,7 @@ void JVM::pushProp(const OUString & property)
{
{
OUString
left
=
property
.
copy
(
0
,
index
).
trim
();
OUString
left
=
property
.
copy
(
0
,
index
).
trim
();
OUString
right
(
property
.
copy
(
index
+
1
).
trim
());
OUString
right
(
property
.
copy
(
index
+
1
).
trim
());
_props
.
push_back
(
property
);
// if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("Enable"))))
// {
// setEnabled(right.toInt32());
// }
// else
if
(
left
.
equals
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Version"
))))
{
setVersion
(
right
);
}
else
if
(
left
.
equals
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Home"
))))
{
setJavaHome
(
right
);
}
else
if
(
left
.
equals
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"ApplicationClassesDir"
))))
{
setApplicationClassesDir
(
right
);
}
else
if
(
left
.
equals
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"RuntimeLib"
))))
{
setRuntimeLib
(
right
);
}
else
_props
.
push_back
(
property
);
}
}
else
else
{
// no '=', could be -X
{
// no '=', could be -X
...
@@ -129,193 +88,10 @@ void JVM::pushProp(const OUString & property)
...
@@ -129,193 +88,10 @@ void JVM::pushProp(const OUString & property)
}
}
}
}
void
JVM
::
setApplicationClassesDir
(
const
rtl
::
OUString
&
sDir
)
{
rtl
::
OUString
sPaths
=
buildClassPathFromDirectory
(
sDir
);
addClassPath
(
sPaths
);
}
/** The path has the form: foo/bar
That is, separator is a slash.
@exception com::sun::star::uno::Exception
*/
rtl
::
OUString
JVM
::
buildClassPathFromDirectory
(
const
rtl
::
OUString
&
relPath
)
{
rtl
::
OUString
sInstallDir
;
rtl
::
Bootstrap
::
get
(
OUSTR
(
"BaseInstallation"
),
sInstallDir
,
OUSTR
(
"${$SYSBINDIR/"
SAL_CONFIGFILE
(
"bootstrap"
)
":BaseInstallation}"
));
rtl
::
OUString
sClassesDir
=
sInstallDir
+
OUSTR
(
"/"
)
+
relPath
;
osl
::
Directory
dir
(
sClassesDir
);
osl
::
FileBase
::
RC
fileErrorCode
;
if
((
fileErrorCode
=
dir
.
open
())
!=
osl
::
FileBase
::
E_None
)
// if ((fileErrorCode = dir.open()) != osl::FileBase::RC::E_None)
{
rtl
::
OUString
sMsg
(
OUSTR
(
"[javavm.cxx]File operation failed. Error: "
)
+
rtl
::
OUString
::
valueOf
((
sal_Int32
)
fileErrorCode
));
throw
css
::
uno
::
Exception
(
sMsg
,
0
);
}
osl
::
DirectoryItem
dirItem
;
rtl
::
OUStringBuffer
sBuffer
(
2048
);
char
szSep
[]
=
{
SAL_PATHSEPARATOR
,
0
};
//insert the path to the directory, so that .class files can be found
rtl
::
OUString
sDirPath
;
if
((
fileErrorCode
=
osl
::
FileBase
::
getSystemPathFromFileURL
(
sClassesDir
,
sDirPath
))
!=
osl
::
FileBase
::
E_None
)
{
rtl
::
OUString
sMsg
(
OUSTR
(
"[javavm.cxx]File operation failed. Error: "
)
+
rtl
::
OUString
::
valueOf
((
sal_Int32
)
fileErrorCode
));
throw
css
::
uno
::
Exception
(
sMsg
,
0
);
}
sBuffer
.
append
(
sDirPath
);
sBuffer
.
appendAscii
(
szSep
);
rtl
::
OUString
sJarExtension
(
OUSTR
(
".jar"
));
sal_Int32
nJarExtensionLength
=
sJarExtension
.
getLength
();
for
(;;)
{
fileErrorCode
=
dir
.
getNextItem
(
dirItem
);
if
(
fileErrorCode
==
osl
::
FileBase
::
E_None
)
{
osl
::
FileStatus
stat
(
FileStatusMask_All
);
if
((
fileErrorCode
=
dirItem
.
getFileStatus
(
stat
))
!=
osl
::
FileBase
::
E_None
)
{
rtl
::
OUString
sMsg
(
OUSTR
(
"[javavm.cxx]File operation failed. Error: "
)
+
rtl
::
OUString
::
valueOf
(
(
sal_Int32
)
fileErrorCode
));
throw
css
::
uno
::
Exception
(
sMsg
,
0
);
}
// check if the item is a file.
switch
(
stat
.
getFileType
())
{
case
osl
:
:
FileStatus
::
Regular
:
break
;
case
osl
:
:
FileStatus
::
Link
:
{
rtl
::
OUString
sLinkURL
=
stat
.
getLinkTargetURL
();
osl
::
DirectoryItem
itemLink
;
if
(
osl
::
DirectoryItem
::
get
(
sLinkURL
,
itemLink
)
!=
osl
::
FileBase
::
E_None
)
{
throw
css
::
uno
::
Exception
();
}
osl
::
FileStatus
statLink
(
FileStatusMask_All
);
if
(
statLink
.
getFileType
()
!=
osl
::
FileStatus
::
Regular
)
continue
;
//ToDo check if the link is also a regular file:
break
;
}
default
:
continue
;
}
//check if the file is a .jar, class files are ignored
rtl
::
OUString
sFileName
=
stat
.
getFileName
();
sal_Int32
len
=
sFileName
.
getLength
();
sal_Int32
nIndex
=
sFileName
.
lastIndexOf
(
sJarExtension
);
if
((
nIndex
==
-
1
)
||
(
nIndex
+
nJarExtensionLength
!=
len
))
continue
;
rtl
::
OUString
sFileURL
=
stat
.
getFileURL
();
rtl
::
OUString
sFilePath
;
if
((
fileErrorCode
=
osl
::
FileBase
::
getSystemPathFromFileURL
(
sFileURL
,
sFilePath
))
!=
osl
::
FileBase
::
E_None
)
{
rtl
::
OUString
sMsg
(
OUSTR
(
"[javavm.cxx]File operation failed. Error: "
)
+
rtl
::
OUString
::
valueOf
(
(
sal_Int32
)
fileErrorCode
));
throw
css
::
uno
::
Exception
(
sMsg
,
0
);
}
sBuffer
.
append
(
sFilePath
);
sBuffer
.
appendAscii
(
szSep
);
}
else
if
(
fileErrorCode
==
osl
::
FileBase
::
E_NOENT
)
{
break
;
}
else
{
rtl
::
OUString
sMsg
(
OUSTR
(
"File operation failed. Error:"
)
+
rtl
::
OUString
::
valueOf
(
(
sal_Int32
)
fileErrorCode
));
throw
css
::
uno
::
Exception
();
}
}
return
sBuffer
.
makeStringAndClear
();
}
void
JVM
::
setVersion
(
const
rtl
::
OUString
&
sVersion
)
{
_version
=
sVersion
;
}
const
::
rtl
::
OUString
&
JVM
::
getVersion
()
const
{
return
_version
;
}
void
JVM
::
setJavaHome
(
const
::
rtl
::
OUString
&
sHomeUrl
)
{
// we need a system path and not a file URL
OUString
usSysPath
;
oslFileError
er
=
osl_getSystemPathFromFileURL
(
sHomeUrl
.
pData
,
&
usSysPath
.
pData
);
_java_home
=
usSysPath
;
}
// void JVM::setEnabled(sal_Bool sbFlag)
// {
// _enabled = sbFlag;
// }
void
JVM
::
addClassPath
(
const
OUString
&
classpath
)
{
if
(
classpath
.
getLength
()
)
{
OUStringBuffer
buf
(
_classpath
.
getLength
()
+
1
+
classpath
.
getLength
());
if
(
_classpath
.
getLength
()
)
{
buf
.
append
(
_classpath
);
buf
.
appendAscii
(
CLASSPATH_DELIMETER
);
}
buf
.
append
(
classpath
);
_classpath
=
buf
.
makeStringAndClear
();
}
}
void
JVM
::
setRuntimeLib
(
const
OUString
&
libName
)
{
_runtimeLib
=
libName
;
}
const
OUString
&
JVM
::
getRuntimeLib
()
const
{
return
_runtimeLib
;
}
// sal_Bool JVM::isEnabled() const
// {
// return _enabled;
// }
rtl
::
OUString
JVM
::
getClassPath
()
const
{
return
_classpath
;
}
const
::
std
::
vector
<
::
rtl
::
OUString
>
&
JVM
::
getProperties
()
const
const
::
std
::
vector
<
::
rtl
::
OUString
>
&
JVM
::
getProperties
()
const
{
{
return
_props
;
return
_props
;
}
}
const
OUString
&
JVM
::
getJavaHome
()
const
{
return
_java_home
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment