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