]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/OsgiBootUtils.java
2 * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org
.argeo
.osgi
.boot
;
19 /** Utilities, mostly related to logging. */
20 public class OsgiBootUtils
{
22 public static void info(Object obj
) {
23 System
.out
.println("# OSGiBOOT # " + obj
);
26 public static void debug(Object obj
) {
27 System
.out
.println("# OSGiBOOT DBG # " + obj
);
30 public static void warn(Object obj
) {
31 System
.out
.println("# OSGiBOOT WARN # " + obj
);
32 // Because of a weird bug under Windows when starting it in a forked VM
33 // if (System.getProperty("os.name").contains("Windows"))
34 // System.out.println("# WARN " + obj);
36 // System.err.println("# WARN " + obj);
40 * Gets a property value
42 * @return null when defaultValue is ""
44 public static String
getProperty(String name
, String defaultValue
) {
46 if (defaultValue
!= null)
47 value
= System
.getProperty(name
, defaultValue
);
49 value
= System
.getProperty(name
);
51 if (value
== null || value
.equals(""))
57 public static String
getProperty(String name
) {
58 return getProperty(name
, null);