mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 16:35:45 +01:00
create config package
This commit is contained in:
@@ -43,6 +43,9 @@ import org.kohsuke.args4j.Option;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import sonia.scm.cli.config.ConfigOptionHandler;
|
||||
import sonia.scm.cli.config.ScmClientConfig;
|
||||
import sonia.scm.cli.config.ServerConfig;
|
||||
import sonia.scm.util.IOUtil;
|
||||
import sonia.scm.util.Util;
|
||||
|
||||
|
||||
@@ -47,6 +47,6 @@ import java.lang.annotation.RetentionPolicy;
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Command
|
||||
{
|
||||
String value() default "";
|
||||
String usage() default "";
|
||||
String value() default "";
|
||||
String usage() default "";
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ import org.kohsuke.args4j.Option;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import sonia.scm.cli.config.ServerConfig;
|
||||
import sonia.scm.client.ScmClient;
|
||||
import sonia.scm.client.ScmClientSession;
|
||||
import sonia.scm.util.IOUtil;
|
||||
|
||||
@@ -83,7 +83,7 @@ public class SubCommandOptionHandler extends OptionHandler<SubCommand>
|
||||
* @param setter
|
||||
*/
|
||||
public SubCommandOptionHandler(CmdLineParser parser, OptionDef option,
|
||||
Setter<? super SubCommand> setter)
|
||||
Setter<? super SubCommand> setter)
|
||||
{
|
||||
super(parser, option, setter);
|
||||
subCommands = new HashMap<String, CommandDescriptor>();
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
|
||||
package sonia.scm.cli;
|
||||
package sonia.scm.cli.config;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
@@ -31,17 +31,20 @@
|
||||
|
||||
|
||||
|
||||
package sonia.scm.cli;
|
||||
package sonia.scm.cli.config;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
@XmlRootElement(name = "client-config")
|
||||
public class ScmClientConfig
|
||||
{
|
||||
|
||||
@@ -78,9 +81,7 @@ public class ScmClientConfig
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
|
||||
// TODO load config
|
||||
instance = new ScmClientConfig();
|
||||
instance = load();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,6 +89,33 @@ public class ScmClientConfig
|
||||
return instance;
|
||||
}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private static ScmClientConfig load()
|
||||
{
|
||||
|
||||
// TODO load config
|
||||
return new ScmClientConfig();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*/
|
||||
public void store()
|
||||
{
|
||||
|
||||
// TODO
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
|
||||
package sonia.scm.cli;
|
||||
package sonia.scm.cli.config;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user