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