1 package com.atlassian.plugin.parsers;
2
3
4 import com.atlassian.util.concurrent.LazyReference;
5 import com.google.common.annotations.VisibleForTesting;
6
7 import javax.annotation.Nonnull;
8
9 import static java.lang.System.getProperty;
10
11
12
13
14 public class DefaultSafeModeCommandLineArgumentsFactory implements SafeModeCommandLineArgumentsFactory {
15 private static final String PARAMETER_SYSTEM_PROPERTY = "atlassian.plugins.startup.options";
16 private LazyReference<SafeModeCommandLineArguments> safeModeCommandLineArguments = new LazyReference<SafeModeCommandLineArguments>() {
17 @Override
18 protected SafeModeCommandLineArguments create() throws Exception {
19 return new SafeModeCommandLineArguments(getProperty(PARAMETER_SYSTEM_PROPERTY, ""));
20 }
21 };
22
23
24
25
26
27
28
29
30
31 @VisibleForTesting
32 @Nonnull
33 String getParameterSystemProperty() {
34 return PARAMETER_SYSTEM_PROPERTY;
35 }
36
37 @Override
38 public SafeModeCommandLineArguments get() {
39 return safeModeCommandLineArguments.get();
40
41 }
42 }